|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.oakgrovesystems.reactor.processMediation.Policy
Policy objects encapsulate arbitrary logic that is relevant to the process being modeled. They allow processes to be custom scripted and extremely flexible. Policies associate a Java class or BSF script with an event that should trigger its execution. The execution of a Policy is triggered in response to the firing of an event. Events consist of an event type (e.g. "ProcessStarted", "StatusAddition", etc.), an event source (e.g. "ProcessCommandService"), a table of event attributes, and an optional Process id that determines the scope of the event. If the scope Process id is included, only Policies associated with the Process specified or its ancestor Processes or Policies in the root node may be triggered by the event. The attributes in the table are specific to the type of event. For example, the attributes of a "ProcessFinished" event contains values for the following keys: "ProcessID" and "ProcessLabelPath"; the attributes of a "StatusAddition" event contains values for the following keys: "ProcessID", "ProcessLabelPath", "StatusID", and "StatusLabelPath". Appendix B lists the attributes that are available from events that are fired from within the Reactor system. Events are sent to Reactor's Policy Execution Service by other parts of the Reactor system in response to actions that occur. Events can also be sent from external systems to Reactor and in the future external systems will be able to register to be notified of events from within Reactor. Events only trigger the execution of Policies that match the event. The attributes of a Policy determine which events the Policy matches. A Policy can specify the type, source, and/or attributes of the events that should trigger it. For example, if a Policy specifies a type of "ProcessStarted" and an attribute value of "foo.bar" for the key "ProcessLabelPath", any event of type "ProcessStarted" with that attribute in its list of attributes will trigger the execution of that Policy, regardless of the source of the event or the other attributes of the event. Each Policy consists of one of two types of executable instructions that get execute when the Policy is triggered: Java classes and BSF scripts. The source code type attribute of a Policy attribute indicates the type of the Policy and how to access the executable instructions so that they can be executed. The source code type must be one of the following three values:
Field Summary | |
protected com.oakgrovesystems.reactor.processMediation.ACL |
acl
the ACL of this Policy |
static int |
CLASSNAME
The value for sourceCodeType that indicates that the String sourceCode attribute is the classname of a runnable Java class |
static int |
CODE
The value for sourceCodeType that indicates that the String sourceCode attribute is source code of a BSF script. |
protected java.lang.String |
description
the description of this Policy |
protected java.util.HashMap |
eventAttributes
the event name (aka event type) a ReactorEvent must have to trigger the execution of this Policy. |
protected java.lang.String |
eventName
the event name (aka event type) a ReactorEvent must have to trigger the execution of this Policy (null indicates that a ReactorEvent of any type may trigger the execution of this Policy). |
protected java.lang.String |
eventSource
the event source a ReactorEvent must have to trigger the execution of this Policy (null indicates that a ReactorEvent with any event source may trigger the execution of this Policy). |
protected java.lang.String |
id
the id of this Policy |
protected java.lang.String |
label
the label of this Policy |
protected java.lang.String |
language
the language of this Policy (only used with BSF Policies). |
protected com.oakgrovesystems.reactor.processMediation.MetaDataParser |
metaDataParser
|
protected java.lang.String |
metaDataString
|
protected com.oakgrovesystems.reactor.ReactorObjectId |
process
the id of the Process with which this Policy is associated |
protected java.lang.String |
securityPolicy
the name of the security policy to enforce on the execution of this Policy. |
protected java.lang.String |
sourceCode
the classname, URL, or raw source for the executable code of this Policy, as specified by the sourceCodeType attribute |
protected int |
sourceCodeType
whether the String sourceCode attribute contains the classname, url or raw source for the executable code of this Policy |
static int |
URL
The value for sourceCodeType that indicates that the String sourceCode attribute is the URL of an ASCII file that contains the source code for a BSF script |
Constructor Summary | |
Policy()
Creates a new Policy and sets it Id |
Method Summary | |
com.oakgrovesystems.reactor.processMediation.ProcessMediationObject |
copy()
returns a deep copy of this ProcessMediationObject |
com.oakgrovesystems.reactor.processMediation.ACL |
getACL()
gets the ACL of this ProcessMediationObject. |
java.lang.String |
getDescription()
gets the desciption of this ProcessMediationObject. |
java.util.Map |
getEventAttributes()
|
java.lang.String |
getEventName()
|
java.lang.String |
getEventSource()
|
java.lang.String |
getId()
gets the Id of this ProcessMediationObject. |
java.lang.String |
getLabel()
set the desciption of this ProcessMediationObject. |
java.lang.String |
getLanguage()
|
java.lang.String |
getMetaDataString()
|
java.lang.String |
getMetaDataValue(java.lang.String key)
|
com.oakgrovesystems.reactor.ReactorObjectId |
getProcess()
Gets the ReactorObjectId of the Process object with which this ProcessAssociatedObject is associated. |
java.lang.String |
getSecurityPolicy()
|
java.lang.String |
getSourceCode()
|
int |
getSourceCodeType()
|
boolean |
isTriggeredBy(com.oakgrovesystems.reactor.ReactorEvent trigger)
Determines whether or not a particular ReactorEvent
triggers the execution of this Policy p. |
boolean |
sameAs(java.lang.Object o)
compares two Policies for content equality |
void |
setACL(com.oakgrovesystems.reactor.processMediation.ACL acl)
set the ACL of this ProcessMediationObject. |
void |
setDescription(java.lang.String description)
set the desciption of this ProcessMediationObject. |
void |
setEventAttributes(java.util.Map eventAttributes)
|
void |
setEventName(java.lang.String eventName)
|
void |
setEventSource(java.lang.String eventSource)
|
void |
setId(java.lang.String id)
set the Id of this ProcessMediationObject. |
void |
setLabel(java.lang.String label)
set the label of this ProcessMediationObject. |
void |
setLanguage(java.lang.String language)
|
void |
setMetaDataKeyValue(java.lang.String key,
java.lang.String value)
|
void |
setMetaDataString(java.lang.String s)
|
void |
setProcess(com.oakgrovesystems.reactor.ReactorObjectId id)
Associates this ProcessAssociatedObject with the Process object referred to by the ReactorObjectId procId. |
void |
setSecurityPolicy(java.lang.String securityPolicy)
|
void |
setSourceCode(java.lang.String sourceCode)
|
void |
setSourceCodeType(int sourceCodeType)
|
java.lang.String |
toString()
returns the label if it is not empty or null. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String id
protected java.lang.String label
protected java.lang.String description
protected com.oakgrovesystems.reactor.processMediation.ACL acl
protected java.lang.String eventSource
protected java.lang.String eventName
protected java.util.HashMap eventAttributes
protected java.lang.String language
protected java.lang.String securityPolicy
protected java.lang.String sourceCode
protected int sourceCodeType
protected com.oakgrovesystems.reactor.ReactorObjectId process
protected java.lang.String metaDataString
protected com.oakgrovesystems.reactor.processMediation.MetaDataParser metaDataParser
public static final int CLASSNAME
public static final int URL
public static final int CODE
Constructor Detail |
public Policy()
Method Detail |
public java.lang.String getId()
getId
in interface ProcessMediationObject
public java.lang.String getLabel()
getLabel
in interface ProcessMediationObject
public java.lang.String getDescription()
getDescription
in interface ProcessMediationObject
public com.oakgrovesystems.reactor.processMediation.ACL getACL()
getACL
in interface ProcessMediationObject
public java.lang.String getEventSource()
public java.lang.String getEventName()
public java.util.Map getEventAttributes()
public java.lang.String getLanguage()
public java.lang.String getSecurityPolicy()
public java.lang.String getSourceCode()
public int getSourceCodeType()
public com.oakgrovesystems.reactor.ReactorObjectId getProcess()
getProcess
in interface ProcessAssociatedObject
public void setId(java.lang.String id)
setId
in interface ProcessMediationObject
id
- the Id of this ProcessMediationObjectpublic void setLabel(java.lang.String label)
setLabel
in interface ProcessMediationObject
label
- the label of this ProcessMediationObjectpublic void setDescription(java.lang.String description)
setDescription
in interface ProcessMediationObject
description
- the description of this ProcessMediationObjectpublic void setACL(com.oakgrovesystems.reactor.processMediation.ACL acl)
setACL
in interface ProcessMediationObject
acl
- the acl of this ProcessMediationObjectpublic void setEventSource(java.lang.String eventSource)
public void setEventName(java.lang.String eventName)
public void setEventAttributes(java.util.Map eventAttributes)
public void setLanguage(java.lang.String language)
public void setSecurityPolicy(java.lang.String securityPolicy)
public void setSourceCode(java.lang.String sourceCode)
public void setSourceCodeType(int sourceCodeType)
public void setProcess(com.oakgrovesystems.reactor.ReactorObjectId id)
setProcess
in interface ProcessAssociatedObject
id
- The id of the Process with which this ProcessAssociatedObject
should be associated.public java.lang.String getMetaDataString()
public void setMetaDataString(java.lang.String s)
public java.lang.String getMetaDataValue(java.lang.String key)
public void setMetaDataKeyValue(java.lang.String key, java.lang.String value)
public boolean isTriggeredBy(com.oakgrovesystems.reactor.ReactorEvent trigger)
ReactorEvent
triggers the execution of this Policy
p.
trigger
- the Reactor Event that could potentially trigger the execution of
this Policy
public com.oakgrovesystems.reactor.processMediation.ProcessMediationObject copy()
copy
in interface ProcessMediationObject
public boolean sameAs(java.lang.Object o)
o
- the Policy to compare for content equality
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |