cybele.evmgmt
Interface Notifier


public abstract interface Notifier

Interface containing methods to register and manage receivers with the notifier, place an event through the notifier, and manage the event dispatching to the agent threads.


Method Summary
 void addEvent(EventReceiver rec, CybeleEvent ev)
          The method used by the receivers to place an event with the Notifier
 java.lang.String addReceiver(EventReceiver rec)
          It registers an EventReceiver and that EventReceiver is entitled to send
 void clearEvents()
          This method clears all the unprocessed events.
 void clearReceivers()
          It removes all the current EventReceivers, but allows creation of new ones
 java.lang.String getId()
          Returns the unique Id of this Notifier
 boolean isPaused()
          It queries if the Notifier is paused
 boolean isPaused(EventReceiver rec)
          It queries if the EventReceiver rec is paused
 boolean isSuspended()
          It queries if the Notifier is paused
 boolean isSuspended(EventReceiver rec)
          It queries if the EventReceiver rec is suspended
 void pause()
          It instructs all the current and future receivers to stop sending events.
 void pause(EventReceiver rec)
          It instructs the EventReceiver rec to stop sending events.
 void removeReceiver(EventReceiver rec)
          It removes the EventReceiver.
 void removeReceiver(java.lang.String recvId)
          It removes the EventReceiver.
 void renew()
          It renews the receivers.
 void renew(EventReceiver rec)
          It renews the EventReceiver rec, if it has been suspended.
 void resume()
          It resumes forwarding of events from receivers to the AgentThread.
 void resume(EventReceiver rec)
          It resumes forwarding of events from the EventReceiver rec toe the AgentThread
 void start()
          Starts creation of receivers, if it has been stopped
 void stop()
          It removes all the current EventReceivers and does not allow creation of new receivers until start is called
 void suspend()
          It instructs the receivers to stop generating events.
 void suspend(EventReceiver rec)
          It instructs the EventReceiver rec to stop generating events.
 

Method Detail

getId

public java.lang.String getId()
Returns the unique Id of this Notifier
Returns:
the Id of this Notifier

addReceiver

public java.lang.String addReceiver(EventReceiver rec)
It registers an EventReceiver and that EventReceiver is entitled to send
Parameters:
rec - The EventReceiver to be registered

removeReceiver

public void removeReceiver(EventReceiver rec)
It removes the EventReceiver. It in turn calls cancel on EventReceiver
Parameters:
rec - The EventReceiver that may be removed

removeReceiver

public void removeReceiver(java.lang.String recvId)
It removes the EventReceiver. It in turn calls cancel on EventReceiver
Parameters:
recvId - The Id of the receiver to be removed

clearReceivers

public void clearReceivers()
It removes all the current EventReceivers, but allows creation of new ones

stop

public void stop()
It removes all the current EventReceivers and does not allow creation of new receivers until start is called

start

public void start()
Starts creation of receivers, if it has been stopped

pause

public void pause()
It instructs all the current and future receivers to stop sending events. It does not remove the receivers. Any events received after this method has been called will be queued by the Notifier in a local buffer and are not sent to the AgentThread for processing (that is, they must not be obtained via getNextEvent method of EvenetManagement service. Also, any unprocessed (pending) events must be put in the local buffer and not sent via the getNextEvent method.

pause

public void pause(EventReceiver rec)
It instructs the EventReceiver rec to stop sending events. The semantics of this pause is same as previous page except that it affects the CybeleEvents generated by the receiver rec
Parameters:
rec - The EventReceiver that may be paused

isPaused

public boolean isPaused()
It queries if the Notifier is paused
Returns:
the boolean variable indicating if this Notifier is paused

isPaused

public boolean isPaused(EventReceiver rec)
It queries if the EventReceiver rec is paused
Returns:
the boolean variable indicating if the EventReceiver rec is paused

resume

public void resume()
It resumes forwarding of events from receivers to the AgentThread. That is, following this call, the events can be ontained via getNextEvent method

resume

public void resume(EventReceiver rec)
It resumes forwarding of events from the EventReceiver rec toe the AgentThread
Parameters:
rec - The EventReceiver that may be resumed

suspend

public void suspend()
It instructs the receivers to stop generating events. That is, from this method call onwards all events to be generated by the receivers are destroyed. Also, it must destroy any events are pending and not fetched to the AgentThread. The suspension must not be taken off until renew is called. The suspend method has higher priority over pause method.

suspend

public void suspend(EventReceiver rec)
It instructs the EventReceiver rec to stop generating events. The semantics of this suspend is same as the previous one ecept that it affects only the EventReceiver rec
Parameters:
rec - The EventReceiver that may be suspended

isSuspended

public boolean isSuspended()
It queries if the Notifier is paused
Returns:
the boolean variable indicating if this Notifier is paused

isSuspended

public boolean isSuspended(EventReceiver rec)
It queries if the EventReceiver rec is suspended
Returns:
the boolean variable indicating if the EventReceiver rec is suspended

renew

public void renew()
           throws java.lang.IllegalStateException
It renews the receivers. That is, following this call, the events can be generated by the receivers and obtained via getNextEvent method. This method must not resume sending of events, if the Notifier has been paused, but not suspended.

renew

public void renew(EventReceiver rec)
It renews the EventReceiver rec, if it has been suspended. The semantics of this method is same as previous renew method.
Parameters:
rec - The EventReceiver that may be renewed

addEvent

public void addEvent(EventReceiver rec,
                     CybeleEvent ev)
The method used by the receivers to place an event with the Notifier
Parameters:
rec - The EventReceiver that generates the CybeleEvent ev
ev - The CybeleEvent generated by the receiver rec

clearEvents

public void clearEvents()
This method clears all the unprocessed events. But it does not clear or destroy the events stored in local buffer (due to prior invocation of a pause method). It does not renew or resumes receiving and dispatching of events