com.ibm.commerce.messaging.adapters.jcasample
Class SampleConnectionEventListener

java.lang.Object
  |
  +--com.ibm.commerce.messaging.adapters.jcasample.SampleConnectionEventListener

public class SampleConnectionEventListener
extends java.lang.Object

****************************************************************************

It implements javax.resource.spi.ConnectionEventListener interface. It keeps a vector of ConnectionEventListener registered with a ManagedConnection. When its sendEvent(int, Exception, Object) is invoked, it loops through the vector and sends the event to all registered ConnectionEventListener.


Field Summary
static java.lang.String COPYRIGHT
          Copyright statement.
 
Constructor Summary
SampleConnectionEventListener(ManagedConnection mc)
          Default constructor.
 
Method Summary
 void addConnectionListener(ConnectionEventListener l)
          Adds a connection listener to the existing connection listener
 void connectionClosed(ConnectionEvent arg1)
          Connection closed.
 void connectionErrorOccurred(ConnectionEvent arg1)
          The connectionErrorOccurred method.
 void localTransactionCommitted(ConnectionEvent arg1)
          The localTransactionCommitted method.
 void localTransactionRolledback(ConnectionEvent arg1)
          The localTransactionRolledback method.
 void localTransactionStarted(ConnectionEvent arg1)
          The localTransactionStarted method.
 void removeConnectionListener(ConnectionEventListener l)
          Removes a connection listener
 void sendEvent(int eventType, java.lang.Exception ex, java.lang.Object connectionHandle)
          Sends an event
 
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
Copyright statement.
See Also:
Constant Field Values
Constructor Detail

SampleConnectionEventListener

public SampleConnectionEventListener(ManagedConnection mc)
Default constructor.
Method Detail

connectionClosed

public void connectionClosed(ConnectionEvent arg1)
Connection closed. It does nothing in the current implementation.
Parameters:
arg1 - The connection event

connectionErrorOccurred

public void connectionErrorOccurred(ConnectionEvent arg1)
The connectionErrorOccurred method. It does nothing in the current implementation.
Parameters:
arg1 - The connection event

localTransactionCommitted

public void localTransactionCommitted(ConnectionEvent arg1)
The localTransactionCommitted method. It does nothing in current implementation.
Parameters:
arg1 - The connection event

localTransactionRolledback

public void localTransactionRolledback(ConnectionEvent arg1)
The localTransactionRolledback method. It does nothing in current implementation.
Parameters:
arg1 - The connection event

localTransactionStarted

public void localTransactionStarted(ConnectionEvent arg1)
The localTransactionStarted method. It does nothing in current implementation.
Parameters:
arg1 - The connection event

addConnectionListener

public void addConnectionListener(ConnectionEventListener l)
Adds a connection listener to the existing connection listener

removeConnectionListener

public void removeConnectionListener(ConnectionEventListener l)
Removes a connection listener

sendEvent

public void sendEvent(int eventType,
                      java.lang.Exception ex,
                      java.lang.Object connectionHandle)
Sends an event
Parameters:
eventType - The event type
ex - The Exception
connectionHandle - The connection handle