Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.openjpa.event
Class RemoteCommitEventManager

    java.lang.Object
      org.apache.openjpa.lib.util.concurrent.AbstractConcurrentEventManager
          org.apache.openjpa.event.RemoteCommitEventManager

All Implemented Interfaces:
  EndTransactionListener, Closeable, EventManager

    public class RemoteCommitEventManager

extends AbstractConcurrentEventManager
implements EndTransactionListener, Closeable

Manager that can be used to track and notify `RemoteCommitListener`s on remote commit events. If remote events are enabled, this manager should be installed as a transaction listener on all brokers so that it knows when commits are made.

Since:
  0.3.0
Author:
  Patrick Linskey, Abe White

Constructor Summary
`RemoteCommitEventManager(OpenJPAConfiguration conf)` Constructor.

Method Summary
`void` | `addListener(RemoteCommitListener listen)`
`void` | `afterCommit(TransactionEvent event)` Notification that a transaction has successfully committed.
`void` | `afterCommitComplete(TransactionEvent event)` Notification that a transaction has successfully committed and the transaction is no longer active.
`void` | `afterRollback(TransactionEvent event)` Notification that a transaction has been rolled back.
`void` | `afterRollbackComplete(TransactionEvent event)` Notification that a transaction has been rolled back and the transaction is no longer active.
`void` | `afterStateTransitions(TransactionEvent event)` Notification that state transitions are complete.
`boolean` | `areRemoteEventsEnabled()` Return true if remote events are enabled.
`void` | `beforeCommit(TransactionEvent event)` Notification that the next flush is for the transaction commit.
`void` | `close()` Close this manager and all registered listeners.
`protected void` | `fireEvent(Object event, Object listener)` Implement this method to fire the given event to the given listener.
`RemoteCommitProvider` | `getRemoteCommitProvider()` Return the `RemoteCommitProvider` that this manager uses.
`boolean` | `getTransmitPersistedObjectIds()` Whether the oids of added instances will be transmitted.
`void` | `setTransmitPersistedObjectIds(boolean transmit)` Whether the oids of added instances will be transmitted.

Methods inherited from class org.apache.openjpa.lib.util.concurrent.AbstractConcurrentEventManager
`addListener, fireEvent, getListeners, hasListener, hasListeners, isFailFast, newListenerCollection, removeListener, setFailFast`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RemoteCommitEventManager

    public RemoteCommitEventManager(OpenJPAConfiguration conf)

  Constructor. Supply configuration.

Method Detail

### areRemoteEventsEnabled

    public boolean areRemoteEventsEnabled()

  Return true if remote events are enabled.

### getRemoteCommitProvider

    public RemoteCommitProvider getRemoteCommitProvider()

  Return the `RemoteCommitProvider` that this manager uses.

  Since:
    0.3.1

### getTransmitPersistedObjectIds

    public boolean getTransmitPersistedObjectIds()

  Whether the oids of added instances will be transmitted.

### setTransmitPersistedObjectIds

    public void setTransmitPersistedObjectIds(boolean transmit)

  Whether the oids of added instances will be transmitted.

### addListener

    public void addListener(RemoteCommitListener listen)

### close

    public void close()

  Close this manager and all registered listeners.

  Specified by:
    `close` in interface `Closeable`

### fireEvent

    protected void fireEvent(Object event,
                             Object listener)

  Description copied from class: `AbstractConcurrentEventManager`
  Implement this method to fire the given event to the given listener.

  Specified by:
    `fireEvent` in class `AbstractConcurrentEventManager`

### afterCommit

    public void afterCommit(TransactionEvent event)

  Description copied from interface: `EndTransactionListener`
  Notification that a transaction has successfully committed.

  Specified by:
    `afterCommit` in interface `EndTransactionListener`
  See Also:
    `TransactionEvent.AFTER_COMMIT`

### beforeCommit

    public void beforeCommit(TransactionEvent event)

  Description copied from interface: `EndTransactionListener`
  Notification that the next flush is for the transaction commit.

  Specified by:
    `beforeCommit` in interface `EndTransactionListener`
  See Also:
    `TransactionEvent.BEFORE_COMMIT`

### afterRollback

    public void afterRollback(TransactionEvent event)

  Description copied from interface: `EndTransactionListener`
  Notification that a transaction has been rolled back.

  Specified by:
    `afterRollback` in interface `EndTransactionListener`
  See Also:
    `TransactionEvent.AFTER_ROLLBACK`

### afterCommitComplete

    public void afterCommitComplete(TransactionEvent event)

  Description copied from interface: `EndTransactionListener`
  Notification that a transaction has successfully committed and the transaction is no longer active.

  Specified by:
    `afterCommitComplete` in interface `EndTransactionListener`
  See Also:
    `TransactionEvent.AFTER_COMMIT_COMPLETE`

### afterRollbackComplete

    public void afterRollbackComplete(TransactionEvent event)

  Description copied from interface: `EndTransactionListener`
  Notification that a transaction has been rolled back and the transaction is no longer active.

  Specified by:
    `afterRollbackComplete` in interface `EndTransactionListener`
  See Also:
    `TransactionEvent.AFTER_ROLLBACK_COMPLETE`

### afterStateTransitions

    public void afterStateTransitions(TransactionEvent event)

  Description copied from interface: `EndTransactionListener`
  Notification that state transitions are complete.

  Specified by:
    `afterStateTransitions` in interface `EndTransactionListener`
  See Also:
    `TransactionEvent.AFTER_STATE_TRANSITIONS`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006 Apache Software Foundation. All Rights Reserved.