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 Details

    • setDistributedReadOnlyBeanNotifier

      void setDistributedReadOnlyBeanNotifier(DistributedReadOnlyBeanNotifier notifier)
      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 container
      loader - the class loader that will be used to serialize/de-serialize the primary key
      handler - 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

      void notifyRefresh(long ejbID, Object pk)
      Called by the container after it has refreshed the RO bean
      Parameters:
      ejbID - the ejbID that uniquely identifies the container
      pk - 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 container
      pk - 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