InterceptorFilterContext.java :  » Web-Services » crispy » net » sf » crispy » Java Open Source

Java Open Source » Web Services » crispy 
crispy » net » sf » crispy » InterceptorFilterContext.java
package net.sf.crispy;

import java.lang.reflect.Method;

/**
 * Structure for filter interceptors, with information about the method-invocation, how method and args.
 * 
 * @author Linke
 *
 */
public class InterceptorFilterContext {

  private Class invocationClass = null;
  private Method method = null;
  private Object[] args = null;
  private Throwable throwable = null;
  
  public InterceptorFilterContext() {
    super();
  }
  public InterceptorFilterContext(Class pvClass) {
    this.setInvocationClass(pvClass);
  }
  public InterceptorFilterContext(Throwable pvThrowable) {
    this.setThrowable(pvThrowable);
  }
  
  public Object[] getArgs() { return args; }
  public void setArgs(final Object[] pvArgs) { args = pvArgs; }

  public Method getMethod() { return method; }
  public void setMethod(final Method pvMethod) { method = pvMethod; }

  public Throwable getThrowable() { return throwable; }
  public final void setThrowable(final Throwable pvThrowable) { throwable = pvThrowable; }
  
  public Class getInvocationClass() {
    Class lvClass = null;
    if ((invocationClass == null) && (method != null)) {
      lvClass = method.getDeclaringClass();
    } else {
      lvClass = invocationClass;
    }
    return lvClass;
  }
  public final void setInvocationClass(final Class pvClass) { invocationClass = pvClass; }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.