Package org.apache.synapse.api
Class Resource
- java.lang.Object
-
- org.apache.synapse.api.AbstractRequestProcessor
-
- org.apache.synapse.api.Resource
-
- All Implemented Interfaces:
AspectConfigurable
,ManagedLifecycle
public class Resource extends AbstractRequestProcessor implements ManagedLifecycle, AspectConfigurable
-
-
Field Summary
-
Fields inherited from class org.apache.synapse.api.AbstractRequestProcessor
log, name
-
-
Constructor Summary
Constructors Constructor Description Resource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAllBindsTo(Set<String> inboundEndpointBindings)
boolean
addMethod(String method)
void
configure(AspectConfiguration aspectConfiguration)
Configure aspects according to the given configurationvoid
destroy()
This method should implement the destroying of the implemented parts of the configuration.AspectConfiguration
getAspectConfiguration()
Get the aspects configurationSet<String>
getBindsTo()
String
getContentType()
DispatcherHelper
getDispatcherHelper()
SequenceMediator
getFaultSequence()
String
getFaultSequenceKey()
SequenceMediator
getInSequence()
String
getInSequenceKey()
String[]
getMethods()
String
getName()
SequenceMediator
getOutSequence()
String
getOutSequenceKey()
int
getProtocol()
String
getResourceClassName()
Returns the name of the class of Resource.String
getUserAgent()
boolean
hasMatchingMethod(String method)
Helper method to check whether API supports the incoming HTTP method.void
init(SynapseEnvironment se)
This method should implement the initialization of the implemented parts of the configuration.void
registerFaultHandler(MessageContext synCtx)
void
setComponentStatisticsId(ArtifactHolder holder)
void
setContentType(String contentType)
void
setDispatcherHelper(DispatcherHelper dispatcherHelper)
void
setFaultSequence(SequenceMediator faultSequence)
void
setFaultSequenceKey(String faultSequenceKey)
void
setInSequence(SequenceMediator inSequence)
void
setInSequenceKey(String inSequenceKey)
void
setOutSequence(SequenceMediator outSequence)
void
setOutSequenceKey(String outSequenceKey)
void
setProtocol(int protocol)
void
setUserAgent(String userAgent)
-
Methods inherited from class org.apache.synapse.api.AbstractRequestProcessor
handleException, handleException
-
-
-
-
Method Detail
-
getName
public String getName()
-
getInSequence
public SequenceMediator getInSequence()
-
setInSequence
public void setInSequence(SequenceMediator inSequence)
-
getOutSequence
public SequenceMediator getOutSequence()
-
setOutSequence
public void setOutSequence(SequenceMediator outSequence)
-
getInSequenceKey
public String getInSequenceKey()
-
setInSequenceKey
public void setInSequenceKey(String inSequenceKey)
-
getOutSequenceKey
public String getOutSequenceKey()
-
setOutSequenceKey
public void setOutSequenceKey(String outSequenceKey)
-
getFaultSequence
public SequenceMediator getFaultSequence()
-
setFaultSequence
public void setFaultSequence(SequenceMediator faultSequence)
-
getFaultSequenceKey
public String getFaultSequenceKey()
-
setFaultSequenceKey
public void setFaultSequenceKey(String faultSequenceKey)
-
addMethod
public boolean addMethod(String method)
-
getMethods
public String[] getMethods()
-
hasMatchingMethod
public boolean hasMatchingMethod(String method)
Helper method to check whether API supports the incoming HTTP method.- Parameters:
method
-- Returns:
- true if support false otherwise.
-
getDispatcherHelper
public DispatcherHelper getDispatcherHelper()
-
setDispatcherHelper
public void setDispatcherHelper(DispatcherHelper dispatcherHelper)
-
getContentType
public String getContentType()
-
setContentType
public void setContentType(String contentType)
-
getUserAgent
public String getUserAgent()
-
setUserAgent
public void setUserAgent(String userAgent)
-
getProtocol
public int getProtocol()
-
setProtocol
public void setProtocol(int protocol)
-
registerFaultHandler
public void registerFaultHandler(MessageContext synCtx)
-
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 interfaceManagedLifecycle
- Parameters:
se
- SynapseEnvironment to be used for initialization
-
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 interfaceManagedLifecycle
-
configure
public void configure(AspectConfiguration aspectConfiguration)
Description copied from interface:AspectConfigurable
Configure aspects according to the given configuration- Specified by:
configure
in interfaceAspectConfigurable
- Parameters:
aspectConfiguration
- AspectConfiguration instance
-
getAspectConfiguration
public AspectConfiguration getAspectConfiguration()
Description copied from interface:AspectConfigurable
Get the aspects configuration- Specified by:
getAspectConfiguration
in interfaceAspectConfigurable
- Returns:
- AspectConfiguration instance
-
setComponentStatisticsId
public void setComponentStatisticsId(ArtifactHolder holder)
-
getResourceClassName
public String getResourceClassName()
Returns the name of the class of Resource.- Returns:
- Resource class name.
-
-