org.apache.synapse.config.xml
Class AbstractMediatorFactory

java.lang.Object
  extended by org.apache.synapse.config.xml.AbstractMediatorFactory
All Implemented Interfaces:
MediatorFactory
Direct Known Subclasses:
AbstractDBMediatorFactory, AbstractListMediatorFactory, AggregateMediatorFactory, AnnotatedCommandMediatorFactory, CacheMediatorFactory, CalloutMediatorFactory, ClassMediatorFactory, CloneMediatorFactory, ConditionalRouterMediatorFactory, DetachMediatorFactory, DropMediatorFactory, EnqueueMediatorFactory, EnrichMediatorFactory, EventPublisherMediatorFactory, FaultMediatorFactory, HeaderMediatorFactory, InvokeMediatorFactory, IterateMediatorFactory, LogMediatorFactory, MessageStoreMediatorFactory, PayloadFactoryMediatorFactory, POJOCommandMediatorFactory, PropertyMediatorFactory, ReplaceMediatorFactory, RMSequenceMediatorFactory, SamplingThrottleMediatorFactory, ScriptMediatorFactory, SEDAMediatorFactory, SendMediatorFactory, SpringMediatorFactory, SwitchMediatorFactory, ThrottleMediatorFactory, TransactionMediatorFactory, URLRewriteMediatorFactory, XQueryMediatorFactory, XSLTMediatorFactory

public abstract class AbstractMediatorFactory
extends Object
implements MediatorFactory

Parent class for all the MediatorFactory implementations


Field Summary
protected static QName ATT_EXPRN
           
protected static QName ATT_KEY
           
protected static QName ATT_NAME
           
protected static QName ATT_ONERROR
           
protected static QName ATT_REGEX
           
protected static QName ATT_SEQUENCE
           
protected static QName ATT_SOURCE
           
protected static QName ATT_STATS
           
protected static QName ATT_TARGET
           
protected static QName ATT_VALUE
           
protected static QName ATT_XPATH
           
protected static QName DESCRIPTION_Q
           
protected static QName FEATURE_Q
           
protected static QName PROP_Q
           
protected static QName TARGET_Q
           
 
Constructor Summary
protected AbstractMediatorFactory()
          A constructor that makes subclasses pick up the correct logger
 
Method Summary
protected  Map<String,String> collectNameValuePairs(OMElement elem, QName childElementName)
          Collect the name and value attributes from the children with a given QName.
 Mediator createMediator(OMElement elem, Properties properties)
          Creates the mediator by looking at the given XML element.
protected abstract  Mediator createSpecificMediator(OMElement elem, Properties properties)
          Specific mediator factory implementations should implement this method to build the Mediator by the given XML configuration
protected  void handleException(String message)
           
protected  void handleException(String message, Exception e)
           
protected  void processAuditStatus(Mediator mediator, OMElement mediatorOmElement)
          This is to Initialize the mediator regarding tracing and statistics.
protected  void processTraceState(Mediator mediator, OMElement mediatorOmElement)
          Deprecated. This method is deprecated. As of Synapse 1.3, please use processAuditStatus(Mediator, OMElement)
 
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.config.xml.MediatorFactory
getTagQName
 

Field Detail

ATT_NAME

protected static final QName ATT_NAME

ATT_VALUE

protected static final QName ATT_VALUE

ATT_XPATH

protected static final QName ATT_XPATH

ATT_REGEX

protected static final QName ATT_REGEX

ATT_SEQUENCE

protected static final QName ATT_SEQUENCE

ATT_EXPRN

protected static final QName ATT_EXPRN

ATT_KEY

protected static final QName ATT_KEY

ATT_SOURCE

protected static final QName ATT_SOURCE

ATT_TARGET

protected static final QName ATT_TARGET

ATT_ONERROR

protected static final QName ATT_ONERROR

ATT_STATS

protected static final QName ATT_STATS

PROP_Q

protected static final QName PROP_Q

FEATURE_Q

protected static final QName FEATURE_Q

TARGET_Q

protected static final QName TARGET_Q

DESCRIPTION_Q

protected static final QName DESCRIPTION_Q
Constructor Detail

AbstractMediatorFactory

protected AbstractMediatorFactory()
A constructor that makes subclasses pick up the correct logger

Method Detail

createMediator

public final Mediator createMediator(OMElement elem,
                                     Properties properties)
Creates the mediator by looking at the given XML element. This method handles extracting the common information from the respective element. It delegates the mediator specific building to the createSpecificMediator(org.apache.axiom.om.OMElement, java.util.Properties) method, which has tobe implemented by the respective mediators

This method has been marked as final to avoid mistakenly overwriting this method instead of the createSpecificMediator(org.apache.axiom.om.OMElement, java.util.Properties) by the sub classes

Specified by:
createMediator in interface MediatorFactory
Parameters:
elem - configuration element of the mediator to be built
properties - bag of properties to pass in any information to the factory
Returns:
built mediator using the above element

createSpecificMediator

protected abstract Mediator createSpecificMediator(OMElement elem,
                                                   Properties properties)
Specific mediator factory implementations should implement this method to build the Mediator by the given XML configuration

Parameters:
elem - configuration element describing the properties of the mediator
properties - bag of properties to pass in any information to the factory
Returns:
built mediator of that specific type

processTraceState

@Deprecated
protected void processTraceState(Mediator mediator,
                                            OMElement mediatorOmElement)
Deprecated. This method is deprecated. As of Synapse 1.3, please use processAuditStatus(Mediator, OMElement)

This is to Initialize the mediator with the default attributes.

Parameters:
mediator - of which trace state has to be set
mediatorOmElement - from which the trace state is extracted

processAuditStatus

protected void processAuditStatus(Mediator mediator,
                                  OMElement mediatorOmElement)
This is to Initialize the mediator regarding tracing and statistics.

Parameters:
mediator - of which trace state has to be set
mediatorOmElement - from which the trace state is extracted
Since:
2.0

collectNameValuePairs

protected Map<String,String> collectNameValuePairs(OMElement elem,
                                                   QName childElementName)
Collect the name and value attributes from the children with a given QName.

Parameters:
elem - element to be traversed to find the specified childElementName
childElementName - t be used to extract elements to collect the name value pairs
Returns:
collected name value pairs

handleException

protected void handleException(String message,
                               Exception e)

handleException

protected void handleException(String message)


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