org.orbeon.oxf.pipeline.api
Class PipelineContext

java.lang.Object
  extended by org.orbeon.oxf.pipeline.api.PipelineContext

public class PipelineContext
extends Object

PipelineContext represents a context object passed to all the processors running in a given pipeline session.


Nested Class Summary
static interface PipelineContext.ContextListener
          ContextListener interface to listen on PipelineContext events.
static class PipelineContext.ContextListenerAdapter
          ContextListener adapter class to facilitate implementations of the ContextListener interface.
static interface PipelineContext.Trace
           
 
Field Summary
static String EXTERNAL_CONTEXT
          Key name for the EXTERNAL_CONTEXT attribute of type ExternalContext.
 
Constructor Summary
PipelineContext()
          Create a new pipeline context.
 
Method Summary
 void addContextListener(PipelineContext.ContextListener listener)
          Add a new listener to the context.
 void destroy(boolean success)
          Destroy the pipeline context.
 Object getAttribute(Object key)
          Get an attribute in the context.
 PipelineContext.Trace getTraceForUpdate()
          Return the trace for update if available.
 boolean isDestroyed()
          Check whether this context has been destroyed.
 void setAttribute(Object key, Object o)
          Set an attribute in the context.
 boolean startTrace(String propertyName)
          Start a trace using the class from the given global property name if present.
 void stopTrace()
          Stop the trace for the remaining duration of this context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXTERNAL_CONTEXT

public static final String EXTERNAL_CONTEXT
Key name for the EXTERNAL_CONTEXT attribute of type ExternalContext.

See Also:
Constant Field Values
Constructor Detail

PipelineContext

public PipelineContext()
Create a new pipeline context.

Method Detail

startTrace

public boolean startTrace(String propertyName)
Start a trace using the class from the given global property name if present.

Parameters:
propertyName - property name containing a class name
Returns:
true iif new trace was started

stopTrace

public void stopTrace()
Stop the trace for the remaining duration of this context.


getTraceForUpdate

public PipelineContext.Trace getTraceForUpdate()
Return the trace for update if available.

Returns:
trace

setAttribute

public void setAttribute(Object key,
                         Object o)
Set an attribute in the context.

Parameters:
key - the attribute key
o - the attribute value to associate with the key

getAttribute

public Object getAttribute(Object key)
Get an attribute in the context.

Parameters:
key - the attribute key
Returns:
the attribute value, null if there is no attribute with the given key

addContextListener

public void addContextListener(PipelineContext.ContextListener listener)
Add a new listener to the context.

Parameters:
listener - listener to add

destroy

public void destroy(boolean success)
Destroy the pipeline context. This method must be called on the context whether the pipeline terminated successfully or not.

Parameters:
success - true if the pipeline executed without exceptions, false otherwise

isDestroyed

public boolean isDestroyed()
Check whether this context has been destroyed.

Returns:
true if the context has been destroyed, false otherwise