|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.dna.repository.sequencers.StreamSequencerAdapter
public class StreamSequencerAdapter
An adapter class that wraps a StreamSequencer instance to be a Sequencer.
| Constructor Summary | |
|---|---|
StreamSequencerAdapter(org.jboss.dna.graph.sequencers.StreamSequencer streamSequencer)
|
|
| Method Summary | |
|---|---|
void |
execute(javax.jcr.Node input,
String sequencedPropertyName,
NodeChange changes,
Set<RepositoryNodePath> outputPaths,
JcrExecutionContext execContext,
org.jboss.dna.common.monitor.ProgressMonitor progressMonitor)
Execute the sequencing operation on the supplied node, which has recently been created or changed. |
protected String[] |
extractMixinTypes(Object value)
|
SequencerConfig |
getConfiguration()
|
protected boolean |
saveOutput(javax.jcr.Node outputNode,
SequencerOutputMap output,
JcrExecutionContext context)
Save the sequencing output to the supplied node. |
void |
setConfiguration(SequencerConfig configuration)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StreamSequencerAdapter(org.jboss.dna.graph.sequencers.StreamSequencer streamSequencer)
| Method Detail |
|---|
public SequencerConfig getConfiguration()
getConfiguration in interface org.jboss.dna.common.component.Component<SequencerConfig>public void setConfiguration(SequencerConfig configuration)
setConfiguration in interface org.jboss.dna.common.component.Component<SequencerConfig>
public void execute(javax.jcr.Node input,
String sequencedPropertyName,
NodeChange changes,
Set<RepositoryNodePath> outputPaths,
JcrExecutionContext execContext,
org.jboss.dna.common.monitor.ProgressMonitor progressMonitor)
throws javax.jcr.RepositoryException,
SequencerException
getting sessions, modifying the appropriate
nodes, saving any changes made by this sequencer, and closing all sessions
(and any other acquired resources), even in the case of cancellation or exceptions.
The SequencingService determines the sequencers that should be executed by monitoring the changes to one or more
workspaces (it is a NodeChangeListener registered with the ObservationService). Changes in those
workspaces are aggregated for each transaction, and organized into changes for each node. The
SequencingService then determines for each set of changes to a node the set of full paths to the
properties that have changed and whether those paths match the sequencer's
path expressions. Each path expression produces the path to the output node,
and these output paths are accumulated and (with the original node that changed, the node change summary, and other
information) supplied to the sequencer via this method.
It is possible that a sequencer is configured to apply to multiple properties on a node. So, in cases where multiple properties are changed on a single node (within a single repository transaction), the sequencer will only be executed once. Also, in such cases the sequencer's configuration may imply multiple output nodes, so it is left to the sequencer to define the behavior in such cases.
This operation should report progress to the supplied ProgressMonitor. At the beginning of the operation, call
ProgressMonitor.beginTask(double, org.jboss.dna.common.i18n.I18n, Object...) with a meaningful message describing
the operation and a total for the amount of work that will be done by this sequencer. Then perform the sequencing work,
periodically reporting work by specifying the amount of work that has was just
completed or by creating a subtask and reporting work against that subtask
monitor.
The implementation should also periodically check whether the operation has been
cancelled. If this method returns true, the implementation should abort all work as
soon as possible and close any resources that were acquired or opened.
Finally, the implementation should call ProgressMonitor.done() when the operation has finished.
execute in interface Sequencerinput - the node that has recently been created or changed; never nullsequencedPropertyName - the name of the property that caused this sequencer to be executed; never null and never emptychanges - the immutable summary of changes that occurred on the input node within the transaction;
never nulloutputPaths - the paths to the nodes where the sequencing content should be placed; never null and never empty, but
the set may contain paths for non-existant nodes or may reference the input nodeexecContext - the context in which this sequencer is executing; never nullprogressMonitor - the progress monitor that should be kept updated with the sequencer's progress and that should be
frequently consulted as to whether this operation has been cancelled.
javax.jcr.RepositoryException - if there is a problem while working with the repository
SequencerException - if there is an error in this sequencer
protected boolean saveOutput(javax.jcr.Node outputNode,
SequencerOutputMap output,
JcrExecutionContext context)
throws javax.jcr.RepositoryException
outputNode - the existing node onto (or below) which the output is to be written; never nulloutput - the (immutable) sequencing output; never nullcontext - the execution context for this sequencing operation; never null
javax.jcr.RepositoryExceptionprotected String[] extractMixinTypes(Object value)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||