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:

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

Variable Index

 o 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.
 o 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.
 o 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.
 o LOCATOR_TAGS
A string array holding the locator names.
 o LOCATORS
A string array of the stringified locator symbols.
 o 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.
 o 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.

Constructor Index

 o Agent()
Constructs an Agent object.

Method Index

 o addPropertyChangeListener(PropertyChangeListener)
Adds the given listener to the set of listeners to be notified of property changes.
 o addVetoableChangeListener(VetoableChangeListener)
Adds the given listener to the set of listeners to be notified of vetoable property changes.
 o getConfigurationID()
Returns the configuration to be used for profile accesses.
 o getExecutionAgent()
Returns an ExecutionAgent.
 o getLocator()
Returns the property describing the locator policy.
 o getName()
Returns the property reflecting the bound agent.
 o isBound()
Returns true if the agent bean is bound to an agent.
 o locate(String, String)
Locates the ExecutionService in the given system group and system.
 o removePropertyChangeListener(PropertyChangeListener)
Removes the given listener from the set of listeners to be notified of property changes.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes the given listener from the set of listeners to be notified of vetoable property changes.
 o setConfigurationID(String)
Sets the configuration identifier to be used by the embedded agent.
 o setContext(Applet, Properties)
Sets the context for the agent bean.
 o setContext(String[], Properties)
Sets the context for the agent bean.
 o setLocator(int)
Sets the locator policy for this agent.
 o setName(String)
Sets the name of the agent.
 o toString()
Returns the name of the agent the bean is bound to.
 o versionInfo()
Returns information about version, release, modlevel and driver build of the agent.

Variables

 o 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.

 o 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.

 o 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.

 o 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.

 o 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.

 o LOCATORS
 public static final String LOCATORS[]
A string array of the stringified locator symbols.

 o LOCATOR_TAGS
 public static final String LOCATOR_TAGS[]
A string array holding the locator names.

Constructors

 o 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().

Methods

 o 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.
 o 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.
 o 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.
 o 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
 o 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
 o isBound
 public boolean isBound()
Returns true if the agent bean is bound to an agent.

Returns:
true if bound, false otherwise
 o 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.
 o 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.
 o 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
 o 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.
 o 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.
 o 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
 o getLocator
 public synchronized int getLocator()
Returns the property describing the locator policy.

Returns:
the locator property
 o 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
 o 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
 o 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
 o 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