Package org.apache.activemq.artemis.spi.core.remoting

## Interface BaseConnectionLifeCycleListener<ProtocolClass>

- All Known Subinterfaces:
    `ClientConnectionLifeCycleListener`, `ConnectionLifeCycleListener`, `ServerConnectionLifeCycleListener`

      public interface BaseConnectionLifeCycleListener<ProtocolClass>

  A ConnectionLifeCycleListener is called by the remoting implementation to notify of connection events.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `connectionCreated​(org.apache.activemq.artemis.core.server.ActiveMQComponent component, Connection connection, ProtocolClass protocol)` | This method is used both by client connector creation and server connection creation through acceptors.
    `void` | `connectionDestroyed​(java.lang.Object connectionID)` | Called when a connection is destroyed.
    `void` | `connectionException​(java.lang.Object connectionID, org.apache.activemq.artemis.api.core.ActiveMQException me)` | Called when an error occurs on the connection.
    `void` | `connectionReadyForWrites​(java.lang.Object connectionID, boolean ready)` |

- - ### Method Detail

    - #### connectionCreated

          void connectionCreated​(org.apache.activemq.artemis.core.server.ActiveMQComponent component,
                                 Connection connection,
                                 ProtocolClass protocol)

      This method is used both by client connector creation and server connection creation through acceptors. On the client side the `component` parameter is normally passed as `null`.

      Leaving this method here and adding a different one at `ServerConnectionLifeCycleListener` is a compromise for a reasonable split between the activemq-server and activemq-client packages while avoiding to pull too much into activemq-core. The pivotal point keeping us from removing the method is `ConnectorFactory` and the usage of it.

      Parameters:
        `component` - This will probably be an `Acceptor` and only used on the server side.
        `connection` - the connection that has been created
        `protocol` - the messaging protocol type this connection uses

    - #### connectionDestroyed

          void connectionDestroyed​(java.lang.Object connectionID)

      Called when a connection is destroyed.
      Parameters:
        `connectionID` - the connection being destroyed.

    - #### connectionException

          void connectionException​(java.lang.Object connectionID,
                                   org.apache.activemq.artemis.api.core.ActiveMQException me)

      Called when an error occurs on the connection.
      Parameters:
        `connectionID` - the id of the connection.
        `me` - the exception.

    - #### connectionReadyForWrites

          void connectionReadyForWrites​(java.lang.Object connectionID,
                                        boolean ready)