Hi I am using a
java bean in
JSP.
This bean calls a perticular api which tries to connect to some legacy back end system.
Sometimes the api which i call respond back after say 10 mins & its 2 long for a user to wait .
I want to find out a way where while calling this api from java bean is their any way to set time out ...
For eg..
public class A
{
public static int endless()
{
int i = 0;
while(i!=1)
{
}
return i;
}
}
public class B
{
public static void main(
String args[])
{
System.out.println("Before A ");
A.endless();
System.out.println("After A ");
}
}
This above code creates a dead lock which some times happen in our system. i want to add a timer mechanism while calling A.endless() ....
Any ideas how..
Cheers
Nehal.