public class CacheMediator
extends org.apache.synapse.mediators.AbstractMediator
implements org.apache.synapse.ManagedLifecycle, org.apache.synapse.debug.constructs.EnclosedInlinedSequence
Mediator
Constructor and Description |
---|
CacheMediator() |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
void |
exposeData(org.apache.synapse.MessageContext msgCtx)
Exposes the whole mediator cache through jmx MBean
|
DigestGenerator |
getDigestGenerator()
This method gives the DigestGenerator to evaluate the hash values of incoming messages.
|
int |
getDiskCacheSize()
This method gives the size of the messages to be cached in disk.
|
String |
getId()
This methods gives the ID of the cache configuration.
|
org.apache.synapse.Mediator |
getInlineSequence(org.apache.synapse.config.SynapseConfiguration synCfg,
int inlinedSeqIdentifier) |
int |
getInMemoryCacheSize()
This method gives the size of the messages to be cached in memory.
|
int |
getMaxMessageSize()
This method gives the maximum size of the messages to be cached in bytes.
|
static javax.cache.Cache<String,CachableResponse> |
getMediatorCache()
Creates default cache to keep mediator cache
|
String |
getOnCacheHitRef()
This method gives reference to the onCacheHit sequence to be executed.
|
org.apache.synapse.mediators.base.SequenceMediator |
getOnCacheHitSequence()
This method gives SequenceMediator to be executed.
|
String |
getScope()
This method gives the scope of the cache.
|
long |
getTimeout()
This method gives the timeout period in milliseconds.
|
void |
init(org.apache.synapse.core.SynapseEnvironment se) |
boolean |
isCollector()
This method gives whether the mediator should be in the incoming path or in the outgoing path as a boolean.
|
boolean |
isContentAware() |
boolean |
mediate(org.apache.synapse.MessageContext synCtx) |
void |
setCollector(boolean collector)
This method sets whether the mediator should be in the incoming path or in the outgoing path as a boolean.
|
void |
setDigestGenerator(DigestGenerator digestGenerator)
This method sets the DigestGenerator to evaluate the hash values of incoming messages.
|
void |
setDiskCacheSize(int diskCacheSize)
This method sets the size of the messages to be cached in disk.
|
void |
setId(String id)
This methods sets the ID of the cache configuration.
|
void |
setInMemoryCacheSize(int inMemoryCacheSize)
This method sets the size of the messages to be cached in memory.
|
void |
setMaxMessageSize(int maxMessageSize)
This method sets the maximum size of the messages to be cached in bytes.
|
void |
setOnCacheHitRef(String onCacheHitRef)
This method sets reference to the onCacheHit sequence to be executed.
|
void |
setOnCacheHitSequence(org.apache.synapse.mediators.base.SequenceMediator onCacheHitSequence)
This method sets SequenceMediator to be executed.
|
void |
setScope(String scope)
This method sets the scope of the cache.
|
void |
setTimeout(long timeout)
This method sets the timeout period as milliseconds.
|
auditLog, auditWarn, configure, disableStatistics, disableTracing, divertMediationRoute, enableStatistics, enableTracing, getAspectConfiguration, getCommentsList, getDescription, getInputType, getLastSequenceFaultHandler, getLog, getMediatorName, getMediatorPosition, getOutputType, getRegisteredMediationFlowPoint, getShortDescription, getTraceState, getType, handleException, handleException, isBreakPoint, isContentAltering, isSkipEnabled, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, isTracingEnabled, registerMediationFlowPoint, reportCloseStatistics, reportOpenStatistics, setBreakPoint, setCommentsList, setComponentStatisticsId, setDescription, setEffectiveTraceState, setMediatorPosition, setShortDescription, setSkipEnabled, setTraceState, shouldCaptureTracing, shouldTrace, shouldTrace, traceOrDebug, traceOrDebugWarn, unregisterMediationFlowPoint
public void init(org.apache.synapse.core.SynapseEnvironment se)
init
in interface org.apache.synapse.ManagedLifecycle
public void destroy()
destroy
in interface org.apache.synapse.ManagedLifecycle
public boolean isContentAware()
isContentAware
in interface org.apache.synapse.Mediator
isContentAware
in class org.apache.synapse.mediators.AbstractMediator
public boolean mediate(org.apache.synapse.MessageContext synCtx)
mediate
in interface org.apache.synapse.Mediator
public void exposeData(org.apache.synapse.MessageContext msgCtx)
msgCtx
- cache response msgCtxpublic static javax.cache.Cache<String,CachableResponse> getMediatorCache()
public String getId()
public void setId(String id)
id
- cache configuration ID to be set.public String getScope()
public void setScope(String scope)
scope
- cache scope to be set.public boolean isCollector()
public void setCollector(boolean collector)
collector
- boolean value to be set as collector.public DigestGenerator getDigestGenerator()
public void setDigestGenerator(DigestGenerator digestGenerator)
digestGenerator
- DigestGenerator to be set to evaluate hash values.public int getInMemoryCacheSize()
public void setInMemoryCacheSize(int inMemoryCacheSize)
inMemoryCacheSize
- value(number of bytes) to be set as memory cache size.public int getDiskCacheSize()
public void setDiskCacheSize(int diskCacheSize)
diskCacheSize
- value(number of bytes) to be set as disk cache size.public long getTimeout()
public void setTimeout(long timeout)
timeout
- millisecond timeout period to be set.public org.apache.synapse.mediators.base.SequenceMediator getOnCacheHitSequence()
public void setOnCacheHitSequence(org.apache.synapse.mediators.base.SequenceMediator onCacheHitSequence)
onCacheHitSequence
- sequence mediator to be set.public String getOnCacheHitRef()
public void setOnCacheHitRef(String onCacheHitRef)
onCacheHitRef
- reference to the onCacheHit sequence to be set.public int getMaxMessageSize()
public void setMaxMessageSize(int maxMessageSize)
maxMessageSize
- maximum size of the messages to be set in bytes.public org.apache.synapse.Mediator getInlineSequence(org.apache.synapse.config.SynapseConfiguration synCfg, int inlinedSeqIdentifier)
getInlineSequence
in interface org.apache.synapse.debug.constructs.EnclosedInlinedSequence
Copyright © 2017 WSO2. All rights reserved.