Inside Scoop on J2EE : Tips and tricks on J2EE and Oracle Application Server by Debu Panda
Updated: 11/18/2004; 5:20:25 PM.

 

Subscribe to "Inside Scoop on J2EE" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

Wednesday, May 19, 2004

Some business applications require to automatically instantiate and execute business logic during the initialization of the container. Almost all leading J2EE containers (Weblogic, OC4J, Websphere, JBoss) provide facilities for Application Code (Java classes) to be executed when J2EE container starts up or shuts down and these are popularly known as Startup/Shutdown classes. In the startup class you can initialize environment constants, services, and make calls to other classes.

The greatest problem is that all these vendors implement this feature their own way and there is no standard. Customers attempting to migrate their applications that depend upon startup/shutdown functionality may have to modify their application to use vendor specific APIs.

BEA Calls these as Startup/Shutdown classes. Oracle also refers these as Startup/Shutdown classes. IBM calls these as Custom Service. JBoss also calls this as Startup classes. But looking at these examples it is apparent that if someone uses this feature in his application source code change is obvious during migration to another container and that defeats the sole spirit of Java/J2EE "Write once, run any where!"

One of our partners showed their displeasure for not having a standard when they migrated their applications to OC4J. Another ISV showed their discomfort for having to maintain separate code for the J2EE containers they support. 

This raises the big question "Why startup/shutdown classes are not part of standard?" if this is really useful for J2EE customers. In my opinion the J2EE 1.5 expert committee should look at this requirement and try to standardize this as a part of J2EE for enabling organizations to give them real application portability.

Update:

Vinny Carpenter provided a J2EE standard way as documented in his blog. I forgot to mention that we suggested this types of approaches to our customers to use that's portable e.g. using as an application client that executes automatically,  using ServletContextListener.  But this does not some satisfy requirements for some customers and ISVs and they want this code to be executed  prior to  startup of any applications.

 


12:41:25 PM    comment []

© Copyright 2004 Debu Panda.

PS: These are my own thoughts and not of my employer ..



Click here to visit the Radio UserLand website.
 


May 2004
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Apr   Jun