Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Improving Java EE Application startup time with the WorkManager API

Improving Java EE Application startup time with the WorkManager API

A new article on JavaWorld details how to improve the startup time of a Java EE application by converting startup servlets into Work Implementations handled by the WorkManager API. The WorkManager API is an API supported by multiple application servers and designed to allow parallel task execution inside of a managed environment.

The WorkManager API, submitted by BEA and IBM as JSR-237 (which has apparently not gone very far), is supported in Weblogic 9, WebSphere 6, as well as Tangusol's Coherence. It is a simple API allowing you to define pieces of work to be executed in parallel.

A work manager starts a parallel daemon worker thread along with the application server. You configure the work manager through the administration console and give it a Java Naming and Directory Interface (JNDI) name, just as you attach a JNDI name to an EJB component. This JNDI name attached to the work manager is available in the global namespace. When you want your Web module to perform an action, you create an implementation of the Work interface and submit that instance to the work manager. The work manager daemon creates another thread, which invokes the run method of your Work implementation. Hence, using a thread pool the work manager can create threads for as many Work implementations submitted to it. Not only that, the work manager takes a snapshot of the current Java EE context on the thread when the work is submitted.

The article walks through converting an application that has several startup servlets that causes startup time to be on the order of 200minutes. They are able to dramatically improve startup time by allowing the tasks to execute in parallel.

An article on BEA's dev2dev site describes using the WorkManager API in WebLogic Server 9.0 beta. The WorkManager API was also discussed in the comments of an InfoQ post on Grid Computing with the Java Parallel Processing Framework.

Rate this Article