|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.dna.repository.sequencers.SequencingService
public class SequencingService
A sequencing system is used to monitor changes in the content of JCR repositories and to sequence the
content to extract or to generate structured information.
| Nested Class Summary | |
|---|---|
protected class |
SequencingService.Administrator
The administrative component for this service. |
protected class |
SequencingService.Context
|
protected static class |
SequencingService.DefaultNodeFilter
The default filter implementation, which accepts only new nodes or nodes that have new or changed properties. |
protected static class |
SequencingService.DefaultSelector
The default SequencingService.Selector implementation that selects every sequencer every time it's called, regardless of the node (or
logger) supplied. |
static interface |
SequencingService.NodeFilter
Interface used to determine whether a NodeChange should be processed. |
static interface |
SequencingService.Selector
Interface used to select the set of Sequencer instances that should be run. |
protected class |
SequencingService.SequencerCall
|
class |
SequencingService.Statistics
The statistics for the system. |
| Field Summary | |
|---|---|
protected static org.jboss.dna.common.component.ClassLoaderFactory |
DEFAULT_CLASSLOADER_FACTORY
Class loader factory instance that always returns the current thread's context class
loader (if not null) or component library's class loader. |
static SequencingService.NodeFilter |
DEFAULT_NODE_FILTER
The default SequencingService.NodeFilter that accepts new nodes or nodes that have new/changed properties. |
static SequencingService.Selector |
DEFAULT_SEQUENCER_SELECTOR
The default SequencingService.Selector that considers every Sequencer to be used for every node. |
| Constructor Summary | |
|---|---|
SequencingService()
Create a new sequencing system, configured with no sequencers and not monitoring any workspaces. |
|
| Method Summary | |
|---|---|
boolean |
addSequencer(SequencerConfig config)
Add the configuration for a sequencer, or update any existing one that represents the same configuration |
protected ExecutorService |
createDefaultExecutorService()
Override this method to creates a different kind of default executor service. |
protected boolean |
doAwaitTermination(long timeout,
TimeUnit unit)
|
ServiceAdministrator |
getAdministrator()
Return the administrative component for this service. |
JcrExecutionContext |
getExecutionContext()
|
ExecutorService |
getExecutorService()
Get the executor service used to run the sequencers. |
SequencingService.NodeFilter |
getNodeFilter()
Get the node filter used by this system. |
protected org.jboss.dna.common.component.ComponentLibrary<Sequencer,SequencerConfig> |
getSequencerLibrary()
|
SequencingService.Selector |
getSequencerSelector()
Get the sequencing selector used by this system. |
SequencingService.Statistics |
getStatistics()
Get the statistics for this system. |
protected boolean |
isServiceTerminated()
|
void |
onNodeChanges(NodeChanges changes)
|
protected void |
processChangedNode(NodeChange changedNode)
Do the work of processing by sequencing the node. |
boolean |
removeSequencer(SequencerConfig config)
Remove the configuration for a sequencer. |
void |
setExecutionContext(JcrExecutionContext executionContext)
|
void |
setExecutorService(ExecutorService executorService)
Set the executor service that should be used by this system. |
void |
setNodeFilter(SequencingService.NodeFilter nodeFilter)
Set the filter that checks which nodes are to be sequenced, or null if the default node filter
should be used. |
void |
setSequencerSelector(SequencingService.Selector sequencerSelector)
Set the sequencer selector, or null if the default sequencer selector should be used. |
protected void |
shutdownService()
|
protected void |
startService()
|
boolean |
updateSequencer(SequencerConfig config)
Update the configuration for a sequencer, or add it if there is no matching
configuration. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final SequencingService.Selector DEFAULT_SEQUENCER_SELECTOR
SequencingService.Selector that considers every Sequencer to be used for every node.
setSequencerSelector(org.jboss.dna.repository.sequencers.SequencingService.Selector)public static final SequencingService.NodeFilter DEFAULT_NODE_FILTER
SequencingService.NodeFilter that accepts new nodes or nodes that have new/changed properties.
setSequencerSelector(org.jboss.dna.repository.sequencers.SequencingService.Selector)protected static final org.jboss.dna.common.component.ClassLoaderFactory DEFAULT_CLASSLOADER_FACTORY
current thread's context class
loader (if not null) or component library's class loader.
| Constructor Detail |
|---|
public SequencingService()
paused and must be configured and then
started.
| Method Detail |
|---|
public ServiceAdministrator getAdministrator()
getAdministrator in interface AdministeredServicepublic SequencingService.Statistics getStatistics()
protected org.jboss.dna.common.component.ComponentLibrary<Sequencer,SequencerConfig> getSequencerLibrary()
public boolean addSequencer(SequencerConfig config)
same configuration
config - the new configuration
unchanged sequencer configuration
IllegalArgumentException - if config is nullupdateSequencer(SequencerConfig),
removeSequencer(SequencerConfig)public boolean updateSequencer(SequencerConfig config)
matching
configuration.
config - the updated (or new) configuration
unchanged sequencer configuration
IllegalArgumentException - if config is nulladdSequencer(SequencerConfig),
removeSequencer(SequencerConfig)public boolean removeSequencer(SequencerConfig config)
config - the configuration to be removed
IllegalArgumentException - if config is nulladdSequencer(SequencerConfig),
updateSequencer(SequencerConfig)public JcrExecutionContext getExecutionContext()
public void setExecutionContext(JcrExecutionContext executionContext)
executionContext - Sets executionContext to the specified value.public ExecutorService getExecutorService()
setExecutorService(ExecutorService)public void setExecutorService(ExecutorService executorService)
executor that uses a single thread.
executorService - the executor servicegetExecutorService(),
Executors.newCachedThreadPool(),
Executors.newCachedThreadPool(java.util.concurrent.ThreadFactory),
Executors.newFixedThreadPool(int),
Executors.newFixedThreadPool(int, java.util.concurrent.ThreadFactory),
Executors.newScheduledThreadPool(int),
Executors.newScheduledThreadPool(int, java.util.concurrent.ThreadFactory),
Executors.newSingleThreadExecutor(),
Executors.newSingleThreadExecutor(java.util.concurrent.ThreadFactory),
Executors.newSingleThreadScheduledExecutor(),
Executors.newSingleThreadScheduledExecutor(java.util.concurrent.ThreadFactory)protected ExecutorService createDefaultExecutorService()
started without an executor service being set.
This method creates a single-threaded executor.
protected void startService()
protected void shutdownService()
protected boolean isServiceTerminated()
protected boolean doAwaitTermination(long timeout,
TimeUnit unit)
throws InterruptedException
InterruptedExceptionpublic SequencingService.Selector getSequencerSelector()
public void setSequencerSelector(SequencingService.Selector sequencerSelector)
default sequencer selector should be used.
sequencerSelector - the selectorpublic SequencingService.NodeFilter getNodeFilter()
public void setNodeFilter(SequencingService.NodeFilter nodeFilter)
default node filter
should be used.
nodeFilter - the new node filterpublic void onNodeChanges(NodeChanges changes)
onNodeChanges in interface NodeChangeListenerprotected void processChangedNode(NodeChange changedNode)
executor service
when it performs it's work on the enqueued NodeChange runnable objects.
changedNode - the node to be processed.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||