com.ibm.workflow.api
Class MQWFAgent

java.lang.Object
  |
  +--com.ibm.workflow.api.MQWFAgent
All Implemented Interfaces:
AgentExtension, java.io.Serializable

public class MQWFAgent
extends java.lang.Object
implements AgentExtension, java.io.Serializable

An instance of this class is used to gain access to MQWF services. The main functions of the MQWFAgent class are to select the the MQWF configuration and to create the ExecutionService. The ExecutionService can then be used to logon to the Workflow server and to call MQWF services.

An instance of the MQWFAgent class can be reused to create multiple ExecutionService instances. It has no other functionality after calling the locate method.

See Also:
Serialized Form

Field Summary
static int JNDI_LOCATOR
           
static int LOC_LOCATOR
           
static java.lang.String[] LOCATOR_TAGS
           
static java.lang.String[] LOCATORS
           
static java.io.PrintWriter log
           
static com.ibm.workflow.client.util.logging.FmcTrace trace
           
 
Constructor Summary
MQWFAgent()
          Constructs an MQWFAgent instance.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Adds the given listener to the set of listeners to be notified of property changes.
 void addVetoableChangeListener(java.beans.VetoableChangeListener l)
          Adds the given listener to the set of listeners to be notified of vetoable property changes.
 java.lang.String getConfigurationID()
          Returns the configuration to be used for profile accesses.
 ExecutionAgent getExecutionAgent()
          Not implemented.
 int getLocator()
          Returns the locator policy.
 java.lang.String getName()
          Returns the name of the agent.
 boolean isBound()
          Returns true if the agent is bound.
 ExecutionService locate(java.lang.String group, java.lang.String system)
          Locates the ExecutionService in the given system group and system.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Removes the given listener from the set of listeners to be notified of property changes.
 void removeVetoableChangeListener(java.beans.VetoableChangeListener l)
          Removes the given listener from the set of listeners to be notified of vetoable property changes.
 void setConfigurationID(java.lang.String newConfigurationID)
          Sets the configuration identifier to be used by the agent.
 void setContext(java.applet.Applet applet, java.util.Properties properties)
          Sets the context for the Agent.
 void setContext(java.lang.String[] args, java.util.Properties properties)
          Sets the context for the Agent.
 void setLocator(int newLoc)
          Sets the locator policy for this agent.
 void setName(java.lang.String newName)
          Sets the name of the agent.
 java.lang.String toString()
          Returns the name of the agent.
 VersionInfo versionInfo()
          Returns information about version, release, modification level, and driver build of the agent.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOC_LOCATOR

public static final int LOC_LOCATOR

JNDI_LOCATOR

public static final int JNDI_LOCATOR

LOCATORS

public static final java.lang.String[] LOCATORS

LOCATOR_TAGS

public static final java.lang.String[] LOCATOR_TAGS

log

public static java.io.PrintWriter log

trace

public static com.ibm.workflow.client.util.logging.FmcTrace trace
Constructor Detail

MQWFAgent

public MQWFAgent()
Constructs an MQWFAgent instance.
Method Detail

setContext

public void setContext(java.lang.String[] args,
                       java.util.Properties properties)
Sets the context for the Agent.
Specified by:
setContext in interface AgentExtension
Parameters:
args - the command line arguments.
properties - the environmental properties passed to the application/applet when it was instantiated.

setContext

public void setContext(java.applet.Applet applet,
                       java.util.Properties properties)
Sets the context for the Agent.
Specified by:
setContext in interface AgentExtension
Parameters:
applet - the applet which instantiated the agent
properties - the environmental properties passed to the application/applet when it was instantiated

locate

public ExecutionService locate(java.lang.String group,
                               java.lang.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. If the system is (an) empty (string), MQSeries will select a system in the system group's cluster. This function intentionally always returns an object reference even if the given system group and system do not denote a valid ExecutionService.
Specified by:
locate in interface AgentExtension
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
Not implemented. Use C API if this function is required
Specified by:
getExecutionAgent in interface AgentExtension
Returns:
calling of this method is no longer supported
Throws:
FmcException - thrown if this method is called.

toString

public java.lang.String toString()
Returns the name of the agent.
Specified by:
toString in interface AgentExtension
Overrides:
toString in class java.lang.Object
Returns:
the name of the agent
See Also:
getName(), setName(java.lang.String)

isBound

public boolean isBound()
Returns true if the agent is bound.
Specified by:
isBound in interface AgentExtension
Returns:
true if bound, false otherwise

versionInfo

public VersionInfo versionInfo()
                        throws FmcException
Returns information about version, release, modification level, and driver build of the agent.
Specified by:
versionInfo in interface AgentExtension
Returns:
the version and driver build information.
Throws:
FmcException -  

setName

public void setName(java.lang.String newName)
             throws java.beans.PropertyVetoException
Sets the name of the agent. You can specify any name. The default agent name is "MQWFAgent". Note: This call is available for compatibility reason only. It is not necessary to call this method.
Specified by:
setName in interface AgentExtension
Parameters:
newName - the name of the agent
Throws:
java.beans.PropertyVetoException -  
See Also:
setLocator(int), setConfigurationID(java.lang.String)

getName

public java.lang.String getName()
Returns the name of the agent. If the agent is not bound, an empty string is returned. Note: This call is available for compatibility reason only.
Specified by:
getName in interface AgentExtension
Returns:
the name of the agent

setConfigurationID

public void setConfigurationID(java.lang.String newConfigurationID)
                        throws java.beans.PropertyVetoException
Sets the configuration identifier to be used by the agent. A java.beans.PropertyVetoException is thrown when the configuration ID is invalid or if the configuration cannot be found.
Specified by:
setConfigurationID in interface AgentExtension
Parameters:
newConfigurationID - the configration identifier.
Throws:
java.beans.PropertyVetoException - if a configuration for the given identifier was not found.
See Also:
setLocator(int), setName(java.lang.String)

getConfigurationID

public java.lang.String getConfigurationID()
                                    throws FmcException
Returns the configuration to be used for profile accesses.
Specified by:
getConfigurationID in interface AgentExtension
Throws:
FmcException - thrown if an API error or a communication error occurred.

setLocator

public void setLocator(int newLoc)
                throws java.beans.PropertyVetoException
Sets the locator policy for this agent. LOC_LOCATOR is the only supported value. Any other value will throw a java.beans.PropertyVetoException. Note: This call is available for compatibility reason only. It is not necessary to call this method.
Specified by:
setLocator in interface AgentExtension
Parameters:
newLoc - the locator policy
Throws:
java.beans.PropertyVetoException - if the selected locator policy is not supported.
See Also:
setName(java.lang.String), setConfigurationID(java.lang.String), LOC_LOCATOR

getLocator

public int getLocator()
Returns the locator policy. LOC_LOCATOR is the only supported value.
Specified by:
getLocator in interface AgentExtension
Returns:
the locator property

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds the given listener to the set of listeners to be notified of property changes.
Specified by:
addPropertyChangeListener in interface AgentExtension
Parameters:
l - the listener to add

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes the given listener from the set of listeners to be notified of property changes.
Specified by:
removePropertyChangeListener in interface AgentExtension
Parameters:
l - the listener to remove

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.VetoableChangeListener l)
Adds the given listener to the set of listeners to be notified of vetoable property changes.
Specified by:
addVetoableChangeListener in interface AgentExtension
Parameters:
l - the listener to add

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener l)
Removes the given listener from the set of listeners to be notified of vetoable property changes.
Specified by:
removeVetoableChangeListener in interface AgentExtension
Parameters:
l - the listener to remove


© Copyright IBM Corporation 1999, 2007. All Rights Reserved.