xmlBlaster 2.2.0 client API

org.xmlBlaster.client
Interface I_ConnectionStateListener

All Known Implementing Classes:
StreamingCallback

public interface I_ConnectionStateListener

Callback the client from XmlBlasterAccess if the connection to xmlBlaster is lost or was reestablished (failsafe mode).

Author:
xmlBlaster@marcelruff.info

Method Summary
 void reachedAlive(ConnectionStateEnum oldState, I_XmlBlasterAccess connection)
          This is the callback method invoked from XmlBlasterAccess notifying the client that a connection has been established and that its status is now ALIVE.
 void reachedAliveSync(ConnectionStateEnum oldState, I_XmlBlasterAccess connection)
          Invoked when the dispatcher goes to synch again after having delivered entries which where in the queue when the state changed to ALIVE.
 void reachedDead(ConnectionStateEnum oldState, I_XmlBlasterAccess connection)
          This is the callback method invoked from XmlBlasterAccess informing the client that the connection was lost (i.e.
 void reachedPolling(ConnectionStateEnum oldState, I_XmlBlasterAccess connection)
          This is the callback method invoked from XmlBlasterAccess informing the client that the connection state has changed to POLLING.
 

Method Detail

reachedAlive

void reachedAlive(ConnectionStateEnum oldState,
                  I_XmlBlasterAccess connection)
This is the callback method invoked from XmlBlasterAccess notifying the client that a connection has been established and that its status is now ALIVE.

Note that this method is invoked also when the connection has been established the first time. In this case the connection is fully operational but your connect() call has not yet returned. You can access the returned connect QoS in this case with connect.getConnectReturnQos().

You can erase all entries of the queue manually or add others before you return and in this way control the behavior. During you have control in reachedAlive() the client side queue is blocked and does not accept publish or request messages from other threads. So you can do peacefully your work (your thread is allowed to modify the queue exclusively).

If you send messages during this method invocation they are queued only and are sent as soon as this method returns.

This method is invoked by the login polling thread from I_XmlBlasterAccess in which case it is a physical Alive, and by the connect method on successful login in which case it is a logical Alive.

Parameters:
oldState - The previous state of the connection.
connectionHandler - An interface which allows you to control the queue and the connection

reachedAliveSync

void reachedAliveSync(ConnectionStateEnum oldState,
                      I_XmlBlasterAccess connection)
Invoked when the dispatcher goes to synch again after having delivered entries which where in the queue when the state changed to ALIVE. Note that this could take some time or in the worst case it could never been invoked if the queue is never completely processed.

Parameters:
oldState - is always ALIVE.
connection -

reachedPolling

void reachedPolling(ConnectionStateEnum oldState,
                    I_XmlBlasterAccess connection)
This is the callback method invoked from XmlBlasterAccess informing the client that the connection state has changed to POLLING.

Parameters:
oldState - The previous state of the connection.
connectionHandler - An interface which allows you to control the queue and the connection

reachedDead

void reachedDead(ConnectionStateEnum oldState,
                 I_XmlBlasterAccess connection)
This is the callback method invoked from XmlBlasterAccess informing the client that the connection was lost (i.e. when the state of the connection has gone to DEAD).

Parameters:
oldState - The previous state of the connection.
connectionHandler - An interface which allows you to control the queue and the connection

xmlBlaster 2.2.0 client API

Copyright © 1999-2014 The xmlBlaster.org contributers.