org.apache.tapestry5.internal.services
Class AbstractComponentMethodInvocation

java.lang.Object
  extended by org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation
All Implemented Interfaces:
Invocation, ComponentResourcesAware, ComponentMethodInvocation

public abstract class AbstractComponentMethodInvocation
extends Object
implements ComponentMethodInvocation


Constructor Summary
AbstractComponentMethodInvocation(ComponentMethodInvocationInfo info, ComponentResources resources)
           
 
Method Summary
 ComponentResources getComponentResources()
          Returns the resources associated with this component class.
 String getMethodName()
          Returns the name of the method being invoked.
 int getParameterCount()
          Returns the number of parameters passed to the method.
 Class getParameterType(int index)
          Returns the type of the parameter at the index.
 Object getResult()
          The return value after Invocation.proceed(), which may be null.
 Class getResultType()
          Returns the type of the method result, which may be a primitive type (i.e., int.class) or even void (void.class).
<T extends Throwable>
T
getThrown(Class<T> throwableClass)
          After invoking Invocation.proceed(), used to obtain the thrown (checked) exception, if assignable to the provided type.
protected abstract  void invokeAdvisedMethod()
          Implemented to reinvoke the method on the advised method of the component.
 boolean isFail()
          If true, then the proceeded invocation threw a checked exception.
 void overrideResult(Object newResult)
          Overrides the result.
 void overrideThrown(Exception thrown)
          Overrides the thrown exception.
 void proceed()
          This first call is to the first advice.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry5.ioc.Invocation
getParameter, override
 

Constructor Detail

AbstractComponentMethodInvocation

public AbstractComponentMethodInvocation(ComponentMethodInvocationInfo info,
                                         ComponentResources resources)
Method Detail

getComponentResources

public ComponentResources getComponentResources()
Description copied from interface: ComponentResourcesAware
Returns the resources associated with this component class.

Specified by:
getComponentResources in interface ComponentResourcesAware

getMethodName

public String getMethodName()
Description copied from interface: Invocation
Returns the name of the method being invoked.

Specified by:
getMethodName in interface Invocation

getResultType

public Class getResultType()
Description copied from interface: Invocation
Returns the type of the method result, which may be a primitive type (i.e., int.class) or even void (void.class).

Specified by:
getResultType in interface Invocation

getParameterCount

public int getParameterCount()
Description copied from interface: Invocation
Returns the number of parameters passed to the method.

Specified by:
getParameterCount in interface Invocation

getParameterType

public Class getParameterType(int index)
Description copied from interface: Invocation
Returns the type of the parameter at the index.

Specified by:
getParameterType in interface Invocation

proceed

public void proceed()
This first call is to the first advice. When we run out of advice, we re-invoke.

Specified by:
proceed in interface Invocation

invokeAdvisedMethod

protected abstract void invokeAdvisedMethod()
Implemented to reinvoke the method on the advised method of the component.


isFail

public boolean isFail()
Description copied from interface: Invocation
If true, then the proceeded invocation threw a checked exception.

Specified by:
isFail in interface Invocation

getThrown

public <T extends Throwable> T getThrown(Class<T> throwableClass)
Description copied from interface: Invocation
After invoking Invocation.proceed(), used to obtain the thrown (checked) exception, if assignable to the provided type.

Specified by:
getThrown in interface Invocation
Parameters:
throwableClass - the type of exception to match
Returns:
the exception, if the proceeded invocation threw a checked exception, and the exception is assignable to the provided type. In other cases, null is returned.

overrideThrown

public void overrideThrown(Exception thrown)
Description copied from interface: Invocation
Overrides the thrown exception. The passed exception should be a checked exception of the method. Note that for runtime exceptions, or even Errors, those can just be thrown. Sets the fail flag.

Specified by:
overrideThrown in interface Invocation

getResult

public Object getResult()
Description copied from interface: Invocation
The return value after Invocation.proceed(), which may be null.

Specified by:
getResult in interface Invocation

overrideResult

public void overrideResult(Object newResult)
Description copied from interface: Invocation
Overrides the result. Clears the thrown exception (if any).

Specified by:
overrideResult in interface Invocation


Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.