org.eclipse.emf.mwe.core.container
Class CompositeComponent

java.lang.Object
  extended by org.eclipse.emf.mwe.core.container.CompositeComponent
All Implemented Interfaces:
WorkflowComponent, WorkflowComponentWithID, IWorkflowComponent
Direct Known Subclasses:
ConditionalComponent, Workflow

public class CompositeComponent
extends java.lang.Object
implements WorkflowComponentWithID, IWorkflowComponent

A composite WorkflowComponent.


Field Summary
protected  java.util.List<WorkflowComponent> components
          All components aggregated by this composite
protected static org.apache.commons.logging.Log log
           
 
Constructor Summary
CompositeComponent(java.lang.String name)
           
 
Method Summary
 void addBean(java.lang.Object obj)
          Adds a bean.
 void addCartridge(Workflow cartridge)
          Sets the aggregated components of this composite.
 void addComponent(WorkflowComponent component)
          Sets the aggregated components of this composite.
 void addFeature(FeatureComponent comp)
          adds a feature components to the list of components
 void addIf(IfComponent comp)
          adds a conditionalcompositecomponent to the list of components
 void checkConfiguration(Issues issues)
          Called by the container after configuration so the component can validate the configuration before invocation.
protected  Mwe2Bridge getBridge()
           
 java.lang.String getComponentName()
          Returns the name of the component.
 java.util.List<WorkflowComponent> getComponents()
          Returns a list of aggregated components.
 CompositeComponent getContainer()
          Returns the containing component if there is one.
 java.lang.String getId()
          Returns the ID of the component.
 Location getLocation()
          Returns the location of the entry in the parent workflow file.
 java.lang.String getLogMessage()
          Returns the log message,
 java.lang.String getName()
          Returns the name of the component.
 Location getOwnLocation()
          Returns the location of the start and closing tags in the actual workflow file.
 java.lang.String getResource()
          Returns the filename of the workflow.
 void invoke(IWorkflowContext ctx)
           
 void invoke(WorkflowContext ctx, ProgressMonitor monitor, Issues issues)
          Dispatches the invocation to all aggregated components.
 void postInvoke()
           
 void preInvoke()
           
 void put(java.lang.String name, WorkflowComponent comp)
          Adds a workflow component.
 void setContainer(CompositeComponent container)
          Sets the containing component.
 void setId(java.lang.String id)
          Sets the ID of the workflow component.
 void setLocation(Location location)
          Sets the location in the source file that invokes the current component.
 void setOwnLocation(Location endLocation)
          Sets the location of the start and closing tags in the actual workflow file.
 void setResource(java.lang.String resource)
          Sets the filename of the workflow.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log

components

protected java.util.List<WorkflowComponent> components
All components aggregated by this composite

Constructor Detail

CompositeComponent

public CompositeComponent(java.lang.String name)
Method Detail

getComponents

public java.util.List<WorkflowComponent> getComponents()
Returns a list of aggregated components.

Returns:
list of components

getId

public java.lang.String getId()
Description copied from interface: WorkflowComponentWithID
Returns the ID of the component.

Specified by:
getId in interface WorkflowComponentWithID
Returns:
the component ID

setId

public void setId(java.lang.String id)
Description copied from interface: WorkflowComponentWithID
Sets the ID of the workflow component.

Specified by:
setId in interface WorkflowComponentWithID
Parameters:
id - the ID

getLogMessage

public java.lang.String getLogMessage()
Description copied from interface: WorkflowComponentWithID
Returns the log message,

Specified by:
getLogMessage in interface WorkflowComponentWithID
Returns:
the log message

invoke

public void invoke(WorkflowContext ctx,
                   ProgressMonitor monitor,
                   Issues issues)
Dispatches the invocation to all aggregated components.

Specified by:
invoke in interface WorkflowComponent
Parameters:
ctx - current workflow context
monitor - implementors should provide some feedback about the progress using this monitor

checkConfiguration

public void checkConfiguration(Issues issues)
                        throws ConfigurationException
Description copied from interface: WorkflowComponent
Called by the container after configuration so the component can validate the configuration before invocation.

Specified by:
checkConfiguration in interface WorkflowComponent
Parameters:
issues - implementors should report configuration issues to this.
Throws:
ConfigurationException

getName

public java.lang.String getName()
Returns the name of the component.

Returns:
name of component

getResource

public java.lang.String getResource()
Returns the filename of the workflow.

Returns:
the filename

setResource

public void setResource(java.lang.String resource)
Sets the filename of the workflow.

Parameters:
resource - the filename

getLocation

public Location getLocation()
Returns the location of the entry in the parent workflow file.

Specified by:
getLocation in interface WorkflowComponent
Returns:
the location
See Also:
WorkflowComponent.getLocation()

setLocation

public void setLocation(Location location)
Description copied from interface: WorkflowComponent
Sets the location in the source file that invokes the current component.

Specified by:
setLocation in interface WorkflowComponent
Parameters:
location - the location

getOwnLocation

public Location getOwnLocation()
Returns the location of the start and closing tags in the actual workflow file.

Returns:
the location

setOwnLocation

public void setOwnLocation(Location endLocation)
Sets the location of the start and closing tags in the actual workflow file.

Parameters:
endLocation - the location

addBean

public void addBean(java.lang.Object obj)
Adds a bean.

Parameters:
obj - the bean

addComponent

public void addComponent(WorkflowComponent component)
Sets the aggregated components of this composite.

Parameters:
components - Components to aggregate.

addCartridge

public void addCartridge(Workflow cartridge)
Sets the aggregated components of this composite.

Parameters:
components - Components to aggregate.

addIf

public void addIf(IfComponent comp)
adds a conditionalcompositecomponent to the list of components

Parameters:
comp - the conditional component

addFeature

public void addFeature(FeatureComponent comp)
adds a feature components to the list of components

Parameters:
comp - the feature component

getContainer

public CompositeComponent getContainer()
Description copied from interface: WorkflowComponent
Returns the containing component if there is one.

Specified by:
getContainer in interface WorkflowComponent
Returns:
the containing component
See Also:
WorkflowComponent.getContainer()

setContainer

public void setContainer(CompositeComponent container)
Description copied from interface: WorkflowComponent
Sets the containing component.

Specified by:
setContainer in interface WorkflowComponent
Parameters:
container - the containing component
See Also:
WorkflowComponent.setContainer(org.eclipse.emf.mwe.core.container.CompositeComponent)

put

public void put(java.lang.String name,
                WorkflowComponent comp)
Adds a workflow component.

Parameters:
comp - the component

getComponentName

public java.lang.String getComponentName()
Description copied from interface: WorkflowComponent
Returns the name of the component.

Specified by:
getComponentName in interface WorkflowComponent
Returns:
the component name
See Also:
WorkflowComponent.getComponentName()

getBridge

protected Mwe2Bridge getBridge()

preInvoke

public void preInvoke()
Specified by:
preInvoke in interface IWorkflowComponent

invoke

public void invoke(IWorkflowContext ctx)
Specified by:
invoke in interface IWorkflowComponent

postInvoke

public void postInvoke()
Specified by:
postInvoke in interface IWorkflowComponent