org.jboss.dna.graph.xml
Class XmlSequencer

java.lang.Object
  extended by org.jboss.dna.graph.xml.XmlSequencer
All Implemented Interfaces:
StreamSequencer

public class XmlSequencer
extends Object
implements StreamSequencer

Author:
John Verhaeg

Constructor Summary
XmlSequencer()
           
 
Method Summary
 void sequence(InputStream stream, SequencerOutput output, SequencerContext context, ProgressMonitor monitor)
          Sequence the data found in the supplied stream, placing the output information into the supplied map.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlSequencer

public XmlSequencer()
Method Detail

sequence

public void sequence(InputStream stream,
                     SequencerOutput output,
                     SequencerContext context,
                     ProgressMonitor monitor)
Sequence the data found in the supplied stream, placing the output information into the supplied map.

JBoss DNA's SequencingService determines the sequencers that should be executed by monitoring the changes to one or more workspaces that it is monitoring. Changes in those workspaces are aggregated and used to determine which sequencers should be called. If the sequencer implements this interface, then this method is called with the property that is to be sequenced along with the interface used to register the output. The framework takes care of all the rest.

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.

Specified by:
sequence in interface StreamSequencer
Parameters:
stream - the stream with the data to be sequenced; never null
output - the output from the sequencing operation; never null
context - the context for the sequencing operation; never null
monitor - 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.
See Also:
StreamSequencer.sequence(InputStream, SequencerOutput, SequencerContext, ProgressMonitor)


Copyright © 2008-Present JBoss a division of Red Hat. All Rights Reserved.