Hi,
I need my Threads to return objects and throw Exceptions.
I am using java 1.5 Callable interface.
I have tried using the Future Object in Java 1.5.
Cant get it using the get() function of.
My program just hangs when it reaches the .get function of the class.
I am writing excrepts of my programs to make my problem clear.
Would really appriciate if I could get some explanation as I have not been able to understand clearly how Callable and Future work in Java 1.5
My Code:
private ExecutorService exServ = Executors.newFixedThreadPool(MAX_THREADS);
Future<resultData.B1Result> b1Result = exServ.submit(this);
public resultData.B1Result call() throws DryRunException
{
/*
might throw the DryRunException or
return b1Result;
*/
}
I have tried the statement:
b1Result.get();
but the software just hangs there.
Any help would be appriciated.
thanks in advance
Arrow
I need my Threads to return objects and throw Exceptions.
I am using java 1.5 Callable interface.
I have tried using the Future Object in Java 1.5.
Cant get it using the get() function of.
My program just hangs when it reaches the .get function of the class.
I am writing excrepts of my programs to make my problem clear.
Would really appriciate if I could get some explanation as I have not been able to understand clearly how Callable and Future work in Java 1.5
My Code:
private ExecutorService exServ = Executors.newFixedThreadPool(MAX_THREADS);
Future<resultData.B1Result> b1Result = exServ.submit(this);
public resultData.B1Result call() throws DryRunException
{
/*
might throw the DryRunException or
return b1Result;
*/
}
I have tried the statement:
b1Result.get();
but the software just hangs there.
Any help would be appriciated.
thanks in advance
Arrow