ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.conversation
Interface ConversationPolicyListener


public interface ConversationPolicyListener

The ConversationPolicyListener interface processes outputs from a ConversationPolicyHandler.

A ConverstionPolicyHandler must be assigned a ConversationPolicyListener when it is initialized. When the ConversationPolicyHandler processes a valid input, it will generate outputs by calling ConversationPolicyListener methods.


Method Summary
 void cpDone(java.lang.String returnCode)
          Processes a conversation-policy-done output from the ConversationPolicyHandler.
 void cpLoad(java.lang.String cpName, java.lang.String selfRole)
          Processes a load-conversation-policy output from the ConversationPolicyHandler.
 void decisionPoint(java.lang.String name, java.lang.Object[] args)
          Processes a decision-point output from the ConversationPolicyHandler.
 void inboundData(java.lang.String name, java.lang.Object[] args)
          Processes an inbound-data output from the ConversationPolicyHandler.
 void outboundMessage(java.lang.Object msg)
          Processes an outbound-message output from the ConversationPolicyHandler.
 void setTimer(long millis, java.lang.String currentStateName)
          Processes a set-timer output from the ConversationPolicyHandler.
 void timeout(java.lang.String newStateName)
          Processas a timeout output from the ConversationPolicyHandler.
 void unexpectedMessage(java.lang.Object msg)
          Processes an unexpected-message output from the ConversationPolicyHandler.
 

Method Detail

decisionPoint

public void decisionPoint(java.lang.String name,
                          java.lang.Object[] args)
Processes a decision-point output from the ConversationPolicyHandler.

This is called by the ConversationPolicyHandler when it has entered a decision state (i.e., a state in which input from the decision logic is allowed). In effect, this is a signal to this agent that it can or must make a decision. Frequently this occurs when the other agent has sent a message. In that case, the contents of the message, having been transformed by the appropriate MessageTransform into decision data, are passed in as an Object array. It also occurs when the ConversationPolicyHandler takes a timeout or child-return transition to a decision state.

Parameters:
name - The name of the decision point.
args - The decision data. If null, there was no additional data associated with the named decision point.

inboundData

public void inboundData(java.lang.String name,
                        java.lang.Object[] args)
Processes an inbound-data output from the ConversationPolicyHandler.

This is called by the ConversationPolicyHandler when it has processed an inbound message and taken a transition to a state that is not a decision state.

Parameters:
name - The name of the state entered.
args - The decision data. If null, there was no additional data associated with the named state.

timeout

public void timeout(java.lang.String newStateName)
Processas a timeout output from the ConversationPolicyHandler.

This is called by the ConversationPolicyHandler when it has taken a timeout transition (which was itself triggered by a call to ConversationPolicyHandler.timerExpired()) to a state that is not a decision state.

Parameters:
newStateName - The name of the state entered.

outboundMessage

public void outboundMessage(java.lang.Object msg)
Processes an outbound-message output from the ConversationPolicyHandler.

This is called by the ConversationPolicyHandler when it has created an outbound message (e.g., as the result of processing an input decision).

Parameters:
msg - The message to be delivered to the other agent.

cpDone

public void cpDone(java.lang.String returnCode)
Processes a conversation-policy-done output from the ConversationPolicyHandler.

This is called by the ConversationPolicyHandler when it has entered a terminal state. It's a signal that the ConversationPolicyHandler should be removed from the context stack and its parent should be activated.

Parameters:
returnCode - the terminal state's return code.

cpLoad

public void cpLoad(java.lang.String cpName,
                   java.lang.String selfRole)
Processes a load-conversation-policy output from the ConversationPolicyHandler.

This is called by the ConversationPolicyHandler when it has entered a load-child state. It's a signal that the Conversation should create a new ConversationPolicyHandler, install it in the context stack as a child of the current ConversationPolicyHandler, and start executing it.

Parameters:
cpName - The name of the child policy.
selfRole - The role to play in the child policy.

setTimer

public void setTimer(long millis,
                     java.lang.String currentStateName)
Processes a set-timer output from the ConversationPolicyHandler.

This is called by the ConversationPolicyHandler when it has entered a state in which a timeout is defined. It's a signal that the Conversation should start a state-timer for this state.

The timeout value gives the amount of time that should elapse before the timer expires.

Parameters:
millis - The timeout value, in milliseconds.
currentStateName - The name of the state to which the timout applies.

unexpectedMessage

public void unexpectedMessage(java.lang.Object msg)
Processes an unexpected-message output from the ConversationPolicyHandler.

This is called by the ConversationPolicyHandler when it has failed to find a transition matching a message received from the other agent--i.e., because the other agent has sent a message not allowed by the conversation policy.

Parameters:
msg - The message received.

ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003