|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface AgentListener
Listener for events on an Agent.
Use AgentListener to monitor:
AgentEvent).
InteractionEvent) occurring on any of the place's DNs or media.
You do not need to process InteractionEvent, PlaceEvent, DnEvent
events if you register directly another InteractionListener, PlaceListener, or DnListener
on the corresponding object.
Note: When the monitored agent is logged out of the place, the listener no longer receives events regarding this place or interactions on this place.
The following code snippet shows how to implement AgentListener:
public class SimpleAgentExample implements AgentListener
{
public SimpleAgentExample (Agent exampleAgent)
{
//Adding the listener
exampleAgent.addAgentListener(this);
}
public void handleAgentEvent(AgentEvent evt)
{
//Implement this method to refresh your application
//with the new agent information.
}
public void placeChanged(Place newPlace)
{
//Implement this method to refresh your application
//with the new place associated with the Agent.
}
//Inherited PlaceListener methods.
//See PlaceListener for details.
public void dnAdded(String id){}
public void dnRemoved(String id){}
public void handlePlaceEvent(PlaceEvent event){}
public void idModified(String id){}
//Inherited DnListener methods. See DnListener for details.
public void handleDnEvent(DnEvent event){}
//Handlers for managing the interactions of the agent.
//See InteractionListener for details.
public void handleInteractionEvent(InteractionEvent event){}
public void contactChanged(InteractionEvent event){}
public void deleted(){}
}
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.
AgentEvent,
PlaceEvent,
DnEvent,
InteractionEvent| Method Summary | |
|---|---|
void |
handleAgentEvent(AgentEvent event)
This method gets called when an event occurs on an agent. |
void |
placeChanged(Place newPlace)
This method gets called when the place of the agent has changed. |
| Methods inherited from interface com.genesyslab.ail.event.PlaceListener |
|---|
dnAdded, dnRemoved, handlePlaceEvent, idModified |
| Methods inherited from interface com.genesyslab.ail.event.DnListener |
|---|
handleDnEvent |
| Methods inherited from interface com.genesyslab.ail.event.InteractionListener |
|---|
contactChanged, handleInteractionEvent |
| Method Detail |
|---|
void handleAgentEvent(AgentEvent event)
event - the event that occurred.void placeChanged(Place newPlace)
newPlace - the new current place of the agent.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||