Interface RemoteCommitListener

  • All Superinterfaces:
    Closeable
    All Known Implementing Classes:
    ConcurrentDataCache, ConcurrentQueryCache, PartitionedDataCache

    public interface RemoteCommitListener
    extends Closeable
    An entity that wishes to be notified when Brokers associated with remote BrokerFactories commit. A RemoteCommitListener is not notified of commits that originated with a Broker created from the BrokerFactory that it is registered with. (Of course, if a listener is registered with multiple factories, this situation might be complicated a bit.) Usage:
     import org.apache.openjpa.event.*;
     import org.apache.openjpa.conf.*;
    
     OpenJPAConfiguration conf =
             factory.getConfiguraiton ();
      RemoteCommitListener l = new RemoteCommitListener () {
     public void afterCommit (RemoteCommitEvent e) {
     // update a Swing widget when remote brokers make
     // changes to reference data }
      public void close () { } };
      conf.getRemoteCommitEventManager ().addListener (l);
     
    Since:
    0.2.5.0
    Author:
    Patrick Linskey
    • Method Detail

      • afterCommit

        void afterCommit​(RemoteCommitEvent event)
        Notification that a transaction associated with a different BrokerFactory has successfully committed.
      • close

        void close()
        Free the resources used by this listener.
        Specified by:
        close in interface Closeable