java.lang.Object | +--com.ibm.commerce.messaging.adapters.jcasample.SampleManagedConnection
This class represents a physical connection that managed by an application server.
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT Copyright statement. |
Constructor Summary | |
---|---|
SampleManagedConnection() SampleManagedConnection default constructor |
Method Summary | |
---|---|
void |
addConnectionEventListener(ConnectionEventListener evtListener) Adds a connection event listener to the existing event listener list. |
void |
associateConnection(java.lang.Object connection) Associates this managed connection to SampleConnection. |
void |
cleanup() Cleanup the connections. |
void |
destroy() Destroys the connection. |
java.lang.Object |
getConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cri) Gets the connection |
LocalTransaction |
getLocalTransaction() Gets localTransaction |
java.io.PrintWriter |
getLogWriter() Gets logWriter |
ManagedConnectionMetaData |
getMetaData() Gets managed connection meta data. |
javax.transaction.xa.XAResource |
getXAResource() Gets XA resource |
void |
removeConnectionEventListener(ConnectionEventListener listener) Removes a ConnectionEventListener from the existing event listener list. |
void |
sendEvent(int eventType, java.lang.Exception ex) Sends an event. |
void |
sendEvent(int eventType, java.lang.Exception ex,
java.lang.Object connectionHandle) Sends an event to the event listener. |
void |
setConnection(
SampleConnection con) Sets the connection |
void |
setLogWriter(java.io.PrintWriter pw) Sets the log writer |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll,
toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
Constructor Detail |
---|
public SampleManagedConnection() throws ResourceException
javax.resource.ResoureceException
ResourceException
Method Detail |
---|
public void addConnectionEventListener(ConnectionEventListener evtListener)
public void removeConnectionEventListener(ConnectionEventListener listener)
public ManagedConnectionMetaData getMetaData() throws ResourceException
javax.resource.ResourceException
- Raised when any error
occured.ResourceException
public void destroy() throws ResourceException
javax.resource.ResourceException
- Raised when failed to
destroy the connection.ResourceException
public void associateConnection(java.lang.Object connection) throws ResourceException
connection
- The connection Objectjavax.resource.ResourceException
- Raised when
IllegalStateException
is thrown.ResourceException
public java.lang.Object getConnection(javax.security.auth.Subject subject, ConnectionRequestInfo cri) throws ResourceException
subject
- The Subject,cri
- The ConnectionRequestInfojavax.resource.ResourceException
ResourceException
public void setConnection(SampleConnection con)
public javax.transaction.xa.XAResource getXAResource() throws ResourceException
javax.resource.ResourceException
ResourceException
public void cleanup() throws ResourceException
javax.resource.ResourceException
ResourceException
public LocalTransaction getLocalTransaction() throws ResourceException
ResourceException
public void sendEvent(int eventType, java.lang.Exception ex)
sendEvent(eventType, ex,
null)
method.
public void sendEvent(int eventType, java.lang.Exception ex, java.lang.Object connectionHandle)
eventType
- The event type.connectionHandle
- The connection handlepublic void setLogWriter(java.io.PrintWriter pw) throws ResourceException
javax.resource.ResourceException
ResourceException
public java.io.PrintWriter getLogWriter() throws ResourceException
javax.resource.ResourceException
ResourceException