org.apache.synapse.mediators.builtin
Class CacheMediator

java.lang.Object
  extended by org.apache.synapse.mediators.AbstractMediator
      extended by org.apache.synapse.mediators.builtin.CacheMediator
All Implemented Interfaces:
Mediator

public class CacheMediator
extends AbstractMediator

CacheMediator will cache the response messages indexed using the hash value of the request message, and subsequent messages with the same request (request hash will be generated and checked for the equality) within the cache expiration period will be served from the stored responses in the cache

See Also:
Mediator

Field Summary
 
Fields inherited from class org.apache.synapse.mediators.AbstractMediator
log, trace, traceState
 
Constructor Summary
CacheMediator()
           
 
Method Summary
 org.wso2.caching.digest.DigestGenerator getDigestGenerator()
           
 int getDiskCacheSize()
           
 String getId()
           
 int getInMemoryCacheSize()
           
 int getMaxMessageSize()
           
 String getOnCacheHitRef()
           
 SequenceMediator getOnCacheHitSequence()
           
 String getScope()
           
 long getTimeout()
           
 boolean isCollector()
           
 boolean mediate(MessageContext synCtx)
          Invokes the mediator passing the current message for mediation.
 void setCollector(boolean collector)
           
 void setDigestGenerator(org.wso2.caching.digest.DigestGenerator digestGenerator)
           
 void setDiskCacheSize(int diskCacheSize)
           
 void setId(String id)
           
 void setInMemoryCacheSize(int inMemoryCacheSize)
           
 void setMaxMessageSize(int maxMessageSize)
           
 void setOnCacheHitRef(String onCacheHitRef)
           
 void setOnCacheHitSequence(SequenceMediator onCacheHitSequence)
           
 void setScope(String scope)
           
 void setTimeout(long timeout)
           
 
Methods inherited from class org.apache.synapse.mediators.AbstractMediator
auditLog, auditWarn, getTraceState, getType, handleException, handleException, isTraceOn, isTraceOrDebugOn, 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

CacheMediator

public CacheMediator()
Method Detail

mediate

public boolean mediate(MessageContext synCtx)
Description copied from interface: Mediator
Invokes the mediator passing the current message for mediation. Each mediator performs its mediation action, and returns true if mediation should continue, or false if further mediation should be aborted.

Parameters:
synCtx - the current message for mediation
Returns:
true if further mediation should continue

getId

public String getId()

setId

public void setId(String id)

getScope

public String getScope()

setScope

public void setScope(String scope)

isCollector

public boolean isCollector()

setCollector

public void setCollector(boolean collector)

getDigestGenerator

public org.wso2.caching.digest.DigestGenerator getDigestGenerator()

setDigestGenerator

public void setDigestGenerator(org.wso2.caching.digest.DigestGenerator digestGenerator)

getInMemoryCacheSize

public int getInMemoryCacheSize()

setInMemoryCacheSize

public void setInMemoryCacheSize(int inMemoryCacheSize)

getDiskCacheSize

public int getDiskCacheSize()

setDiskCacheSize

public void setDiskCacheSize(int diskCacheSize)

getTimeout

public long getTimeout()

setTimeout

public void setTimeout(long timeout)

getOnCacheHitSequence

public SequenceMediator getOnCacheHitSequence()

setOnCacheHitSequence

public void setOnCacheHitSequence(SequenceMediator onCacheHitSequence)

getOnCacheHitRef

public String getOnCacheHitRef()

setOnCacheHitRef

public void setOnCacheHitRef(String onCacheHitRef)

getMaxMessageSize

public int getMaxMessageSize()

setMaxMessageSize

public void setMaxMessageSize(int maxMessageSize)


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