uk.org.ogsadai.engine.controlflow
Class CompositeRequestComponent

java.lang.Object
  |
  +--uk.org.ogsadai.engine.controlflow.CompositeRequestComponent
All Implemented Interfaces:
RequestComponent
Direct Known Subclasses:
FlowRequestComponent, SequenceRequestComponent

public abstract class CompositeRequestComponent
extends java.lang.Object
implements RequestComponent

A CompositeRequestComponent is a RequestComponent that may contain child components. The iterator method is defined to provide access to these children for a concrete implementation.

Author:
The OGSA-DAI Project Team

Constructor Summary
CompositeRequestComponent()
           
 
Method Summary
 void add(RequestComponent child)
          Adds a child to a composite component.
 java.util.List children()
          Returns a non-mutable list of the children of this RequestComponent.
 boolean generatesResultData()
          Indicates whether or not this component will generate any result data.
 void initialise(EngineConfiguration config, RequestContext context, ResponseBuilder responseBuilder)
          Initialises the component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.org.ogsadai.engine.controlflow.RequestComponent
process, terminate
 

Constructor Detail

CompositeRequestComponent

public CompositeRequestComponent()
Method Detail

add

public void add(RequestComponent child)
Description copied from interface: RequestComponent
Adds a child to a composite component. Note that an empty implementation of this method should be provided for any leaf components.

Specified by:
add in interface RequestComponent
Parameters:
child - the child RequestComponent

children

public java.util.List children()
Description copied from interface: RequestComponent
Returns a non-mutable list of the children of this RequestComponent. If this component is a leaf and not a composite then java.util.Collections.EMPTY_LIST should be returned.

Specified by:
children in interface RequestComponent
Returns:
a java.util.List containing any children

initialise

public void initialise(EngineConfiguration config,
                       RequestContext context,
                       ResponseBuilder responseBuilder)
                throws RequestSystemException,
                       RequestUserException
Description copied from interface: RequestComponent
Initialises the component. After this method has been returned the generatesResultData method must operational.

Specified by:
initialise in interface RequestComponent
Parameters:
config - the configuration object for the engine that will process this request component
context - the context for the request
responseBuilder - the response builder for assembling the response document
Throws:
RequestUserException - if there is a user problem during initialisation.
RequestSystemException - if there is a system problem during initialisation.

generatesResultData

public boolean generatesResultData()
Description copied from interface: RequestComponent
Indicates whether or not this component will generate any result data. This can only be invoked after the initialise method has returned. This method is used by the Engine to determine whether to process a request synchronously or asynchronously.

Specified by:
generatesResultData in interface RequestComponent
Returns:
true if so, false otherwise