com.ibm.commerce.messaging.adapters.jcasample

Class SampleConnectionEventListener

  • java.lang.Object
    • com.ibm.commerce.messaging.adapters.jcasample.SampleConnectionEventListener
  • All Implemented Interfaces:
    java.util.EventListener, javax.resource.spi.ConnectionEventListener


    public class SampleConnectionEventListener
    extends java.lang.Object
    implements javax.resource.spi.ConnectionEventListener
    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

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      Copyright statement.
    • Constructor Summary

      Constructors 
      Constructor and Description
      SampleConnectionEventListener(javax.resource.spi.ManagedConnection mc)
      Default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addConnectionListener(javax.resource.spi.ConnectionEventListener l)
      Adds a connection listener to the existing connection listener
      void connectionClosed(javax.resource.spi.ConnectionEvent arg1)
      Connection closed.
      void connectionErrorOccurred(javax.resource.spi.ConnectionEvent arg1)
      The connectionErrorOccurred method.
      void localTransactionCommitted(javax.resource.spi.ConnectionEvent arg1)
      The localTransactionCommitted method.
      void localTransactionRolledback(javax.resource.spi.ConnectionEvent arg1)
      The localTransactionRolledback method.
      void localTransactionStarted(javax.resource.spi.ConnectionEvent arg1)
      The localTransactionStarted method.
      void removeConnectionListener(javax.resource.spi.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

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        Copyright statement.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SampleConnectionEventListener

        public SampleConnectionEventListener(javax.resource.spi.ManagedConnection mc)
        Default constructor.
        Parameters:
        managedConnection - The managed connection provided by the application server.
    • Method Detail

      • connectionClosed

        public void connectionClosed(javax.resource.spi.ConnectionEvent arg1)
        Connection closed. It does nothing in the current implementation.
        Specified by:
        connectionClosed in interface javax.resource.spi.ConnectionEventListener
        Parameters:
        arg1 - The connection event
      • connectionErrorOccurred

        public void connectionErrorOccurred(javax.resource.spi.ConnectionEvent arg1)
        The connectionErrorOccurred method. It does nothing in the current implementation.
        Specified by:
        connectionErrorOccurred in interface javax.resource.spi.ConnectionEventListener
        Parameters:
        arg1 - The connection event
      • localTransactionCommitted

        public void localTransactionCommitted(javax.resource.spi.ConnectionEvent arg1)
        The localTransactionCommitted method. It does nothing in current implementation.
        Specified by:
        localTransactionCommitted in interface javax.resource.spi.ConnectionEventListener
        Parameters:
        arg1 - The connection event
      • localTransactionRolledback

        public void localTransactionRolledback(javax.resource.spi.ConnectionEvent arg1)
        The localTransactionRolledback method. It does nothing in current implementation.
        Specified by:
        localTransactionRolledback in interface javax.resource.spi.ConnectionEventListener
        Parameters:
        arg1 - The connection event
      • localTransactionStarted

        public void localTransactionStarted(javax.resource.spi.ConnectionEvent arg1)
        The localTransactionStarted method. It does nothing in current implementation.
        Specified by:
        localTransactionStarted in interface javax.resource.spi.ConnectionEventListener
        Parameters:
        arg1 - The connection event
      • addConnectionListener

        public void addConnectionListener(javax.resource.spi.ConnectionEventListener l)
        Adds a connection listener to the existing connection listener
        Parameters:
        javax.resource.spi.ConnectionEventListener - The listener that needs to be listened to.
      • removeConnectionListener

        public void removeConnectionListener(javax.resource.spi.ConnectionEventListener l)
        Removes a connection listener
        Parameters:
        javax.resource.spi.ConnectionEventListener - The connection event listener that to be removed.
      • 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