|
This component provides the ability to:
A behaviour may be bound to a Policy before the Policy is registered. In this case, the behaviour is not validated (i.e. checked to determine if it supports the policy interface) until the Policy is registered. Otherwise, the behaviour is validated at bind-time. Policies may be selectively "turned off" by the Behaviour Filter.
Method Summary | ||
bindAssociationBehaviour(QName policy, Object service, Behaviour behaviour) Bind a Service specific behaviour to an Association-level Policy |
||
bindAssociationBehaviour(QName policy, QName className, Behaviour behaviour) Bind an Association specific behaviour to an Association-level Policy (for all associations of a Class) |
||
bindAssociationBehaviour(QName policy, QName className, QName assocName, Behaviour behaviour) Bind an Association specific behaviour to an Association-level Policy |
||
bindClassBehaviour(QName policy, Object service, Behaviour behaviour) Bind a Service behaviour to a Class-level Policy |
||
bindClassBehaviour(QName policy, QName className, Behaviour behaviour) Bind a Class specific behaviour to a Class-level Policy. |
||
bindPropertyBehaviour(QName policy, Object service, Behaviour behaviour) Bind a Service specific behaviour to a Property-level Policy |
||
bindPropertyBehaviour(QName policy, QName className, Behaviour behaviour) Bind a Property specific behaviour to a Property-level Policy (for all properties of a Class) |
||
bindPropertyBehaviour(QName policy, QName className, QName propertyName, Behaviour behaviour) Bind a Property specific behaviour to a Property-level Policy |
||
getRegisteredPolicies() Gets all registered Policies |
||
getRegisteredPolicy(PolicyType policyType, QName policy) Gets the specified registered Policy |
||
boolean |
isRegisteredPolicy(PolicyType policyType, QName policy) Determine if the specified policy has been registered |
|
<P extends AssociationPolicy> AssociationPolicyDelegate<P> |
registerAssociationPolicy(Class<P> policy) Register a Association-level Policy |
|
<P extends ClassPolicy> ClassPolicyDelegate<P> |
registerClassPolicy(Class<P> policy) Register a Class-level Policy |
|
<P extends PropertyPolicy> PropertyPolicyDelegate<P> |
registerPropertyPolicy(Class<P> policy) Register a Property-level Policy |
|
void |
removeClassDefinition(BehaviourDefinition<ClassBehaviourBinding> definition) Unbind behaviour |
So when the named policy, happens on the specified aspect or type, the specified behaviour is executed.
Example of calling this method
this.policyComponent.bindClassBehaviour( NodeServicePolicies.BeforeUpdateNodePolicy.QNAME, ContentModel.ASPECT_LOCKABLE, new JavaBehaviour(this, "beforeUpdateNode"));
For example, before a rule folder association is created.
policyComponent.bindAssociationBehaviour( NodeServicePolicies.OnCreateChildAssociationPolicy.QNAME, RuleModel.ASPECT_RULES, RuleModel.ASSOC_RULE_FOLDER, new JavaBehaviour(this, "OnCreateChildAssociation"));
|