Reputation: 2072
in our project we have a need for distributed synchronization where a given thread's lock state has to be synchronized on multiple nodes in a cluster so that the threads running on other nodes can wait on this locked object. I know Java does not do this across JVMs. I don't have the leverage to introduce a new 3rd party product (like Terracotta) at this stage in our project. I was wondering if Weblogic (11g) has some inbuilt facility that allows me to achieve this...
Upvotes: 2
Views: 1444
Reputation: 49241
You can use SingletonService
. It is a cluster-wide singleton in WebLogic. You should bind it to a JNDI name in activate
method and then make lookup and call from other beans. Remember to implement your singleton service object as a plain RMI object not EJB, so make an interface extending Remote
and add RemoteExceptions
to methods.
For this to work you must configure WebLogic cluster service migration and migration basis.
Here is a complete guide for implementing and configuring the service.
Upvotes: 2