Interface ProviderListener

All Known Implementing Classes:
DefaultProviderListener, FailoverProvider, JmsConnection, JmsQueueConnection, JmsTopicConnection, ProviderWrapper

public interface ProviderListener
Events interface used to update the listener with changes in provider state.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called when an outbound message dispatch that requested a completion callback has reached a state where the send can be considered successful based on the QoS level associated of the outbound message.
    void
    Called to indicate that the underlying connection to the Broker has been established for the first time.
    void
    Called to indicate that the underlying connection to the Broker has been lost and the Provider will not perform any reconnect.
    void
    Called from a fault tolerant Provider instance to signal that the underlying connection to the Broker has been lost.
    void
    Called to indicate that a connection to the Broker has been reestablished and that all recovery operations have succeeded and the connection will now be transitioned to a recovered state.
    void
    Called to indicate that a connection to the Broker has been reestablished and that notified listener should start to recover it's state.
    void
    Called to signal that all recovery operations are now complete and the Provider is again in a normal connected state.
    void
    Called when an outbound message dispatch that requested a completion callback has reached a state where the send can be considered failed.
    void
    Called when a new Message has arrived for a registered consumer.
    void
    Called to indicate that a some client operation caused or received an error that is not considered fatal at the provider level.
    void
    Called to indicate that a currently active resource has been closed due to some error condition, management request or some other action.
  • Method Details

    • onInboundMessage

      void onInboundMessage(JmsInboundMessageDispatch envelope)
      Called when a new Message has arrived for a registered consumer.
      Parameters:
      envelope - The dispatch object containing the message and delivery information.
    • onCompletedMessageSend

      void onCompletedMessageSend(JmsOutboundMessageDispatch envelope)
      Called when an outbound message dispatch that requested a completion callback has reached a state where the send can be considered successful based on the QoS level associated of the outbound message.
      Parameters:
      envelope - the original outbound message dispatch that is now complete.
    • onFailedMessageSend

      void onFailedMessageSend(JmsOutboundMessageDispatch envelope, ProviderException cause)
      Called when an outbound message dispatch that requested a completion callback has reached a state where the send can be considered failed.
      Parameters:
      envelope - the original outbound message dispatch that should be treated as a failed send.
      cause - the exception that describes the cause of the failed send.
    • onConnectionInterrupted

      void onConnectionInterrupted(URI remoteURI)
      Called from a fault tolerant Provider instance to signal that the underlying connection to the Broker has been lost. The Provider will attempt to reconnect following this event unless closed. It is considered a programming error to allow any exceptions to be thrown from this notification method.
      Parameters:
      remoteURI - The URI of the Broker whose connection was lost.
    • onConnectionRecovery

      void onConnectionRecovery(Provider provider) throws Exception
      Called to indicate that a connection to the Broker has been reestablished and that notified listener should start to recover it's state. The provider will not transition to the recovered state until the listener notifies the provider that recovery is complete.
      Parameters:
      provider - The new Provider instance that will become active after the state has been recovered.
      Throws:
      Exception - if an error occurs during recovery attempt, this will fail the Provider that's being used for recovery.
    • onConnectionRecovered

      void onConnectionRecovered(Provider provider) throws Exception
      Called to indicate that a connection to the Broker has been reestablished and that all recovery operations have succeeded and the connection will now be transitioned to a recovered state. This method gives the listener a chance so send any necessary post recovery commands such as consumer start or message pull for a zero prefetch consumer etc.
      Parameters:
      provider - The new Provider instance that will become active after the state has been recovered.
      Throws:
      Exception - if an error occurs during recovery attempt, this will fail the Provider that's being used for recovery.
    • onConnectionRestored

      void onConnectionRestored(URI remoteURI)
      Called to signal that all recovery operations are now complete and the Provider is again in a normal connected state. It is considered a programming error to allow any exceptions to be thrown from this notification method.
      Parameters:
      remoteURI - The URI of the Broker that the client has now connected to.
    • onConnectionEstablished

      void onConnectionEstablished(URI remoteURI)
      Called to indicate that the underlying connection to the Broker has been established for the first time. For a fault tolerant provider this event should only ever be triggered once with the interruption and recovery events following on for future
      Parameters:
      remoteURI - The URI of the Broker that the client has now connected to.
    • onConnectionFailure

      void onConnectionFailure(ProviderException ex)
      Called to indicate that the underlying connection to the Broker has been lost and the Provider will not perform any reconnect. Following this call the provider is in a failed state and further calls to it will throw an Exception.
      Parameters:
      ex - The exception that indicates the cause of this Provider failure.
    • onResourceClosed

      void onResourceClosed(JmsResource resource, ProviderException cause)
      Called to indicate that a currently active resource has been closed due to some error condition, management request or some other action. This can either be initiated remotely or locally depending on the condition that triggers the close.
      Parameters:
      resource - the JmsResource instance that has been closed.
      cause - optional exception object that indicates the cause of the close.
    • onProviderException

      void onProviderException(ProviderException cause)
      Called to indicate that a some client operation caused or received an error that is not considered fatal at the provider level.
      Parameters:
      cause - the exception object that is being reported to the listener.