Forum Stats

  • 3,854,906 Users
  • 2,264,431 Discussions
  • 7,905,830 Comments

Discussions

Shared Java object across all browser sessions for WebLogic Portal (10.2)

659140
659140 Member Posts: 39
edited Sep 10, 2008 5:18PM in WebLogic Portal
Hello,

We have a need to instantiate a Java object when WebLogic Portal is starting up (prior to any browser requests). This Java object is 3 JMS subscribers which need to start receiving messages prior to any browser requests to the portal. There will be 3 portlets on the portal page and each portlet will display its associated subscriber's model (by polling via AJAX). Thus 2 or more currently connected browsers need to see the same model at the same time. One can think of the Java object as a singleton; however, the single design pattern isn't guaranteed in JEE environment.

Likewise, because the Java object is essentially JMS subscribers, when the portal is shutting down, the Java object needs to be notified so it can close the 3 subscribers' JMS connections.

Additionally, the 3 subscribers' models must remain in memory; thus, a solution to this cannot be "use a database".

If anyone here has also done WebSphere Portal Server, this implementation just described was achieved using their concept of "Portlet Services".

Thanks, Jim

Answers

  • 648793
    648793 Member Posts: 96
    I think you can use the Load at start up property of the web.xml of your web project of portal application. or if your portal is the only application deployed on the server then you may use the weblogic admin console to configure your startup or shutdown classes. These classes will be loaded after and before server starts up or shutdown.


    Hope this helps
This discussion has been closed.