I want to ask you something i'm doing like that ..
LinkedBlockingQueue<Whatch_Directory> queue
= new LinkedBlockingQueue<classes.Watchable.Whatch_Directory>();
queue.put(classes.Watchable.Whatch_Directory.create_watchable("dir"));
but everything down from the classes.Watchable etc this is the function with the watchable class everything down him isn't showing, still only the watchable is running.
If I understand what you're asking, you're creating a Whatch_Directory
class somewhere else, trying to make a LinkedBlockingQueue
of such things and using a factory method create_watchable()
to create one.
If so, it appears that a Whatch_Directory is extending the Watchable interface (based on your other questions). It seems that your code should become something more like:
class Whatch_Directory implements Watchable {
public static Watchable create_watchable(String s) {
// Your definition goes here
}
}
LinkedBlockingQueue<Whatch_Directory> queue =
new LinkedBlockingQueue<Whatch_Directory>();
queue.put(Whatch_Directory.create_watchable("dir");
Some more explanation of your intent would be helpful but here are some things that I suggest you check based on my understanding:
Make sure that
create_watchable()
returns the correct type. It needs to be returning something of typeWhatch_Directory
based on your code.Make sure that
create_watchable()
isn't returningnull
for some reason.Make sure that
create_watchable()
isn't throwing an exception.
精彩评论