views:

23

answers:

1

We are using Oracle Weblogic 10.3 as our application server. We have multiple modules that need to access an Object (contains some HashMaps) that is common for the managed server. This object will be populated via some other process on a daily basis. We do not want to have copies of this in each application, due to the large number of applications and limited memory. We cannot combine these into one ear since the individual (wars) would need to be updated on differing schedules.

I have tried creating an optional package and referencing it in two modules. The class being access just wraps calls to a singleton of the object. But what happens a separate singleton is created for each application, defeating the purpose.

It appears startup classes were deprecated sometime around or after 8.1, and now gone in 10.3.

Is there any way to have this object and other code "live" above the application/module level, have only one copy per jvm / managed server, and be accessible by all modules deployed to the same managed server?

Bonus points if the solution would also work in Tomcat.

A: 

It appears startup classes were deprecated sometime around or after 8.1, and now gone in 10.3.

Indeed. But they are "replaced" by an Application Life Cycle Events API so they are kinda still there.

Is there any way to have this object and other code "live" above the application/module level, have only one copy per jvm / managed server, and be accessible by all modules deployed to the same managed server?

Not exactly what you're asking for but you could implement a service on top of a caching solution like EHCache and expose this service via a Stateless Session Bean or a Web Service (or even both). If this is not an option, can you clarify the exact need?

Pascal Thivent
I wasn't aware of the Weblogic Life Cycle Events, I have tried ServletContextListeners though. We are experimenting trying to find a replacement for some of the functionality we currently do with Tangosol/Coherence now, which seems similar to EHCache. We have a hashmap that will be need to be read potentially millions of times per day with low latency requirements. We had hoped this could be accessible to the applications without creating an EJB or similiar in front of it. But if that is the only way to do it we may have to. I am more worried about performance than implementation.
bobtheowl2
@bobtheowl2: Coherence is a great product and if the license cost is not an issue, stick with it. If it is, a solution around EHCache could be a good alternative. Regarding the SLSB, if you use local interfaces, the overhead should be pretty low. But, as always, measure it.
Pascal Thivent