org.apache.synapse.mediators.ext
Class ClassMediator

java.lang.Object
  extended by org.apache.synapse.mediators.AbstractMediator
      extended by org.apache.synapse.mediators.ext.ClassMediator
All Implemented Interfaces:
AspectConfigurable, ManagedLifecycle, Mediator, SynapseArtifact

public class ClassMediator
extends AbstractMediator
implements ManagedLifecycle

The class mediator delegates the mediation to a single instance of a specified class. The specified class must implement the Mediator interface and optionally may implement the ManagedLifecycle interface. At initialization time, a single instance of the class is instantiated using a public no argument constructor, and any one-time properties (parameter constants specified through the Synapse config) are set on the instance. If each request needs synchronization, the user must implement it within the specified class.

See Also:
Mediator

Field Summary
 
Fields inherited from class org.apache.synapse.mediators.AbstractMediator
log, trace, traceState
 
Constructor Summary
ClassMediator()
           
 
Method Summary
 void addProperty(String name, Object value)
           
 void destroy()
          This method should implement the destroying of the implemented parts of the configuration.
 Mediator getMediator()
           
 Map getProperties()
           
 void init(SynapseEnvironment se)
          This method should implement the initialization of the implemented parts of the configuration.
 boolean mediate(MessageContext synCtx)
          Don't use a new instance...
 void setMediator(Mediator mediator)
           
 
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
 

Constructor Detail

ClassMediator

public ClassMediator()
Method Detail

mediate

public boolean mediate(MessageContext synCtx)
Don't use a new instance... do one instance of the object per instance of this mediator

Specified by:
mediate in interface Mediator
Parameters:
synCtx - the message context
Returns:
as per standard semantics

destroy

public void destroy()
Description copied from interface: ManagedLifecycle
This method should implement the destroying of the implemented parts of the configuration.

Specified by:
destroy in interface ManagedLifecycle

init

public void init(SynapseEnvironment se)
Description copied from interface: ManagedLifecycle
This method should implement the initialization of the implemented parts of the configuration.

Specified by:
init in interface ManagedLifecycle
Parameters:
se - SynapseEnvironment to be used for initialization

setMediator

public void setMediator(Mediator mediator)

getMediator

public Mediator getMediator()

addProperty

public void addProperty(String name,
                        Object value)

getProperties

public Map getProperties()


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