All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.workflow.api.Agent
java.lang.Object
|
+----com.ibm.workflow.api.Agent
- public class Agent
- extends Object
- implements Serializable
An instance of this Java bean is used to gain access to MQWF services. The main functions of an Agent bean are:
- To consult a directory service (as specified by the agent's locator policy) to obtain a reference to the agent daemon
identified by the agent bean's name property.
- To communicate with the agent using the communication protocol implied by the locator policy (CORBA IIOP, Java RMI or
local calls).
- To obtain references to ExecutionServices from the located agent.
- To collaborate with the agent to transparently manage the life-cycle of server-side object implementations.
- To send keep-alive messages to the agent in order to keep the sessions with those ExecutionServices alive.
This class is supplemented by the classes AgentBeanInfo and AgentLocatorEditor to support its use as a
JavaBean in visual development environments.
- Version:
- 3.2.0.2
- See Also:
- AgentBeanInfo, AgentLocatorEditor
-
COS_LOCATOR
- Using this locator will instruct the agent bean to use the CORBA Naming Service for agent lookup and to use CORBA IIOP for
communication with the agent.
-
IOR_LOCATOR
- Using this locator will instruct the agent bean to interpret the agent name as a Internet Inter-ORB reference and to use
CORBA IIOP for communication with the agent.
-
LOC_LOCATOR
- Using this locator will instruct the agent bean to instantiate an embedded agent deamon instead of looking up a reference to
an existing (remote) agent.
-
LOCATOR_TAGS
- A string array holding the locator names.
-
LOCATORS
- A string array of the stringified locator symbols.
-
OSA_LOCATOR
- Using this locator will instruct the agent bean to use the VisiBroker Smart Agent directory for agent lookup and to use
CORBA IIOP for communication with the agent.
-
RMI_LOCATOR
- Using this locator will instruct the agent bean to use the RMI registry for agent lookup and to use Java RMI communication
with the agent.
-
Agent()
- Constructs an Agent object.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds the given listener to the set of listeners to be notified of property changes.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds the given listener to the set of listeners to be notified of vetoable property changes.
-
getConfigurationID()
- Returns the configuration to
be used for profile accesses.
-
getExecutionAgent()
- Returns an ExecutionAgent.
-
getLocator()
- Returns the property describing the locator policy.
-
getName()
- Returns the property reflecting the bound agent.
-
isBound()
- Returns true if the agent bean is bound to an agent.
-
locate(String, String)
- Locates the ExecutionService in the given system group and system.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes the given listener from the set of listeners to be notified of property changes.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes the given listener from the set of listeners to be notified of vetoable property changes.
-
setConfigurationID(String)
- Sets the configuration identifier to be used by the embedded agent.
-
setContext(Applet, Properties)
- Sets the context for the agent bean.
-
setContext(String[], Properties)
- Sets the context for the agent bean.
-
setLocator(int)
- Sets the locator policy for this agent.
-
setName(String)
- Sets the name of the agent.
-
toString()
- Returns the name of the agent the bean is bound to.
-
versionInfo()
- Returns information about version, release, modlevel and driver build of the agent.
OSA_LOCATOR
public static final int OSA_LOCATOR
- Using this locator will instruct the agent bean to use the VisiBroker Smart Agent directory for agent lookup and to use
CORBA IIOP for communication with the agent.
COS_LOCATOR
public static final int COS_LOCATOR
- Using this locator will instruct the agent bean to use the CORBA Naming Service for agent lookup and to use CORBA IIOP for
communication with the agent.
IOR_LOCATOR
public static final int IOR_LOCATOR
- Using this locator will instruct the agent bean to interpret the agent name as a Internet Inter-ORB reference and to use
CORBA IIOP for communication with the agent. The agent bean will use the native Java mechanism to resolve the IOR as an URL.
LOC_LOCATOR
public static final int LOC_LOCATOR
- Using this locator will instruct the agent bean to instantiate an embedded agent deamon instead of looking up a reference to
an existing (remote) agent. As this agent will execute in the same address space the agent bean will use local method
invocation for communication. Note that in order to use this locator the MQWF client API's must be installed and configured
at the local node.
RMI_LOCATOR
public static final int RMI_LOCATOR
- Using this locator will instruct the agent bean to use the RMI registry for agent lookup and to use Java RMI communication
with the agent.
LOCATORS
public static final String LOCATORS[]
- A string array of the stringified locator symbols.
LOCATOR_TAGS
public static final String LOCATOR_TAGS[]
- A string array holding the locator names.
Agent
public Agent()
- Constructs an Agent object. Initially, an Agent has no context, locator policy or name. An Agent bean can also be
instantiated from its serialized form using java.beans.Beans.instantiate().
setContext
public void setContext(String args[],
Properties properties)
- Sets the context for the agent bean. Note that this call must preceed the call to Agent.setName() as the
latter implicitly passes the context to the underlying ORB (if IIOP is used for communication).
- Parameters:
- args
- the command line arguments to pass to the ORB. If IIOP is used as communication protocol, this parameter can
be used to propagate the application command line arguments to the ORB used by the agent bean.
- properties
- the environmental properties passed to the application/applet when it was instantiated.
setContext
public void setContext(Applet applet,
Properties properties)
- Sets the context for the agent bean. Note that this call must preceed the call to Agent.setName() as the
latter implicitly passes the context to the underlying ORB (if IIOP is used for communication).
- Parameters:
- applet
- the applet which instantiated the agent bean. If IIOP is used as communication protocol, providing this information is
mandatory if the agent bean was instantiated by an applet.
- properties
- the environmental properties passed to the application/applet when it was instantiated.
locate
public ExecutionService locate(String group,
String system) throws FmcException
- Locates the ExecutionService in the given system group and system. If both system group and system are empty (strings), the
default ExecutionService associated with the agent is returned. This function intentionally always returns an object
reference even if the given system group and system do not denote a valid ExecutionService.
- Parameters:
- group
- the system group
- system
- the system
- Returns:
- the qualifying ExecutionService
- Throws: FmcException
- thrown if an API error or a communication error occurred.
getExecutionAgent
public ExecutionAgent getExecutionAgent() throws FmcException
- Returns an ExecutionAgent. Using this method allows an activity implementation to obtain access to the workflow process
context under which it was invoked.
- Returns:
- the ExecutionAgent for the workflow process context if the method was invoked from an activity implementation using local
locator policy, null otherwise.
- Throws: FmcException
- thrown if an API error or a communication error occurred.
- See Also:
- ExecutionAgent, LOC_LOCATOR
toString
public String toString()
- Returns the name of the agent the bean is bound to.
- Returns:
- the name of the agent
- Overrides:
- toString in class Object
- See Also:
- getName, setName
isBound
public boolean isBound()
- Returns true if the agent bean is bound to an agent.
- Returns:
- true if bound, false otherwise
versionInfo
public VersionInfo versionInfo() throws FmcException
- Returns information about version, release, modlevel and driver build of the agent.
- Returns:
- the version and driver build information if the agent bean is bound to an agent, null otherwise
- Throws: FmcException
- thrown if an API error or a communication error occurred.
setName
public void setName(String newName) throws PropertyVetoException
- Sets the name of the agent. This is the name of the agent the bean will try to contact as a result of this method
invocation. In order to contact the agent the bean will consult the directory service implied by the locator policy
passing the given name. Note that this call must succeed the call to Agent.setLocator().
- Parameters:
- newName
- the name of the agent
- Throws: PropertyVetoException
- if the agent bean cannot contact the agent, i.e. the consulted directory service could not resolve the given name to an agent
reference.
getName
public synchronized String getName()
- Returns the property reflecting the bound agent. If the agent bean is not bound to an agent, an empty string is returned.
- Returns:
- the bound agent
setConfigurationID
public void setConfigurationID(String newConfigurationID) throws PropertyVetoException
- Sets the configuration identifier to be used by the embedded agent. Note that this call implicitely sets the LOC_LOCATOR
policy.
- Parameters:
- newConfigurationID
- the configration identifier.
- Throws: PropertyVetoException
- if a configuration for the given identifier was not found.
getConfigurationID
public String getConfigurationID() throws FmcException
- Returns the configuration to
be used for profile accesses.
- Throws: FmcException
- thrown if an API error or a communication error occurred.
setLocator
public void setLocator(int newLoc) throws PropertyVetoException
- Sets the locator policy for this agent. Note that this call must preceed the call to Agent.setName() as the
latter implicitly uses the locator policy set up by calling this method.
- Parameters:
- newLoc
- the locator policy
- Throws: PropertyVetoException
- if the selected locator policy is not supported (i.e. not yet implemented)
- See Also:
- COS_LOCATOR, IOR_LOCATOR, LOC_LOCATOR, OSA_LOCATOR, RMI_LOCATOR
getLocator
public synchronized int getLocator()
- Returns the property describing the locator policy.
- Returns:
- the locator property
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener l)
- Adds the given listener to the set of listeners to be notified of property changes.
- Parameters:
- l
- the listener to add
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener l)
- Removes the given listener from the set of listeners to be notified of property changes.
- Parameters:
- l
- the listener to remove
addVetoableChangeListener
public void addVetoableChangeListener(VetoableChangeListener l)
- Adds the given listener to the set of listeners to be notified of vetoable property changes.
- Parameters:
- l
- the listener to add
removeVetoableChangeListener
public void removeVetoableChangeListener(VetoableChangeListener l)
- Removes the given listener from the set of listeners to be notified of vetoable property changes.
- Parameters:
- l
- the listener to remove
All Packages Class Hierarchy This Package Previous Next Index