Interface DistributedReadOnlyBeanService
public interface DistributedReadOnlyBeanService
DistributedReadOnlyBeanService defines the methods that can be used to
implement a distributed ReadOnly beans. An instance of
ReadOnlyBeanRefreshEventHandler is used to handle requests received from
other server instances. An instance of DistributedReadOnlyBeanNotifier is used to
notify other server instances.
- Author:
- Mahesh Kannan
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddReadOnlyBeanRefreshEventHandler(long ejbID, ClassLoader loader, ReadOnlyBeanRefreshEventHandler handler) Called from ReadOnlyBeanContainer to register itself as a ReadOnlyBeanRefreshEventHandler.voidhandleRefreshAllRequest(long ejbID) Called from the DistributedReadOnlyBeanNotifier when it receives a (remote) request to refresh all RO beansvoidhandleRefreshRequest(long ejbID, byte[] pkData) Called from the DistributedReadOnlyBeanNotifier when it receives a (remote) request to refresh a RO beanvoidnotifyRefresh(long ejbID, Object pk) Called by the container after it has refreshed the RO beanvoidnotifyRefreshAll(long ejbID) Called by the container after it has refreshed all RO beansvoidremoveReadOnlyBeanRefreshEventHandler(long ejbID) Called from ReadOnlyBeanContainer to unregister itself as a ReadOnlyBeanRefreshEventHandler.voidThis is typically done during appserver startup time.
-
Method Details
-
setDistributedReadOnlyBeanNotifier
This is typically done during appserver startup time. One of the LifeCycle listeners will create an instance of DistributedReadOnlyBeanNotifier and register that instance with DistributedReadOnlyBeanService- Parameters:
notifier- the notifier who is responsible for notifying refresh event(s) to other instances
-
addReadOnlyBeanRefreshEventHandler
void addReadOnlyBeanRefreshEventHandler(long ejbID, ClassLoader loader, ReadOnlyBeanRefreshEventHandler handler) Called from ReadOnlyBeanContainer to register itself as a ReadOnlyBeanRefreshEventHandler.- Parameters:
ejbID- the ejbID that uniquely identifies the containerloader- the class loader that will be used to serialize/de-serialize the primary keyhandler- The handler that is responsible for correctly refresing the state of a RO bean
-
removeReadOnlyBeanRefreshEventHandler
void removeReadOnlyBeanRefreshEventHandler(long ejbID) Called from ReadOnlyBeanContainer to unregister itself as a ReadOnlyBeanRefreshEventHandler. Typically called during undeployment.- Parameters:
ejbID-
-
notifyRefresh
Called by the container after it has refreshed the RO bean- Parameters:
ejbID- the ejbID that uniquely identifies the containerpk- the primary key to be refreshed
-
notifyRefreshAll
void notifyRefreshAll(long ejbID) Called by the container after it has refreshed all RO beans- Parameters:
ejbID- the ejbID that uniquely identifies the container
-
handleRefreshRequest
void handleRefreshRequest(long ejbID, byte[] pkData) Called from the DistributedReadOnlyBeanNotifier when it receives a (remote) request to refresh a RO bean- Parameters:
ejbID- the ejbID that uniquely identifies the containerpk- the primary key to be refreshed
-
handleRefreshAllRequest
void handleRefreshAllRequest(long ejbID) Called from the DistributedReadOnlyBeanNotifier when it receives a (remote) request to refresh all RO beans- Parameters:
ejbID- the ejbID that uniquely identifies the container
-