users@glassfish.java.net

Re: Interrupting a running Servlet

From: <glassfish_at_javadesktop.org>
Date: Wed, 02 Apr 2008 10:37:16 PST

Hi Wolfram!

Sorry for so much confusion.

Ok, to lift the fog a little I will explain the whole idea in detail, what I have and what I want. I will leave out the webserver and servlet container details.

I have:

a) a C-DSO residing on a webserver, which executes a process in a Linux Kernel with real time extensions. This process is to obtain a buch of values from a measurement device connected to the webserver. This may take a long time. But this isn't my part. All I care about is that the C-DSO HAS to be on the webserver!

b) a Java application or applet (not sure yet) which is able to visualize the data provided by the C process. Also it is able to start the measurement and stop it at any time.

I want:

...my application/applet to be able to start and stop the C process on the webserver. Nothing more. :)

Our first idea was to use servlets for this purpose. So far I've been able to invoke a servlet that calls the start method of the C-DSO. Directly by typing the servlet URL in the browser's address bar. But that's not what I need.

I thought of it this way:

I invoke the servlet from my application with request that informs it of what it should do. Than the servlet starts C-process in a seperate thread and stays active to listen to further requests, which might i.e. be a stop request. After the C-process has done what I want it should terminate, the thread in which it lived should terminate and finally the servlet should cease to be.

Is this approach totally nuts and overly complicated? As I mentioned before, I'm not really into JavaEE, still I have to get the job done.

Do you have any other suggestions on how to get there, maybe without servlets?

I'm ashamed I lack so much experience in this case. Sorry for torturing you! :D

- Thomas
[Message sent by forum member 'stylertim' (stylertim)]

http://forums.java.net/jive/thread.jspa?messageID=267387