com.googlecode.mobilityrpc.network.impl
Interface ConnectionStateListener

All Known Implementing Classes:
ConnectionManagerImpl

public interface ConnectionStateListener

An internal interface used by the framework - implemented by an object which can be notified when connections are opened or closed.

Note: in practice this is implemented by the ConnectionManager as a means to be notified of connection events, and this interface is invoked by ConnectionListeners when incoming connections are received and by Connection objects when connections are closed.

This interface really only exists to decouple objects which send notifications from the implementations which subscribe to them, to simplify independent unit testing etc.

Author:
Niall Gallagher

Method Summary
 boolean isConnectionRegistered(ConnectionId connectionId)
           
 void notifyConnectionClosed(ConnectionInternal connection)
          Called when the supplied connection has been closed.
 void notifyConnectionOpened(ConnectionInternal connection)
          Called when the supplied connection has been opened.
 

Method Detail

notifyConnectionOpened

void notifyConnectionOpened(ConnectionInternal connection)
Called when the supplied connection has been opened.

Parameters:
connection - The connection which has been opened

notifyConnectionClosed

void notifyConnectionClosed(ConnectionInternal connection)
Called when the supplied connection has been closed.

Parameters:
connection - The connection which has been closed

isConnectionRegistered

boolean isConnectionRegistered(ConnectionId connectionId)
Parameters:
connectionId - The connection id to check
Returns:
Allows the sender of notifications to query the destination to see if a specific connection is registered (typically used to check if primary connection is up)


Copyright © 2016. All rights reserved.