org.jboss.dna.repository.rules
Class RuleSetRepositoryMonitor
java.lang.Object
org.jboss.dna.repository.rules.RuleSetRepositoryMonitor
- All Implemented Interfaces:
- NodeChangeListener
@ThreadSafe
public class RuleSetRepositoryMonitor
- extends Object
- implements NodeChangeListener
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
.
- Author:
- Randall Hauch
DEFAULT_JCR_ABSOLUTE_PATH
public static final String DEFAULT_JCR_ABSOLUTE_PATH
- See Also:
- Constant Field Values
RuleSetRepositoryMonitor
public 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.
- Parameters:
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
- Throws:
IllegalArgumentException
- if the rule service or execution context is null, or if the supplied
jcrAbsolutePath
is invalid
getRuleService
public RuleService getRuleService()
- Returns:
- ruleService
getAbsolutePathToRuleSets
public String getAbsolutePathToRuleSets()
- Returns:
- jcrAbsolutePath
getLogger
public Logger getLogger()
- Returns:
- logger
setLogger
public void setLogger(Logger logger)
- Parameters:
logger
- Sets logger to the specified value.
onNodeChanges
public void onNodeChanges(NodeChanges changes)
-
- Specified by:
onNodeChanges
in interface NodeChangeListener
Copyright © 2008-Present JBoss a division of Red Hat. All Rights Reserved.