Porting a JavaService app (Windows Service) to run on Websphere - best parent class?

70 views Asked by At

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?)

1

There are 1 answers

0
hawkeye On BEST ANSWER

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