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:

  1. make sure create_watchable() returns correct type. needs returning of type whatch_directory based on code.

  2. make sure create_watchable() isn't returning null reason.

  3. make sure create_watchable() isn't throwing exception.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -