|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.jcr.api.sequencer.Sequencer
org.modeshape.sequencer.teiid.model.ModelSequencer
public class ModelSequencer
A sequencer of Teiid XMI model files.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.modeshape.jcr.api.sequencer.Sequencer |
---|
Sequencer.Context |
Constructor Summary | |
---|---|
ModelSequencer()
Constructs a sequencer and an internal reference resolver. |
|
ModelSequencer(ReferenceResolver resolver)
|
Method Summary | |
---|---|
boolean |
execute(Property inputProperty,
Node outputNode,
Sequencer.Context context)
Execute the sequencing operation on the specified property, which has recently been created or changed. |
boolean |
hasModelFileExtension(String resourceName)
|
void |
initialize(NamespaceRegistry registry,
NodeTypeManager nodeTypeManager)
Initialize the sequencer. |
boolean |
sequenceVdbModel(InputStream modelStream,
Node modelOutputNode,
VdbModel vdbModel,
Sequencer.Context context)
Used only by the VDB sequencer to sequence a model file contained in a VDB. |
static boolean |
shouldSequence(org.modeshape.sequencer.teiid.model.ModelReader modelReader)
|
Methods inherited from class org.modeshape.jcr.api.sequencer.Sequencer |
---|
getAcceptedMimeTypes, getLogger, getName, getPathExpressions, getRepositoryName, getUniqueId, hasAcceptedMimeTypes, isAccepted, registerDefaultMimeTypes, registerNamespace, registerNodeTypes, registerNodeTypes, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ModelSequencer()
public ModelSequencer(ReferenceResolver resolver)
resolver
- the reference resolver to use during sequencing (cannot be null
)Method Detail |
---|
public static boolean shouldSequence(org.modeshape.sequencer.teiid.model.ModelReader modelReader)
modelReader
- the reader who processed the model file (cannot be null
)
true
if the model process by the reader should be sequencedpublic boolean execute(Property inputProperty, Node outputNode, Sequencer.Context context) throws Exception
Sequencer
Each 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 Sequencer
inputProperty
- 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 null
Exception
- 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 boolean hasModelFileExtension(String resourceName)
resourceName
- the name of the resource being checked (cannot be null
)
true
if the resource has a model file extensionpublic 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 Sequencer
registry
- 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 null
RepositoryException
- if operations on the NamespaceRegistry
or NodeTypeManager
fail
IOException
- if any stream based operations fail (like importing cnd files)Sequencer.initialize(javax.jcr.NamespaceRegistry,
org.modeshape.jcr.api.nodetype.NodeTypeManager)
public boolean sequenceVdbModel(InputStream modelStream, Node modelOutputNode, VdbModel vdbModel, Sequencer.Context context) throws Exception
modelStream
- the input stream of the model file (cannot be null
)modelOutputNode
- the root node of the model being sequenced (cannot be null
)vdbModel
- the VDB model associated with the input stream (cannot be null
)context
- the sequencer context (cannot be null
)
true
if the model file input stream was successfully sequenced
Exception
- if there is a problem during sequencing or node does not have a VDB model primary type
|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |