org.slim3.container
Class InterceptorFactory

java.lang.Object
  extended by org.slim3.container.InterceptorFactory
All Implemented Interfaces:
Disposable

public class InterceptorFactory
extends Object
implements Disposable

A factory class for interceptor.

Version:
3.0
Author:
higa

Field Summary
protected  boolean disposableRegistered
          Whether the disposable is registered.
protected static InterceptorFactory instance
          The instance.
static String INTERCEPTOR_FACTORY_KEY
          The key for interceptor factory class.
protected  ConcurrentHashMap<String,Interceptor> interceptorCache
          The cache for interceptor.
 
Constructor Summary
InterceptorFactory()
          Constructor.
 
Method Summary
protected  Interceptor createInterceptor(Class<?> interceptorClass)
          Creates an interceptor.
 void dispose()
          Disposes resource.
static InterceptorFactory getInstance()
          Returns the instance.
 Interceptor getInterceptor(Class<?> interceptorClass)
          Returns the interceptor.
protected static void initialize()
          Initializes this class.
 void registerDisposable()
          Registers disposable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTERCEPTOR_FACTORY_KEY

public static final String INTERCEPTOR_FACTORY_KEY
The key for interceptor factory class.

See Also:
Constant Field Values

instance

protected static InterceptorFactory instance
The instance.


disposableRegistered

protected boolean disposableRegistered
Whether the disposable is registered.


interceptorCache

protected ConcurrentHashMap<String,Interceptor> interceptorCache
The cache for interceptor.

Constructor Detail

InterceptorFactory

public InterceptorFactory()
Constructor.

Method Detail

initialize

protected static void initialize()
Initializes this class.


getInstance

public static InterceptorFactory getInstance()
Returns the instance.

Returns:
the instance

registerDisposable

public void registerDisposable()
Registers disposable.


dispose

public void dispose()
Description copied from interface: Disposable
Disposes resource.

Specified by:
dispose in interface Disposable

getInterceptor

public Interceptor getInterceptor(Class<?> interceptorClass)
                           throws NullPointerException
Returns the interceptor.

Parameters:
interceptorClass - the interceptor class
Returns:
the interceptor
Throws:
NullPointerException - if the interceptorClass parameter is null

createInterceptor

protected Interceptor createInterceptor(Class<?> interceptorClass)
Creates an interceptor.

Parameters:
interceptorClass - the interceptor class
Returns:
an interceptor


Copyright © 2008-2009 The Slim3 project. All Rights Reserved.