WebObjects 5.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

adaptorContextDidBegin

public 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()

adaptorContextDidCommit

public 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()

adaptorContextDidRollback

public 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()

adaptorContextShouldBegin

public 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(), adaptorContextShouldCommit(com.webobjects.eoaccess.EOAdaptorContext)

adaptorContextShouldCommit

public 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(), adaptorContextShouldBegin(com.webobjects.eoaccess.EOAdaptorContext)

adaptorContextShouldConnect

public 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.

adaptorContextShouldRollback

public 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()

Last updated Fri Feb 21 13:15:00 PST 2003.

Copyright © 2003 Apple Computer, Inc.