org.apache.synapse.mediators.base
Class SequenceMediator

java.lang.Object
  extended by org.apache.synapse.mediators.AbstractMediator
      extended by org.apache.synapse.mediators.AbstractListMediator
          extended by org.apache.synapse.mediators.base.SequenceMediator
All Implemented Interfaces:
AspectConfigurable, ManagedLifecycle, Mediator, ListMediator, Nameable, SynapseArtifact

public class SequenceMediator
extends AbstractListMediator
implements Nameable

The Sequence mediator either refers to a named Sequence mediator instance or is a *Named* list/sequence of other (child) Mediators

If this instance defines a sequence mediator, then the name is required, and an errorHandler sequence name optional. If this instance refers to another (defined) sequence mediator, the errorHandler will not have a meaning, and if an error in encountered in the referred sequence, its errorHandler would execute.


Field Summary
 
Fields inherited from class org.apache.synapse.mediators.AbstractListMediator
mediators
 
Fields inherited from class org.apache.synapse.mediators.AbstractMediator
log, trace, traceState
 
Constructor Summary
SequenceMediator()
           
 
Method Summary
 void destroy()
          Destroy child mediators recursively
 String getAuditId()
           
 String getErrorHandler()
           
 String getFileName()
           
 Value getKey()
          To get the key which is used to pick the sequence definition from the local registry
 String getName()
          To get the name of the sequence
 String getRegistryKey()
          Return the registry key used to load this sequence dynamically
 void init(SynapseEnvironment se)
          This method will ensure that each and every sequence wil only be initialized atmost once
 boolean isDynamic()
          Is this a dynamic sequence?
 boolean isInitialized()
           
 boolean mediate(MessageContext synCtx)
          If this mediator refers to another named Sequence, execute that.
 void setDynamic(boolean dynamic)
          Mark this as a dynamic sequence
 void setErrorHandler(String errorHandler)
           
 void setFileName(String fileName)
           
 void setKey(Value key)
          To set the local registry key in order to pick the sequence definition
 void setName(String name)
          setting the name of the sequence
 void setRegistryKey(String registryKey)
          To get the registry key used to load this sequence dynamically
 
Methods inherited from class org.apache.synapse.mediators.AbstractListMediator
addAll, addChild, getChild, getList, removeChild, removeChild
 
Methods inherited from class org.apache.synapse.mediators.AbstractMediator
auditLog, auditWarn, configure, disableStatistics, enableStatistics, getAspectConfiguration, getDescription, getLog, getTraceState, getType, handleException, handleException, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, setDescription, setEffectiveTraceState, setTraceState, shouldTrace, traceOrDebug, traceOrDebugWarn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.synapse.Mediator
getTraceState, getType, setTraceState
 
Methods inherited from interface org.apache.synapse.SynapseArtifact
getDescription, setDescription
 

Constructor Detail

SequenceMediator

public SequenceMediator()
Method Detail

mediate

public boolean mediate(MessageContext synCtx)
If this mediator refers to another named Sequence, execute that. Else execute the list of mediators (children) contained within this. If a referenced named sequence mediator instance cannot be found at runtime, an exception is thrown. This may occur due to invalid configuration of an erroneous runtime change of the synapse configuration. It is the responsibility of the SynapseConfiguration builder to ensure that dead references are not present.

Specified by:
mediate in interface Mediator
Overrides:
mediate in class AbstractListMediator
Parameters:
synCtx - the synapse message
Returns:
as per standard mediator result

init

public void init(SynapseEnvironment se)
This method will ensure that each and every sequence wil only be initialized atmost once

Specified by:
init in interface ManagedLifecycle
Overrides:
init in class AbstractListMediator
Parameters:
se - - enviorenment to be initialized

destroy

public void destroy()
Description copied from class: AbstractListMediator
Destroy child mediators recursively

Specified by:
destroy in interface ManagedLifecycle
Overrides:
destroy in class AbstractListMediator

getName

public String getName()
To get the name of the sequence

Specified by:
getName in interface Nameable
Returns:
the name of the sequence

setName

public void setName(String name)
setting the name of the sequence

Specified by:
setName in interface Nameable
Parameters:
name - the name of the this sequence

getKey

public Value getKey()
To get the key which is used to pick the sequence definition from the local registry

Returns:
return the key which is used to pick the sequence definition from the local registry

setKey

public void setKey(Value key)
To set the local registry key in order to pick the sequence definition

Parameters:
key - the local registry key

getErrorHandler

public String getErrorHandler()
Returns:
Returns the errorhandler sequence name

setErrorHandler

public void setErrorHandler(String errorHandler)
Parameters:
errorHandler - to used handle error will appear during the mediation through this sequence

isDynamic

public boolean isDynamic()
Is this a dynamic sequence?

Returns:
true if dynamic

setDynamic

public void setDynamic(boolean dynamic)
Mark this as a dynamic sequence

Parameters:
dynamic - true if this is a dynamic sequence

getRegistryKey

public String getRegistryKey()
Return the registry key used to load this sequence dynamically

Returns:
registry key

setRegistryKey

public void setRegistryKey(String registryKey)
To get the registry key used to load this sequence dynamically

Parameters:
registryKey - returns the registry key which point to this sequence

getAuditId

public String getAuditId()

getFileName

public String getFileName()

setFileName

public void setFileName(String fileName)

isInitialized

public boolean isInitialized()


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.