|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.dna.repository.rules.RuleSetRepositoryMonitor
@ThreadSafe public class RuleSetRepositoryMonitor
A component that can listen to a JCR repository and keep the RuleSet instances of a RuleService synchronized
with that repository.
This class is a NodeChangeListener that can subscribe to
changes in one or more JCR repositories being monitored by an ObservationService. As changes under the rule sets
branch are discovered, they are processed asynchronously. This ensure that the processing of the repository contents does not
block the other listeners of the ObservationService.
| Field Summary | |
|---|---|
static String |
DEFAULT_JCR_ABSOLUTE_PATH
|
protected static String |
JCR_PATH_DELIM
|
| Constructor Summary | |
|---|---|
RuleSetRepositoryMonitor(RuleService ruleService,
String jcrAbsolutePath,
JcrExecutionContext executionContext)
Create an instance that can listen to the RuleSet definitions stored in a JCR repository and ensure that the
RuleSet instances of a RuleService reflect the definitions in the repository. |
|
| Method Summary | |
|---|---|
protected RuleSet |
buildRuleSet(String name,
javax.jcr.Node ruleSetNode,
JcrTools tools)
Create a rule set from the supplied node. |
String |
getAbsolutePathToRuleSets()
|
org.jboss.dna.common.util.Logger |
getLogger()
|
RuleService |
getRuleService()
|
void |
onNodeChanges(NodeChanges changes)
|
protected void |
processRuleSets(Map<String,Set<String>> ruleSetNamesByWorkspaceName)
Process the rule sets given by the supplied names, keyed by the repository workspace name. |
void |
setLogger(org.jboss.dna.common.util.Logger logger)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_JCR_ABSOLUTE_PATH
protected static final String JCR_PATH_DELIM
| Constructor Detail |
|---|
public RuleSetRepositoryMonitor(RuleService ruleService,
String jcrAbsolutePath,
JcrExecutionContext executionContext)
RuleSet definitions stored in a JCR repository and ensure that the
RuleSet instances of a RuleService reflect the definitions in the repository.
ruleService - the rule service that should be kept in sync with the JCR repository.jcrAbsolutePath - the absolute path to the branch where the rule sets are defined; if null or empty, the
default path is usedexecutionContext - the context in which this monitor is to execute
IllegalArgumentException - if the rule service or execution context is null, or if the supplied
jcrAbsolutePath is invalid| Method Detail |
|---|
public RuleService getRuleService()
public String getAbsolutePathToRuleSets()
public org.jboss.dna.common.util.Logger getLogger()
public void setLogger(org.jboss.dna.common.util.Logger logger)
logger - Sets logger to the specified value.public void onNodeChanges(NodeChanges changes)
onNodeChanges in interface NodeChangeListenerprotected void processRuleSets(Map<String,Set<String>> ruleSetNamesByWorkspaceName)
ruleSetNamesByWorkspaceName - the set of rule set names keyed by the repository workspace name
protected RuleSet buildRuleSet(String name,
javax.jcr.Node ruleSetNode,
JcrTools tools)
This implementation expects a node of type 'dna:ruleSet' and the following properties (expressed as XPath statements relative to the supplied node):
description is obtained from the "./@jcr:description" string
property. This property is optional.classname is obtained from the "./@dna:classname" string
property. This property is required.classpath is obtained from the "./@dna:classpath" string
property. This property is optional, and if abscent then the classpath will be assumed from the current context.provider URI is obtained from the "./@dna:serviceProviderUri"
string property, and corresponds to the URI of the JSR-94 rules engine service provider. This property is required.rule set URI is obtained from the "./@dna:ruleSetUri" string
property. This property is optional and defaults to the node name (e.g., "./@jcr:name").definition of the rules is obtained from the "./@dna:rules" string
property. This property is required and must be in a form suitable for the JSR-94 rules engine.properties are obtained from the "./dna:properties[contains(@jcr:mixinTypes,'dna:propertyContainer')]/*[@jcr:nodeType='dna:property']"
property nodes, where the name of the property is extracted from the property node's "./@jcr:name" string
property and the value of the property is extracted from the property node's "./@dna:propertyValue" string
property. Rule set properties are optional.
name - the name of the rule set; never nullruleSetNode - the node representing the rule set; null if the rule set doesn't existtools -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||