WebObjects 5.4.2

com.webobjects.eoaccess
Interface EOAdaptorContext.Delegate

Enclosing class:
EOAdaptorContext

public static interface EOAdaptorContext.Delegate

EOAdaptorContext invokes its delegate any time a transaction is begun, committed, or rolled back. The delegate can use these methods to preempt these operations, modify their results, or simply track activity.


Method Summary
 void adaptorContextDidBegin(EOAdaptorContext adaptorContext)
          Invoked from beginTransaction or transactionDidBegin to tell the delegate that a transaction has begun.
 void adaptorContextDidCommit(EOAdaptorContext adaptorContext)
          Invoked from commitTransaction or transactionDidCommit to tell the delegate that a transaction has been committed.
 void adaptorContextDidRollback(EOAdaptorContext adaptorContext)
          Invoked from rollbackTransaction or transactionDidRollback to tell the delegate that a transaction has been rolled back.
 boolean adaptorContextShouldBegin(EOAdaptorContext adaptorContext)
          Invoked from beginTransaction to ask the delegate whether the adaptor context object should begin a transaction.
 boolean adaptorContextShouldCommit(EOAdaptorContext adaptorContext)
          Invoked from commitTransaction to ask the delegate whether or not to commit a transaction.
 boolean adaptorContextShouldConnect(EOAdaptorContext adaptorContext)
          Invoked before the adaptor attempts to connect.
 boolean adaptorContextShouldRollback(EOAdaptorContext adaptorContext)
          Invoked from rollbackTransaction to ask the delegate whether or not to roll back a transaction.
 

Method Detail

adaptorContextShouldConnect

boolean adaptorContextShouldConnect(EOAdaptorContext adaptorContext)
Invoked before the adaptor attempts to connect. The delegate should return false if it wants to override the connect operation, true if it wants the adaptor to attempt to connect in the usual way. Should throw a runtime exception if it fails to connect.

Parameters:
adaptorContext - An adaptor context object.
Returns:
Should return true to permit the adaptor to attempt to connect.

adaptorContextShouldBegin

boolean adaptorContextShouldBegin(EOAdaptorContext adaptorContext)
Invoked from beginTransaction to ask the delegate whether the adaptor context object should begin a transaction. The delegate should return true to allow the adaptor context to begin a transaction, false to prevent the transaction. If the delegate returns false, it is the delegate's responsibility to handle the transaction state. It might start its own transaction or it might return false from adaptorContextShouldCommit in order to control the transaction in a private way.

Parameters:
adaptorContext - An adaptor context object.
Returns:
Should return true to allow the adaptor context to begin a transaction.
See Also:
EOAdaptorContext.beginTransaction(), EOAdaptorContext.Delegate.adaptorContextShouldCommit(com.webobjects.eoaccess.EOAdaptorContext)

adaptorContextDidBegin

void adaptorContextDidBegin(EOAdaptorContext adaptorContext)
Invoked from beginTransaction or transactionDidBegin to tell the delegate that a transaction has begun. The delegate may take whatever action it needs based on this information.

Parameters:
adaptorContext - An adaptor context object.
See Also:
EOAdaptorContext.beginTransaction(), EOAdaptorContext.transactionDidBegin()

adaptorContextShouldCommit

boolean adaptorContextShouldCommit(EOAdaptorContext adaptorContext)
Invoked from commitTransaction to ask the delegate whether or not to commit a transaction. If this method returns false, the adaptor context does not commit the transaction; the delegate must perform the database COMMIT itself.

Parameters:
adaptorContext - An adaptor context object.
Returns:
Should return true to allow the adaptor context to commit.
See Also:
EOAdaptorContext.commitTransaction(), EOAdaptorContext.Delegate.adaptorContextShouldBegin(com.webobjects.eoaccess.EOAdaptorContext)

adaptorContextDidCommit

void adaptorContextDidCommit(EOAdaptorContext adaptorContext)
Invoked from commitTransaction or transactionDidCommit to tell the delegate that a transaction has been committed. The delegate may take whatever action it needs based on this information.

Parameters:
adaptorContext - An adaptor context object.
See Also:
EOAdaptorContext.commitTransaction(), EOAdaptorContext.transactionDidCommit()

adaptorContextShouldRollback

boolean adaptorContextShouldRollback(EOAdaptorContext adaptorContext)
Invoked from rollbackTransaction to ask the delegate whether or not to roll back a transaction. Should return true to allow the adaptor context object to roll back the transaction, false to prevent the rollback.

Parameters:
adaptorContext - An adaptor context object.
Returns:
Should return true to allow the adaptor context to roll back the transaction.
See Also:
EOAdaptorContext.rollbackTransaction()

adaptorContextDidRollback

void adaptorContextDidRollback(EOAdaptorContext adaptorContext)
Invoked from rollbackTransaction or transactionDidRollback to tell the delegate that a transaction has been rolled back. The delegate may take whatever action it needs based on this information.

Parameters:
adaptorContext - An adaptor context object.
See Also:
EOAdaptorContext.rollbackTransaction(), EOAdaptorContext.transactionDidRollback()

Last updated June 2008

Copyright © 2000-2008 Apple Inc.