|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.able.conversation.AbleConversationPolicyHandlerFactory
The AbleConversationPolicyHandlerFactory class is an ABLE-specific implementation of the ConversationPolicyHandlerFactory interface.
The ABLE-specific features consist of exception messages and logging and trace-logging mechanisms. The latter are implemented as calls to the appropriate methods on an AbleBean designated as this AbleConversationPolicyHandlerFactory's "owner".
There is also an additional feature, not defined in the ConversationPolicyHandler interface, to find and read graph-layout files for conversation policies. A graph-layout file specifies the positions to assign to the states in a conversation policy state machine, e.g., for displaying the graph.
Field Summary | |
---|---|
static java.lang.String |
CP_PATH_NAME
Key under which the cpXML file's path name is stored in a CP's property sheet. |
static java.lang.String |
LAYOUT_PATH_NAME
Key under which the layout file's path name is stored in a CP's property sheet. |
static java.lang.String |
STATE_MACHINE
Key under which the state machine is stored in a CP's property sheet. |
Constructor Summary | |
---|---|
AbleConversationPolicyHandlerFactory()
Constructs an AbleConversationPolicyHandlerFactory object using the default repository path name ("."). |
|
AbleConversationPolicyHandlerFactory(AbleBean newOwner)
Constructs an AbleConversationPolicyHandlerFactory object using the default repository path name ("."). |
|
AbleConversationPolicyHandlerFactory(AbleBean newOwner,
java.lang.String newName)
Constructs an AbleConversationPolicyHandlerFactory object using the given repository path name. |
|
AbleConversationPolicyHandlerFactory(java.lang.String newName)
Constructs an AbleConversationPolicyHandlerFactory object using the given repository path name. |
Method Summary | |
---|---|
protected void |
addConversationPolicy(java.lang.String cpUri)
Creates and initializes a CpStateMachine by reading the cpXML file at the given URI. |
protected void |
addConversationPolicyLayout(java.lang.String layoutFile)
Adds the given graph-layout file to the property sheet of the conversation policy it's associated with. |
protected java.util.Properties |
findOrCreatePropertySheet(java.lang.String policyName)
Finds or creates the property sheet for the given conversation policy. |
java.lang.String |
getLayoutFile(java.lang.String policyName)
Returns the graph-layout file's pathname for the given conversation policy. |
ConversationPolicyHandler |
getPolicyHandler(java.lang.String cpName,
java.lang.String selfRole)
Creates and returns a new ConversationPolicyHandler initialized with the given conversation policy and role. |
java.util.Set |
getPolicyNames()
Returns the names of the policies this factory is able to create. |
java.lang.Object |
getProperty(java.lang.String policyName,
java.lang.String propertyName)
Returns the object stored under the given name in the property sheet of the given policy. |
java.util.Properties |
getPropertySheet(java.lang.String policyName)
Returns the property sheet for the policy with the given name. |
java.lang.String |
getRepositoryPathName()
Returns the repository path name. |
java.util.Collection |
getRoles(java.lang.String policyName)
Returns the roles defined by the given conversation policy. |
void |
init()
Loads the conversation policies and graph-layout files found in the directory given by the repository path name. |
boolean |
isPolicySupported(java.lang.String cpName,
java.lang.String selfRole)
Indicates whether the given policy and role is supported. |
void |
setRepositoryPathName(java.lang.String newName)
Sets the repository path name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String STATE_MACHINE
public static final java.lang.String CP_PATH_NAME
public static final java.lang.String LAYOUT_PATH_NAME
Constructor Detail |
public AbleConversationPolicyHandlerFactory()
public AbleConversationPolicyHandlerFactory(AbleBean newOwner)
newOwner
- The AbleBean that "owns" this object.public AbleConversationPolicyHandlerFactory(java.lang.String newName)
newName
- The repository path name.public AbleConversationPolicyHandlerFactory(AbleBean newOwner, java.lang.String newName)
newOwner
- The AbleBean that "owns" this object.newName
- The repository path name.Method Detail |
public java.lang.String getRepositoryPathName()
This is the directory in which the factory looks for conversation policy files: both cpXML and graph-layout files. The cpXML files are all assumed to have extension ".xml". The graph-layout files are all assumed to have extension ".glf".
public void setRepositoryPathName(java.lang.String newName)
This is the directory in which the factory looks for conversation policy files: both cpXML and graph-layout. The cpXML files are all assumed to have extension ".xml". The graph-layout files are all assumed to have extension ".glf".
When the directory is set, this factory immediately reads all cpXML and graph-layout files found in the directory and builds a state machine for conversation policy found.
newName
- The new repository path name.public java.util.Set getPolicyNames()
ConversationPolicyHandlerFactory
getPolicyNames
in interface ConversationPolicyHandlerFactory
com.ibm.conversation.ConversationPolicyHandlerFactory
public java.util.Collection getRoles(java.lang.String policyName)
ConversationPolicyHandlerFactory
getRoles
in interface ConversationPolicyHandlerFactory
com.ibm.conversation.ConversationPolicyHandlerFactory
policyName
- The name of the conversation policy.null
if the policyName was
not found.public boolean isPolicySupported(java.lang.String cpName, java.lang.String selfRole)
ConversationPolicyHandlerFactory
isPolicySupported
in interface ConversationPolicyHandlerFactory
com.ibm.conversation.ConversationPolicyHandlerFactory
public java.util.Properties getPropertySheet(java.lang.String policyName)
Users may add properties to the property sheet as desired. It already
contains entries for state machine (under the key
AbleConversationPolicyHandlerFactory.STATE_MACHINE
),
the cpXML file's pathname (under key
AbleConversationPolicyHandlerFactory.CP_PATH_NAME
) and
the graph-layout file's pathname (under key
AbleConversationPolicyHandlerFactory.LAYOUT_PATH_NAME
). Users should
not change these entries.
policyName
- The name of the conversation policy.null
if not found.public java.lang.Object getProperty(java.lang.String policyName, java.lang.String propertyName)
policyName
- The name of the conversation policy.propertyName
- The name of the desired property.null
if not found.public java.lang.String getLayoutFile(java.lang.String policyName)
(String)getProperty(policyName, LAYOUT_PATH_NAME);
.
The graph-layout file gives the locations to assign to the graph's nodes when displaying the graph.
policyName
- The name of the conversation policyprotected java.util.Properties findOrCreatePropertySheet(java.lang.String policyName)
If a property sheet exists for the given policyName, returns it. If not, creates one, stores it, and returns it. Does not add any of the predefined properties to the newly created sheet.
policyName
- The name of the conversation policy.public void init()
This is not done at creation time, in case the repository path isn't known until later. It is done automatically every time the repository path is set, however.
public ConversationPolicyHandler getPolicyHandler(java.lang.String cpName, java.lang.String selfRole)
ConversationPolicyHandlerFactory
If there is no known policy with the given name, or if the role does not match one of
the roles defined in the policy, returns null
.
getPolicyHandler
in interface ConversationPolicyHandlerFactory
com.ibm.conversation.ConversationPolicyHandlerFactory
cpName
- The name of the conversation policy to be used.selfRole
- The role to play in the conversation policy.null
if creation failed.protected void addConversationPolicy(java.lang.String cpUri)
cpUri
- The URI of the cpXML file.protected void addConversationPolicyLayout(java.lang.String layoutFile)
layoutFile
- The filename of the graph-layout file.
|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |