How to manage background processes in my portal application

Sometimes you need to install background processes in your portal application. Application specific tasks (i.e. scheduling) should be done in the portal application rather than in the Jetspeed portal (see How to use the Scheduler service).

To achieve this, just write a class that implements the ServletContext_'_'Listener interface and reference it in the web.xml of the portal application.

<listener>
    <listener-class>SampleContextListener</listener-class>
</listener> 

The methods

contextInitialized(ServletContextEvent sce) 

contextDestroyed(ServletContextEvent sce)

can be used to do things on deploy, redeploy and undeploy of the application.

  • No labels