net.kldp.beat.web.interceptor
Class InterceptorFactory

java.lang.Object
  extended by net.kldp.beat.web.interceptor.InterceptorFactory
All Implemented Interfaces:
Interceptor, SystemInterceptor

public abstract class InterceptorFactory
extends java.lang.Object
implements SystemInterceptor

인터셉터의 인스턴스를 생성하고 리턴하는 팩터리 클래스입니다.


Field Summary
private static java.util.HashMap<java.lang.Class<? extends java.lang.annotation.Annotation>,SystemInterceptor> interceptors
           
 
Constructor Summary
InterceptorFactory()
           
 
Method Summary
private static Interceptor createUserInterceptor(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
          사용자가 web.interceptor 패키지에 작성한 인터셉터의 인스턴스를 생성하여 리턴합니다.
static Interceptor getInterceptor(java.lang.annotation.Annotation annotation)
          어노테이션에 맞는 인터셉터를 리턴합니다.
static void intecept(java.lang.Object action, java.util.Map<SystemInterceptor,java.lang.annotation.Annotation> systemInterceptors, ActionContext context)
          액션 객체에 인터셉터를 적용합니다.
static void intecept(UserInterceptor target, ActionContext context, java.lang.annotation.Annotation annotation)
          사용자 인터셉터 객체에 시스템 인터셉터를 적용합니다.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.kldp.beat.interceptor.SystemInterceptor
intercept
 

Field Detail

interceptors

private static java.util.HashMap<java.lang.Class<? extends java.lang.annotation.Annotation>,SystemInterceptor> interceptors
Constructor Detail

InterceptorFactory

public InterceptorFactory()
Method Detail

getInterceptor

public static Interceptor getInterceptor(java.lang.annotation.Annotation annotation)
                                  throws InterceptorException
어노테이션에 맞는 인터셉터를 리턴합니다. 시스템 어노테이션의 경우 싱글턴으로 생성되어 리턴되며, 사용자 인터셉터의 경우 항상 새롭게 생성되어 리턴됩니다.

Parameters:
annotation -
Returns:
Interceptor
Throws:
InterceptorException

createUserInterceptor

private static Interceptor createUserInterceptor(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
                                          throws InterceptorException
사용자가 web.interceptor 패키지에 작성한 인터셉터의 인스턴스를 생성하여 리턴합니다.

Parameters:
clazz -
Returns:
Interceptor
Throws:
InterceptorException

intecept

public static void intecept(UserInterceptor target,
                            ActionContext context,
                            java.lang.annotation.Annotation annotation)
                     throws InterceptorException
사용자 인터셉터 객체에 시스템 인터셉터를 적용합니다. 시스템 인터셉터가 적용되기 위해서는 사용자 인터셉터가 aware류의 인터페이스를 상속하거나, 시스템 인터셉터 어노테이션을 선언할 필요가 있습니다.

Parameters:
target -
context -
annotation -
Throws:
InterceptorException

intecept

public static void intecept(java.lang.Object action,
                            java.util.Map<SystemInterceptor,java.lang.annotation.Annotation> systemInterceptors,
                            ActionContext context)
                     throws InterceptorException
액션 객체에 인터셉터를 적용합니다. 액션 객체에 인터셉터를 적용하기 위해서는 인터셉터의 어노테이션을 선언하거나, aware류의 인터페이스를 구현할 필요성이 있습니다.

Parameters:
action -
systemInterceptors -
context -
Throws:
InterceptorException