com.genesyslab.ail.monitor
Interface MonitorListener


public interface MonitorListener

Listener for monitor events.

To monitor DN or agent status changes, implement a MonitorListener listener, then subscribe to events by calling the Monitor.subscribeStatus() method.

The following code snippet shows how to implement MonitorListener:

public class SimpleMonitorExample implements MonitorListener
{
    public SimpleMonitorExample(Monitor exampleMonitor, java.lang.String object_type, java.lang.String object_id, Notification notification)
    {
        exampleMonitor.subscribeStatus(object_type,object_id,notification,this);
    }

    public void handleMonitorEvent(MonitorEvent event)
    {
        //Implement this method to take into account the new event.
    }
}

Warning: If you want to perform a lengthy operation or an operation making calls to AIL methods, be sure that your application implements such code in a separate thread, not in the listener methods.

See Also:
MonitorEvent, Monitor

Method Summary
 void handleMonitorEvent(MonitorEvent event)
          Receives an monitor event.
 

Method Detail

handleMonitorEvent

void handleMonitorEvent(MonitorEvent event)
Receives an monitor event.