|
WebLogic Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bea.adapter.spi.AbstractManagedConnection
Provides functionality that is common across resource adapters for
implementing the ManagedConnection
interface. A
ManagedConnection
represents a physical connection to an
underlying EIS. The creation of a ManagedConnection
instance
typically results in the allocation of EIS and resource adapter resources.
Constructor Summary | |
protected |
AbstractManagedConnection(AbstractManagedConnectionFactory myFactory,
LogContext logContext,
boolean bSupportsXAResource,
boolean bSupportsLocalTransactions)
Initializes the base class components provided by this class for concrete ManagedConnections. |
Method Summary | |
void |
addConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
Adds a connection event listener to this ManagedConnection |
void |
addConnectionHandle(java.lang.Object connectionHandle)
Adds an application-level connection handle to the collection maintained by this ManagedConnection . |
void |
associateConnection(java.lang.Object connection)
Used by the container to change the association of an application-level connection handle with a ManagedConnection instance. |
protected void |
checkIfDestroyed()
Checks to see if the client has already called the "destroy" on this instance. |
void |
cleanup()
Application server calls this to force any cleanup on the ManagedConnection instance. |
boolean |
compareCredentials(javax.security.auth.Subject subject,
javax.resource.spi.ConnectionRequestInfo info)
This method is invoked when the ManagedConnectionFactory is attempting to match this connection with a connection request for the ConnectionManager. |
protected javax.resource.spi.LocalTransaction |
createLocalTransaction()
Returns a LocalTransaction. |
protected abstract javax.resource.spi.ManagedConnectionMetaData |
createMetaData()
Returns an object that provides information about the underlying EIS instance associated with "this" ManagedConnection instance. |
protected javax.transaction.xa.XAResource |
createXAResource()
Creates the XA resource if supported. |
void |
destroy()
Destroys the physical connection to the underlying EIS. |
protected void |
destroyConnectionHandle(java.lang.Object obj)
This method gets invoked by the cleanup method to allow any clean-up of resources held by this instance for a particular connection handle. |
protected void |
destroyPhysicalConnection(java.lang.Object obj)
This method gets invoked by the destroy method to allow destruction of resources held by this instance for a particular physical connection to the EIS. |
protected void |
doAdditionalCleanup()
This method gets invoked by the cleanup method to allow any clean-up of additional resources held by this instance |
void |
fireConnectionErrorOccurredEvent(java.lang.Exception exception)
Notifies all registered listeners of a connection error. |
void |
fireConnectionHandleClosedEvent(java.lang.Object connectionHandle)
Notifies all registered listeners that a connection was closed. |
void |
fireLocalTransactionCommittedEvent()
Notifies all registered listeners that a transaction was committed. |
void |
fireLocalTransactionRolledBackEvent()
Notifies all registered listeners that a transaction was rolled back. |
void |
fireLocalTransactionStartedEvent()
Notifies all registered listeners that a transaction was started. |
AbstractManagedConnectionFactory |
getFactory()
|
javax.resource.spi.LocalTransaction |
getLocalTransaction()
Returns a LocalTransaction that is tied to the EIS connection represented by this ManagedConnection. |
LogContext |
getLogContext()
Retrieves an object that determines the logging configuration for this instance in the logging framework. |
ILogger |
getLogger()
Retrieves an object used to log information to. |
java.io.PrintWriter |
getLogWriter()
|
javax.resource.spi.ManagedConnectionMetaData |
getMetaData()
Gets the metadata information for this connection's underlying EIS resource manager instance. |
java.lang.Object |
getPhysicalConnection()
A ManagedConnection object is typically a wrapper around an object that is native to the EIS's external API. |
javax.transaction.xa.XAResource |
getXAResource()
|
boolean |
isBusy()
|
boolean |
isDestroyed()
|
protected void |
notifyListenersOfEvent(javax.resource.spi.ConnectionEvent event)
Notifies all currently registered listeners of a connection event |
void |
removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
Removes an already registered connection event listener from the ManagedConnection instance. |
void |
removeConnectionHandle(java.lang.Object connectionHandle)
Removes connectionHandle from the set of application-level
connection handles that is managed by this instance. |
void |
setLogWriter(java.io.PrintWriter out)
Adds out as a runtime destination to the ILogger for this
instance. |
void |
setPhysicalConnection(java.lang.Object obj)
A convenience method that allows an adapter developer to save an object that represents the underlying physical connection to the EIS. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
protected AbstractManagedConnection(AbstractManagedConnectionFactory myFactory, LogContext logContext, boolean bSupportsXAResource, boolean bSupportsLocalTransactions) throws javax.resource.ResourceException
myFactory
- - the factory that instantiated thislogContext
- - an object that provides access to an
ILogger
instance for logging.bSupportsXAResource
- - a flag to indicate if the resource adapter
implements XAResource to provide support for transaction management.bSupportsLocalTransactions
- - a flag to indicate if the resource
adapter supports local transactions.Method Detail |
public boolean isBusy()
public void addConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
ManagedConnection
instance.
- Specified by:
- addConnectionEventListener in interface javax.resource.spi.ManagedConnection
- Parameters:
listener
- - enables the application server to get notifications
related to the state of this ManagedConnection
instance. The
application server uses these notifications to manage connection pooling,
transactions, cleanup connections, and handle any error conditions.
public void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
public void addConnectionHandle(java.lang.Object connectionHandle)
ManagedConnection
. An application server can call
getConnection
multiple times, thus multiple connection handles
can exist concurrently for a single instance.
connectionHandle
- - represents an application-level connection
handle to the EIS.public void removeConnectionHandle(java.lang.Object connectionHandle)
connectionHandle
from the set of application-level
connection handles that is managed by this instance. There can be more
than one application-level connection handles associated with a
ManagedConnection instance.
public void associateConnection(java.lang.Object connection) throws javax.resource.ResourceException
connection
is an instance of
com.bea.adapter.cci.AbstractConnection
. Adapter developers should
override this if their connection object does not extend
com.bea.adapter.cci.AbstractConnection
.
connection
- - the application-level connection handleprotected void checkIfDestroyed() throws javax.resource.spi.IllegalStateException
public void cleanup() throws javax.resource.ResourceException
ManagedConnection
instance. This might include any
transaction or security state associated with the connection. This method
does NOT close the undelying physical connection to the EIS, use
destroy
for that.
protected javax.resource.spi.LocalTransaction createLocalTransaction() throws javax.resource.ResourceException
protected abstract javax.resource.spi.ManagedConnectionMetaData createMetaData() throws javax.resource.ResourceException
protected javax.transaction.xa.XAResource createXAResource() throws javax.resource.ResourceException
public void destroy() throws javax.resource.ResourceException
protected void destroyConnectionHandle(java.lang.Object obj) throws java.lang.Exception
protected void destroyPhysicalConnection(java.lang.Object obj) throws java.lang.Exception
protected void doAdditionalCleanup() throws java.lang.Exception
public void fireConnectionErrorOccurredEvent(java.lang.Exception exception)
public void fireConnectionHandleClosedEvent(java.lang.Object connectionHandle)
public void fireLocalTransactionCommittedEvent()
public void fireLocalTransactionRolledBackEvent()
public void fireLocalTransactionStartedEvent()
public AbstractManagedConnectionFactory getFactory()
public javax.resource.spi.LocalTransaction getLocalTransaction() throws javax.resource.ResourceException
public LogContext getLogContext()
public ILogger getLogger()
public java.io.PrintWriter getLogWriter() throws javax.resource.ResourceException
public javax.resource.spi.ManagedConnectionMetaData getMetaData() throws javax.resource.ResourceException
public java.lang.Object getPhysicalConnection() throws javax.resource.ResourceException
public void setPhysicalConnection(java.lang.Object obj) throws javax.resource.ResourceException
obj
is null.public javax.transaction.xa.XAResource getXAResource() throws javax.resource.ResourceException
public boolean isDestroyed()
protected void notifyListenersOfEvent(javax.resource.spi.ConnectionEvent event)
event
- - the connection eventpublic void setLogWriter(java.io.PrintWriter out) throws javax.resource.ResourceException
out
as a runtime destination to the ILogger for this
instance.
public java.lang.String toString()
public boolean compareCredentials(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo info) throws javax.resource.ResourceException
|
WebLogic Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |