Question

I've been asked to port an existing Java app that runs as a windows service to run on Websphere. It is implemented using JavaService.exe and a stop_method

The type signature of the parent service class is:

public abstract class ParentService {
    public static void main(String args[]);
    public void requestStop();      
}

Note that the main method in the example above is the equivalent of the init method in a servlet (although it is static) - it is used for the same purpose.

What is the equivalent parent class for a continuously running object in the J2EE standard (or even in the Websphere custom standards?)

Was it helpful?

Solution

Assuming the big idea is mapping an init and a shutdown method to a Java interfaces in the Enterprise standards...

It turns out there are four alternatives (and three vendor specific ones):

  1. EJB 3.1 @Startup
  2. Startup Servlet
  3. ServletContextListener
  4. Resource Adapter to Perform as a Startup Class
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top