java - LinkedBlockQueue can't pass Watchable -
i want ask i'm doing ..
linkedblockingqueue<whatch_directory> queue = new linkedblockingqueue<classes.watchable.whatch_directory>(); queue.put(classes.watchable.whatch_directory.create_watchable("dir"));
but down classes.watchable etc function watchable class down him isn't showing, still watchable running.
if understand you're asking, you're creating whatch_directory
class somewhere else, trying make linkedblockingqueue
of such things , using factory method create_watchable()
create one.
if so, appears whatch_directory extending watchable interface (based on other questions). seems code should become more like:
class whatch_directory implements watchable { public static watchable create_watchable(string s) { // definition goes here } } linkedblockingqueue<whatch_directory> queue = new linkedblockingqueue<whatch_directory>(); queue.put(whatch_directory.create_watchable("dir");
some more explanation of intent helpful here things suggest check based on understanding:
make sure
create_watchable()
returns correct type. needs returning of typewhatch_directory
based on code.make sure
create_watchable()
isn't returningnull
reason.make sure
create_watchable()
isn't throwing exception.
Comments
Post a Comment