Package org.apache.synapse.config.xml
Class AbstractMediatorFactory
- java.lang.Object
-
- org.apache.synapse.config.xml.AbstractMediatorFactory
-
- All Implemented Interfaces:
MediatorFactory
- Direct Known Subclasses:
AbstractDBMediatorFactory,AbstractListMediatorFactory,AggregateMediatorFactory,AnnotatedCommandMediatorFactory,BeanMediatorFactory,CallMediatorFactory,CalloutMediatorFactory,ClassMediatorFactory,CloneMediatorFactory,CommentMediatorFactory,ConditionalRouterMediatorFactory,DropMediatorFactory,EJBMediatorFactory,EnqueueMediatorFactory,EnrichMediatorFactory,EventPublisherMediatorFactory,FaultMediatorFactory,ForEachMediatorFactory,HeaderMediatorFactory,InvokeMediatorFactory,IterateMediatorFactory,JSONTransformMediatorFactory,LogMediatorFactory,LoopBackMediatorFactory,MessageStoreMediatorFactory,NTLMMediatorFactory,PayloadFactoryMediatorFactory,POJOCommandMediatorFactory,PropertyGroupMediatorFactory,PropertyMediatorFactory,RespondMediatorFactory,SamplingThrottleMediatorFactory,SendMediatorFactory,SwitchMediatorFactory,TransactionMediatorFactory,URLRewriteMediatorFactory,XSLTMediatorFactory
public abstract class AbstractMediatorFactory extends Object implements MediatorFactory
Parent class for all theMediatorFactoryimplementations
-
-
Field Summary
Fields Modifier and Type Field Description protected static QNameATT_DEFAULT_VALUEprotected static QNameATT_DESCRIPTIONprotected static QNameATT_EVALprotected static QNameATT_EXPRNprotected static QNameATT_IS_MANDATORYprotected static QNameATT_KEYprotected static QNameATT_NAMEprotected static QNameATT_ONERRORprotected static QNameATT_REGEXprotected static QNameATT_SEQUENCEprotected static QNameATT_SOURCEprotected static QNameATT_STATSprotected static QNameATT_TARGETprotected static QNameATT_VALUEprotected static QNameATT_XPATHprotected static QNameDESCRIPTION_Qprotected static QNameFEATURE_Qprotected static QNamePROP_Qprotected static QNamePROPERTY_GROUP_Qprotected static QNameTARGET_Q
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractMediatorFactory()A constructor that makes subclasses pick up the correct logger
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected static voidaddAllCommentChildrenToList(org.apache.axiom.om.OMElement el, List<String> commentList)Find and add all comment nodes to the mediator as a listprotected Map<String,String>collectNameValuePairs(org.apache.axiom.om.OMElement elem, QName childElementName)Collect the name and value attributes from the children with a given QName.MediatorcreateMediator(org.apache.axiom.om.OMElement elem, Properties properties)Creates the mediator by looking at the given XML element.protected abstract MediatorcreateSpecificMediator(org.apache.axiom.om.OMElement elem, Properties properties)Specific mediator factory implementations should implement this method to build theMediatorby the given XML configurationprotected voidhandleException(String message)protected voidhandleException(String message, Exception e)protected voidprocessAuditStatus(Mediator mediator, org.apache.axiom.om.OMElement mediatorOmElement)This is to Initialize the mediator regarding tracing and statistics.protected voidprocessTraceState(Mediator mediator, org.apache.axiom.om.OMElement mediatorOmElement)Deprecated.This method is deprecated.-
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_DESCRIPTION
protected static final QName ATT_DESCRIPTION
-
ATT_IS_MANDATORY
protected static final QName ATT_IS_MANDATORY
-
ATT_DEFAULT_VALUE
protected static final QName ATT_DEFAULT_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_EVAL
protected static final QName ATT_EVAL
-
ATT_STATS
protected static final QName ATT_STATS
-
PROP_Q
protected static final QName PROP_Q
-
PROPERTY_GROUP_Q
protected static final QName PROPERTY_GROUP_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
-
-
Method Detail
-
createMediator
public final Mediator createMediator(org.apache.axiom.om.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 thecreateSpecificMediator(org.apache.axiom.om.OMElement, java.util.Properties)method, which has tobe implemented by the respective mediatorsThis method has been marked as
finalto avoid mistakenly overwriting this method instead of thecreateSpecificMediator(org.apache.axiom.om.OMElement, java.util.Properties)by the sub classes- Specified by:
createMediatorin interfaceMediatorFactory- Parameters:
elem- configuration element of the mediator to be builtproperties- bag of properties to pass in any information to the factory- Returns:
- built mediator using the above element
-
createSpecificMediator
protected abstract Mediator createSpecificMediator(org.apache.axiom.om.OMElement elem, Properties properties)
Specific mediator factory implementations should implement this method to build theMediatorby the given XML configuration- Parameters:
elem- configuration element describing the properties of the mediatorproperties- 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, org.apache.axiom.om.OMElement mediatorOmElement)
Deprecated.This method is deprecated. As of Synapse 1.3, please useprocessAuditStatus(Mediator, OMElement)This is to Initialize the mediator with the default attributes.- Parameters:
mediator- of which trace state has to be setmediatorOmElement- from which the trace state is extracted
-
processAuditStatus
protected void processAuditStatus(Mediator mediator, org.apache.axiom.om.OMElement mediatorOmElement)
This is to Initialize the mediator regarding tracing and statistics.- Parameters:
mediator- of which trace state has to be setmediatorOmElement- from which the trace state is extracted- Since:
- 2.0
-
collectNameValuePairs
protected Map<String,String> collectNameValuePairs(org.apache.axiom.om.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 specifiedchildElementNamechildElementName- t be used to extract elements to collect the name value pairs- Returns:
- collected name value pairs
-
handleException
protected void handleException(String message)
-
addAllCommentChildrenToList
protected static void addAllCommentChildrenToList(org.apache.axiom.om.OMElement el, List<String> commentList)Find and add all comment nodes to the mediator as a list- Parameters:
el- OMElement to extract OMComment NodescommentList- ArrayList to be updated with extracted Comment Strings
-
-