com.unclouded.android
Class ServiceListener<T>

java.lang.Object
  extended by com.unclouded.android.ServiceListener<T>
Type Parameters:
T - the type of data that is expected when discovering a service.

public abstract class ServiceListener<T>
extends Object

Monitors the state of one or more services.

A ServiceListener is passed as argument to the when or whenever method on the Unclouded event loop. It triggers notifications in three cases:

Note that only isDiscovered(Object) is required to be implemented. Both isDisconnected(Object) and isReconnected(Object) are optional.


Constructor Summary
ServiceListener()
           
 
Method Summary
 void isDisconnected(T value)
          Triggered when the service is disconnected from the network.
abstract  void isDiscovered(T value)
          Triggered when the service is discovered in the network for the first time.
 void isReconnected(T value)
          Triggered when the service is reconnected to the network.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceListener

public ServiceListener()
Method Detail

isDiscovered

public abstract void isDiscovered(T value)
Triggered when the service is discovered in the network for the first time.

Parameters:
value - the value or RemoteReference hold by the service.

isDisconnected

public void isDisconnected(T value)
Triggered when the service is disconnected from the network.

Parameters:
value - the value or RemoteReference hold by the service.

isReconnected

public void isReconnected(T value)
Triggered when the service is reconnected to the network.

Parameters:
value - the value or RemoteReference hold by the service.