|
WebObjects 5.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.webobjects.eoaccess.EOAdaptorContext
|
+--com.webobjects.jndiadaptor.JNDIContext
The JNDIContext class represents a transaction scope on a
Java Naming and Directory Interface service.
| Inner classes inherited from class com.webobjects.eoaccess.EOAdaptorContext |
EOAdaptorContext.Delegate |
| Fields inherited from class com.webobjects.eoaccess.EOAdaptorContext |
AdaptorContextBeginTransactionNotification, AdaptorContextCommitTransactionNotification, AdaptorContextRollbackTransactionNotification |
| Constructor Summary | |
JNDIContext(EOAdaptor adaptor)
Creates a new instance of JNDIContext. |
|
| Method Summary | |
void |
beginTransaction()
An abstract method that should be implemented by subclasses to attempt to begin a new transaction. |
void |
commitTransaction()
An abstract method that should be implemented by subclasses to attempt to commit the last transaction begun. |
EOAdaptorChannel |
createAdaptorChannel()
An abstract method that should be implemented by subclasses to create and return a new EOAdaptorChannel, or null
if a new channel cannot be created. |
void |
handleDroppedConnection()
An abstract method that should be implemented by subclasses to clean up after the receiver's adaptor has lost its connection to its database server. |
InitialDirContext |
initialDirContext()
Gets the initial directory context. |
void |
rollbackTransaction()
An abstract method that should be implemented by subclasses to attempt to roll back the last transaction begun. |
| Methods inherited from class com.webobjects.eoaccess.EOAdaptorContext |
adaptor, canNestTransactions, channels, defaultDelegate, delegate, hasBusyChannels, hasOpenChannels, hasOpenTransaction, setDefaultDelegate, setDelegate, transactionDidBegin, transactionDidCommit, transactionDidRollback, transactionNestingLevel |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JNDIContext(EOAdaptor adaptor)
JNDIContext.adaptor - - the adaptorEOAdaptorContext.EOAdaptorContext(EOAdaptor)| Method Detail |
public void beginTransaction()
EOAdaptorContextbeginTransaction must be paired with an
invocation of either commitTransaction or
rollbackTransaction to end the transaction.
The Enterprise Objects Framework automatically wraps database
operations in transactions, so you don't have to begin and end
transactions explicitly. In fact, letting the framework manage
transactions is sometimes more efficient. You typically implement
beginTransaction only to execute more than one database
operation in the same transaction scope.
This method should invoke the delegate method
adaptorContextShouldBegin before beginning the
transaction. If the transaction is begun successfully, the method
should invoke transactionDidBegin on the receiver and
invoke the delegate method adaptorContextDidBegin.
Should throw a runtime exception if the attempt is unsuccessful.
Some possible reasons for failure are:
beginTransaction in class EOAdaptorContextcom.webobjects.eoaccess.EOAdaptorContextEOAdaptorContext.hasOpenTransaction(),
EOAdaptorContext.transactionDidBegin(),
EOAdaptorContext.Delegate.adaptorContextShouldBegin(Object object),
EOAdaptorContext.Delegate.adaptorContextDidBegin(Object object)public void commitTransaction()
EOAdaptorContextadaptorContextShouldCommit before
committing the transaction. If the transaction is committed
successfully, the method should invoke
transactionDidCommit and invoke the delegate
method adaptorContextDidCommit. Should throw a runtime
exception if the attempt is unsuccessful. Some possible reasons for
failure are:
commitTransaction in class EOAdaptorContextcom.webobjects.eoaccess.EOAdaptorContextEOAdaptorContext.beginTransaction(),
EOAdaptorContext.rollbackTransaction(),
EOAdaptorContext.hasBusyChannels(),
EOAdaptorContext.transactionDidCommit(),
EOAdaptorContext.Delegate.adaptorContextShouldCommit(Object object),
EOAdaptorContext.Delegate.adaptorContextDidCommit(Object object)public EOAdaptorChannel createAdaptorChannel()
EOAdaptorContextnull
if a new channel cannot be created. Should set the new channel's
adaptorContext to this.
A newly created adaptor context has no channels. Specific
adaptors have different limits on the maximum number of channels a
context can have, and createAdaptorChannel should fail
if a creating a new channel would exceed the limits.
createAdaptorChannel in class EOAdaptorContextcom.webobjects.eoaccess.EOAdaptorContextEOAdaptorChannel.adaptorContext(),
EOAdaptorContext.channels()public void handleDroppedConnection()
EOAdaptorContexthandleDroppedConnection, this method should
clean up the state of the receiver and its adaptor channels so they
can be safely disposed of without any errors. Subclasses must
implement this method if the adaptor supports automatic database
reconnection.
Never invoke this method yourself; it is invoked automatically by the Enterprise Objects Framework.
handleDroppedConnection in class EOAdaptorContextcom.webobjects.eoaccess.EOAdaptorContextEOAdaptor.handleDroppedConnection()public InitialDirContext initialDirContext()
createInitialDirContext
method on the plug-in.InitialDirContextJNDIPlugIn.createInitialDirContext(JNDIAdaptor),
InitialDirContextpublic void rollbackTransaction()
EOAdaptorContextadaptorContextShouldRollback
before rolling back the transaction. If the transaction is begun
successfully, the method should invoke
transactionDidRollback and invoke the delegate method
adaptorContextDidRollback. Should throw a runtime
exception if the attempt is unsuccessful. Some possible reasons for
failure are:
rollbackTransaction in class EOAdaptorContextcom.webobjects.eoaccess.EOAdaptorContextEOAdaptorContext.beginTransaction(),
EOAdaptorContext.commitTransaction(),
EOAdaptorContext.transactionDidRollback(),
EOAdaptorContext.Delegate.adaptorContextShouldRollback(Object object),
EOAdaptorContext.Delegate.adaptorContextDidRollback(Object object)
|
Last updated Thu Jan 10 18:10:21 PST 2002. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||