|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.cache.interceptors.Interceptor
public abstract class Interceptor
Class representing an interceptor.
Field Summary | |
---|---|
protected CacheSPI<?,?> |
cache
|
protected Configuration |
configuration
|
protected Interceptor |
last
|
protected org.apache.commons.logging.Log |
log
|
protected Interceptor |
next
|
protected boolean |
trace
|
Constructor Summary | |
---|---|
Interceptor()
|
Method Summary | |
---|---|
protected void |
assertTransactionValid(InvocationContext ctx)
Tests whether the caller is in a valid transaction. |
Map<String,Object> |
dumpStatistics()
This implementation returns an empty Map. |
Interceptor |
getLast()
|
Interceptor |
getNext()
|
boolean |
getStatisticsEnabled()
Returns whether an interceptor's statistics are being captured. |
protected void |
initLogger()
|
Object |
invoke(InvocationContext ctx)
Using this method call for forwarding a call in the chain is not redable and error prone in the case of interceptors extending other interceptors. |
protected boolean |
isActive(Transaction tx)
Returns true if transaction is ACTIVE, false otherwise |
protected boolean |
isPreparing(Transaction tx)
Returns true if transaction is PREPARING, false otherwise |
protected boolean |
isValid(Transaction tx)
Return s true of tx's status is ACTIVE or PREPARING |
Object |
nextInterceptor(InvocationContext ctx)
Forwards the call to the nextInterceptor interceptor in the chain. |
NodeSPI |
peekNode(InvocationContext ctx,
Fqn f,
boolean forceRefresh,
boolean includeDeletedNodes,
boolean includeInvalidNodes)
First checks the invocation context for previously obtained reference to a node, if this doesn't exist, performs a cache.peek() and holds on to the node reference. |
void |
resetStatistics()
This implementation is a no-op. |
void |
setCache(CacheSPI cache)
|
void |
setLast(Interceptor last)
|
void |
setNext(Interceptor i)
|
void |
setStatisticsEnabled(boolean enabled)
Enables an interceptor's cache statistics If true, the interceptor will capture statistics and make them available through the mbean. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Interceptor next
protected Interceptor last
protected CacheSPI<?,?> cache
protected org.apache.commons.logging.Log log
protected Configuration configuration
protected boolean trace
Constructor Detail |
---|
public Interceptor()
Method Detail |
---|
protected void initLogger()
public void setNext(Interceptor i)
public Interceptor getNext()
public void setCache(CacheSPI cache)
public Object invoke(InvocationContext ctx) throws Throwable
nextInterceptor(org.jboss.cache.InvocationContext)
Throwable
public Object nextInterceptor(InvocationContext ctx) throws Throwable
Throwable
public boolean getStatisticsEnabled()
InterceptorMBean
getStatisticsEnabled
in interface InterceptorMBean
public void setStatisticsEnabled(boolean enabled)
InterceptorMBean
setStatisticsEnabled
in interface InterceptorMBean
enabled
- true if statistics should be capturedpublic Interceptor getLast()
public void setLast(Interceptor last)
public Map<String,Object> dumpStatistics()
dumpStatistics
in interface InterceptorMBean
public void resetStatistics()
resetStatistics
in interface InterceptorMBean
protected boolean isActive(Transaction tx)
protected boolean isPreparing(Transaction tx)
protected boolean isValid(Transaction tx)
tx
-
protected void assertTransactionValid(InvocationContext ctx)
public String toString()
toString
in class Object
public NodeSPI peekNode(InvocationContext ctx, Fqn f, boolean forceRefresh, boolean includeDeletedNodes, boolean includeInvalidNodes)
ctx
- invocation contextf
- fqn to findforceRefresh
- forces calling cache.peek() even if we hold a reference to the relevant node.includeDeletedNodes
- includes nodes marked for deletion if this is trueincludeInvalidNodes
- includes nodes marked as invalid if this is true
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |