public class VdbSequencer extends Sequencer
Sequencer.Context| Constructor and Description |
|---|
VdbSequencer() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
execute(Property inputProperty,
Node outputNode,
Sequencer.Context context)
Execute the sequencing operation on the specified property, which has recently been created or changed.
|
static String |
extractVersionInfomation(String fileNameWithoutExtension,
AtomicInteger version)
Utility method to extract the version information from a VDB filename.
|
void |
initialize(NamespaceRegistry registry,
NodeTypeManager nodeTypeManager)
Initialize the sequencer.
|
getAcceptedMimeTypes, getLogger, getName, getPathExpressions, getRepositoryName, getUniqueId, hasAcceptedMimeTypes, isAccepted, registerDefaultMimeTypes, registerNamespace, registerNodeTypes, registerNodeTypes, toStringpublic static String extractVersionInfomation(String fileNameWithoutExtension, AtomicInteger version)
fileNameWithoutExtension - the filename for the VDB, without its extension; may not be nullversion - the reference to the AtomicInteger that will be modified to contain the versionpublic boolean execute(Property inputProperty, Node outputNode, Sequencer.Context context) throws Exception
SequencerEach sequencer is expected to process the value of the property, extract information from the value, and write a structured representation (in the form of a node or a subgraph of nodes) using the supplied output node. Note that the output node will either be:
Node.setPrimaryType(String))The implementation is expected to always clean up all resources that it acquired, even in the case of exceptions.
Note: This method must be threadsafe: ModeShape will likely invoke this method concurrently in separate threads,
and the method should never modify the state or fields of the Sequencer implementation class. All initialization should be
performed in Sequencer.initialize(NamespaceRegistry, NodeTypeManager).
execute in class SequencerinputProperty - the property that was changed and that should be used as the input; never nulloutputNode - the node that represents the output for the derived information; never null, and will either be
new if the output is being placed outside of the selected node, or will not be new when the
output is to be placed on the selected input nodecontext - the context in which this sequencer is executing, and which may contain additional parameters useful when
generating the output structure; never nullException - if there was a problem with the sequencer that could not be handled. All exceptions will be logged
automatically as errors by ModeShape.Sequencer.execute(javax.jcr.Property, javax.jcr.Node,
org.modeshape.jcr.api.sequencer.Sequencer.Context)public void initialize(NamespaceRegistry registry, NodeTypeManager nodeTypeManager) throws RepositoryException, IOException
Sequencer
By default this method does nothing, so it should be overridden by implementations to do a one-time initialization of any
internal components. For example, sequencers can use the supplied registry and nodeTypeManager
objects to register custom namesapces and node types required by the generated content.
initialize in class Sequencerregistry - the namespace registry that can be used to register custom namespaces; never nullnodeTypeManager - the node type manager that can be used to register custom node types; never nullIOExceptionRepositoryException - if operations on the NamespaceRegistry or NodeTypeManager failSequencer.initialize(javax.jcr.NamespaceRegistry,
org.modeshape.jcr.api.nodetype.NodeTypeManager)Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.