org.jboss.cache.factories
Class InterceptorChainFactory

java.lang.Object
  extended by org.jboss.cache.factories.InterceptorChainFactory

public class InterceptorChainFactory
extends Object

Factory class that builds an interceptor chain based on CacheImpl config.

Author:
Manik Surtani (manik@jboss.org)

Method Summary
 List<Interceptor> asList(Interceptor interceptor)
           
 Interceptor buildInterceptorChain(CacheImpl cache)
           
 Interceptor correctInterceptorChaining(List<Interceptor> interceptors)
          "Fixes" the next() and last() pointers for each interceptor, based on the order presented in the list passed in
static InterceptorChainFactory getInstance()
           
 void initialiseInterceptors(Interceptor firstInterceptor, CacheSPI cache)
          Initialises the interceptors with a CacheSPI instance.
 String printInterceptorChain(Interceptor i)
           
 Interceptor setLastInterceptorPointer(Interceptor first, Interceptor last)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static InterceptorChainFactory getInstance()

buildInterceptorChain

public Interceptor buildInterceptorChain(CacheImpl cache)
                                  throws IllegalAccessException,
                                         ClassNotFoundException,
                                         InstantiationException
Throws:
IllegalAccessException
ClassNotFoundException
InstantiationException

setLastInterceptorPointer

public Interceptor setLastInterceptorPointer(Interceptor first,
                                             Interceptor last)

printInterceptorChain

public String printInterceptorChain(Interceptor i)

asList

public List<Interceptor> asList(Interceptor interceptor)

correctInterceptorChaining

public Interceptor correctInterceptorChaining(List<Interceptor> interceptors)
"Fixes" the next() and last() pointers for each interceptor, based on the order presented in the list passed in

Parameters:
interceptors -
Returns:
the first interceptor in the chain.

initialiseInterceptors

public void initialiseInterceptors(Interceptor firstInterceptor,
                                   CacheSPI cache)
Initialises the interceptors with a CacheSPI instance. Essentially calls setCache(). This is done AFTER the interceptor chain is created, and when Cache.start() is called, so the interceptors get a fully initialised cache.

Parameters:
firstInterceptor - interceptor chain
cache - cache instance


Copyright © 2007 JBoss, a division of Red Hat. All Rights Reserved.