I have a function which in executing a thread
Public Class Connector{
private static void anyFileConnector() {
// Starting searching Thread
traverse.executeTraversing();
}
}
public class Traverse {
private synchronized void executeTraversing(Path dir) {
ExecutorService executor = Executors.newFixedThreadPool(1);
// Doing some operation
executor.submit(newSearch);
}
}
} catch (IOException | DirectoryIteratorException x) {
// IOException can never be thrown by the iteration.
} finally {
executor.shutdown();
}
}
}
public class Search implements Runnable {
private List<ResultBean> result = new ArrayList<ResultBean>();
public void run() {
synchronized (Search.class) {
// In this Search Method i am setting above list "result"
this.search();
}
}
I want "result" object with values in my Connector class just after the "executeTraversing" method with least code change. What is the best way to get it there.
All the above classes are in different packages.
I dont know, how can i google it also :(