Class WorkflowList
- java.lang.Object
-
- java.util.AbstractCollection<Workflow>
-
- com.adaptris.core.WorkflowList
-
- All Implemented Interfaces:
ComponentLifecycle
,ComponentLifecycleExtension
,java.lang.Iterable<Workflow>
,java.util.Collection<Workflow>
,java.util.List<Workflow>
@ComponentProfile(summary="A Collection of Workflows", tag="base") public final class WorkflowList extends java.util.AbstractCollection<Workflow> implements ComponentLifecycle, ComponentLifecycleExtension, java.util.List<Workflow>
Container for a collection of
Workflow
s.In the adapter configuration file this class is aliased as workflow-list which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Constructor Summary
Constructors Constructor Description WorkflowList()
Creates a new instance.WorkflowList(java.util.Collection<Workflow> workflows)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, Workflow element)
boolean
add(Workflow element)
boolean
addAll(int index, java.util.Collection<? extends Workflow> c)
void
addWorkflow(Workflow element)
Add a workflow.void
clear()
void
close()
Closes the component.Workflow
get(int index)
WorkflowLifecycleStrategy
getLifecycleStrategy()
Workflow
getWorkflow(java.lang.String uniqueId)
Get a workflow by its uniqueid.java.util.List<Workflow>
getWorkflows()
Returns aList
ofWorkflow
s.int
indexOf(java.lang.Object o)
void
init()
Initialises the component.java.util.Iterator<Workflow>
iterator()
int
lastIndexOf(java.lang.Object o)
java.util.ListIterator<Workflow>
listIterator()
java.util.ListIterator<Workflow>
listIterator(int index)
void
prepare()
Prepare for initialisation.Workflow
remove(int index)
boolean
remove(java.lang.Object o)
boolean
removeWorkflow(Workflow wf)
Remove a Workflow from this channel list.Workflow
set(int index, Workflow element)
void
setLifecycleStrategy(WorkflowLifecycleStrategy wls)
Specify the strategy to use when handling individual workflow lifecycle.void
setWorkflows(java.util.List<Workflow> l)
Sets aList
ofWorkflow
s.int
size()
void
start()
Starts the component.void
stop()
Stop the componentjava.util.List<Workflow>
subList(int fromIndex, int toIndex)
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toString
-
-
-
-
Constructor Detail
-
WorkflowList
public WorkflowList()
Creates a new instance.
-
WorkflowList
public WorkflowList(java.util.Collection<Workflow> workflows)
-
-
Method Detail
-
init
public void init() throws CoreException
Description copied from interface:ComponentLifecycle
Initialises the component.Component initialisation includes config verification, creation of connections etc.
- Specified by:
init
in interfaceComponentLifecycle
- Throws:
CoreException
- wrapping any underlyingException
s- See Also:
ComponentLifecycle.init()
-
start
public void start() throws CoreException
Description copied from interface:ComponentLifecycle
Starts the component.Once a component is started it should be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling start will begin message delivery.- Specified by:
start
in interfaceComponentLifecycle
- Throws:
CoreException
- wrapping any underlyingException
s- See Also:
ComponentLifecycle.start()
-
stop
public void stop()
Description copied from interface:ComponentLifecycle
Stop the componentA stopped component is not expected to be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling stop will pause message delivery. Throwing aRuntimeException
may cause unintended consequences- Specified by:
stop
in interfaceComponentLifecycle
- See Also:
ComponentLifecycle.stop()
-
close
public void close()
Description copied from interface:ComponentLifecycle
Closes the component.A closed component should release any connections it uses, etc. and clean up completely. Throwing a
RuntimeException
may cause unintended consequences- Specified by:
close
in interfaceComponentLifecycle
- See Also:
ComponentLifecycle.close()
-
prepare
public void prepare() throws CoreException
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Specified by:
prepare
in interfaceComponentLifecycleExtension
- Throws:
CoreException
-
getLifecycleStrategy
public WorkflowLifecycleStrategy getLifecycleStrategy()
-
setLifecycleStrategy
public void setLifecycleStrategy(WorkflowLifecycleStrategy wls)
Specify the strategy to use when handling individual workflow lifecycle.If not explicitly specified, then
DefaultWorkflowLifecycleStrategy
will be used to handle the workflow operations.- Parameters:
wls
- the strategy to set- See Also:
DefaultWorkflowLifecycleStrategy
-
getWorkflows
public java.util.List<Workflow> getWorkflows()
Returns a
List
ofWorkflow
s.- Returns:
- a
List
ofWorkflow
s
-
setWorkflows
public void setWorkflows(java.util.List<Workflow> l)
Sets a
List
ofWorkflow
s.- Parameters:
l
- aList
ofWorkflow
s
-
addWorkflow
public void addWorkflow(Workflow element)
Add a workflow.- Parameters:
element
- the workflow to add- See Also:
add(Workflow)
-
size
public int size()
-
iterator
public java.util.Iterator<Workflow> iterator()
-
remove
public boolean remove(java.lang.Object o)
-
removeWorkflow
public boolean removeWorkflow(Workflow wf)
Remove a Workflow from this channel list.- Parameters:
wf
-- Returns:
- true if the workflow was removed
-
add
public boolean add(Workflow element)
-
add
public void add(int index, Workflow element)
- Specified by:
add
in interfacejava.util.List<Workflow>
-
addAll
public boolean addAll(int index, java.util.Collection<? extends Workflow> c)
- Specified by:
addAll
in interfacejava.util.List<Workflow>
-
getWorkflow
public Workflow getWorkflow(java.lang.String uniqueId)
Get a workflow by its uniqueid.- Parameters:
uniqueId
- the unique id of the workflow- Returns:
- the workflow or null if no match is found.
-
indexOf
public int indexOf(java.lang.Object o)
- Specified by:
indexOf
in interfacejava.util.List<Workflow>
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
- Specified by:
lastIndexOf
in interfacejava.util.List<Workflow>
-
clear
public void clear()
-
listIterator
public java.util.ListIterator<Workflow> listIterator()
- Specified by:
listIterator
in interfacejava.util.List<Workflow>
-
listIterator
public java.util.ListIterator<Workflow> listIterator(int index)
- Specified by:
listIterator
in interfacejava.util.List<Workflow>
-
remove
public Workflow remove(int index)
- Specified by:
remove
in interfacejava.util.List<Workflow>
-
set
public Workflow set(int index, Workflow element)
- Specified by:
set
in interfacejava.util.List<Workflow>
-
-