com.dyuproject.web.rest
Class InterceptorCollection

java.lang.Object
  extended by com.dyuproject.web.rest.AbstractLifeCycle
      extended by com.dyuproject.web.rest.InterceptorCollection
All Implemented Interfaces:
Interceptor, LifeCycle

public final class InterceptorCollection
extends AbstractLifeCycle
implements Interceptor

Wraps an array of interceptors and does the handle chain. Interceptors can be added/removed at runtime.

Author:
David Yu
Date created:
May 18, 2008

Constructor Summary
InterceptorCollection()
           
 
Method Summary
 boolean add(Interceptor interceptor)
           
 InterceptorCollection addInterceptor(Interceptor interceptor)
           
protected  void destroy()
           
 Interceptor[] getInterceptors()
           
 int indexOf(Interceptor interceptor)
           
protected  void init()
           
 void postHandle(boolean handled, RequestContext requestContext)
           
 boolean preHandle(RequestContext requestContext)
           
 boolean remove(int idx)
           
 boolean remove(Interceptor interceptor)
           
 void setInterceptors(Interceptor[] interceptors)
           
 
Methods inherited from class com.dyuproject.web.rest.AbstractLifeCycle
destroy, getWebContext, init, isDestroyed, isInitialized, newObjectInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.dyuproject.web.rest.LifeCycle
destroy, init
 

Constructor Detail

InterceptorCollection

public InterceptorCollection()
Method Detail

addInterceptor

public InterceptorCollection addInterceptor(Interceptor interceptor)

add

public boolean add(Interceptor interceptor)

indexOf

public int indexOf(Interceptor interceptor)

remove

public boolean remove(Interceptor interceptor)

remove

public boolean remove(int idx)

setInterceptors

public void setInterceptors(Interceptor[] interceptors)

getInterceptors

public Interceptor[] getInterceptors()

init

protected void init()
Specified by:
init in class AbstractLifeCycle

destroy

protected void destroy()
Overrides:
destroy in class AbstractLifeCycle

postHandle

public void postHandle(boolean handled,
                       RequestContext requestContext)
Specified by:
postHandle in interface Interceptor

preHandle

public boolean preHandle(RequestContext requestContext)
                  throws ServletException,
                         IOException
Specified by:
preHandle in interface Interceptor
Throws:
ServletException
IOException


Copyright © 2008-2013. All Rights Reserved.