Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.1

E36938-01


com.oracle.sft.api
Class Agent<T>

java.lang.Object
  extended by com.oracle.sft.api.Agent<T>

Type Parameters:
T - The type of application data in this Agent.
All Implemented Interfaces:
Serializable

public abstract class Agent<T>
extends Object
implements Serializable

Agent objects encapsulate application logic related to Communication artifacts such as Communication and Participant. An instance of the Agent class is attached to Communication artifacts by the application. This makes the Agent object available to any events pertaining to that Communication artifact.

See Also:
Communication.addAgent(String, Agent), Communication.getAgent(String), Participant.addAgent(String, Agent), Participant.getAgent(String), Serialized Form

Constructor Summary
Agent()
          Default constructor for the Agent.
Agent(boolean callbackEnabled)
          An application implementing an Agent can use this constructor to enable automatic callback on the Agent.

 

Method Summary
 T get()
          Returns application specific data.
 CommunicationContext<?,?,?> getCommunicationContext()
          Retrieves the CommunicationContext object in the Application Link.
 void invoke()
          Invokes the agent to perform application specific tasks.
 void invoke(CommunicationEvent.Type cevent)
          Invokes the agent to perform application specific tasks.
 void invoke(ParticipantEvent.Type pvent)
          Invokes the agent to perform application specific tasks.
 boolean isCallbackEnabled()
          Gets the callback enabled flag.
 void set(T applicationData)
          Sets application specific data.
 void setCallbackEnabled(boolean callbackEnabled)
          Sets the callback enabled flag.
 void setCommunicationContext(CommunicationContext<?,?,?> context)
          Sets the CommunicationContext object.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

Agent

public Agent()
Default constructor for the Agent.

Agent

public Agent(boolean callbackEnabled)
An application implementing an Agent can use this constructor to enable automatic callback on the Agent. Note that only agents set in Communication objects are selected for automatic callback by the framework.
Parameters:
callbackEnabled -

Method Detail

isCallbackEnabled

public boolean isCallbackEnabled()
Gets the callback enabled flag.
Returns:
True if SFT invokes the agent.

setCallbackEnabled

public void setCallbackEnabled(boolean callbackEnabled)
Sets the callback enabled flag.
Parameters:
callbackEnabled - true of container has to callback.

setCommunicationContext

public final void setCommunicationContext(CommunicationContext<?,?,?> context)
Sets the CommunicationContext object. Application is expected to make a clone of the CommunicationContext for invoking this method.
Parameters:
context - An instance of CommunicationContext object.

getCommunicationContext

public final CommunicationContext<?,?,?> getCommunicationContext()
Retrieves the CommunicationContext object in the Application Link.
Returns:
Return an instance of CommunicationContext.

invoke

public void invoke()
Invokes the agent to perform application specific tasks. Typically called by the application itself when the agent is not a call back agent.

invoke

public void invoke(CommunicationEvent.Type cevent)
Invokes the agent to perform application specific tasks. The event gives an indication to the application as to what has caused the invocation. Used for call back agents to communicate the event type.

invoke

public void invoke(ParticipantEvent.Type pvent)
Invokes the agent to perform application specific tasks. The event gives an indication to the application as to what has caused the invocation.

set

public final void set(T applicationData)
Sets application specific data. In most cases the SFT application needs to save state in the agent.
Parameters:
applicationData - An Application Data object.

get

public final T get()
Returns application specific data.
Returns:
The saved application specific data.

Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.1

E36938-01


Copyright © 2012 Oracle Corporation. All Rights Reserved.