private String synchronization MyServletHardwareCallingRoutine(HttpRequest
BlaBla){
CALL THE HARDWARE HERE
return INFO
}
SYNCHRONIZATION will allow only one thread at a time, so they will Q.
BUT so will the clients wait.
If the clients do not need a reply from the hardware then
private void MyServletHardwareCallingRoutineAsBackGroundProcess(HttpRequest
BlaBla){
new HardwareSrvr().asyncStartServer();
}
public class HardwareSrvr implements Runnable {
private Thread runner;
public HardwareSrvr () {
}
public void asyncStartServer(){
runner = new Thread(this);
runner.start();
}
}
public void run() {
CALL HARWARE HERE
}
}
regards
Johnny
Free Software at http://coolese.100free.com/
----- Original Message -----
From: "Tom Kobialka" <[EMAIL PROTECTED]>
To: <users@tomcat.apache.org>
Sent: Monday, March 26, 2007 7:38 AM
Subject: Service instance serialization question
Hi,
I have a web service which is running under the Tomcat container. Tomcat
creates a new instance of
this web service with each incoming simultaneous connection. The problem I
am having, is that my web service
calls a hardware device which can only handle one query at a time. If I
have 5 instances of my web service
all querying it at the same time, it hangs. I need to implement some sort
of serialization such that only one
request is processed from each instance at a time. Is it possible to
serialize between service instances, which
have been created by tomcat? Is there some external library to tomcat
shared memory object which will
allow me to do this? I have had a look around the web, but I'm not really
sure where to start. I've come
across messaging solutions, but all these seem to be targeted towards
serialization between services located
on completely different tomcat instances (JMS).
Cheers
Tom
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]