AsynchronousInvokeTaskpublic class AsynchronousInvokeTask extends Object implements org.jboss.aspects.asynchronous.AsynchronousConstants, org.jboss.aspects.asynchronous.AsynchronousUserTask
Constructors Summary |
---|
protected AsynchronousInvokeTask()
super();
|
Methods Summary |
---|
public void | cleanup(org.jboss.aspects.asynchronous.AsynchronousParameters jp)
try
{
InvokeTaskInputParameters ijp = (InvokeTaskInputParameters) jp;
MethodInvocation invocation = ijp.invocation;
Object targetedClass = invocation.getTargetObject();
if (!invoke(targetedClass,
invocation.getActualMethod().getParameterTypes(),
invocation.getArguments(),
invocation.getActualMethod().getDeclaringClass()))
invoke(targetedClass,
null,
null,
invocation.getActualMethod().getDeclaringClass());
}
catch (Exception e)
{
}
| private boolean | invoke(java.lang.Object targetedObject, java.lang.Class[] paramemeterTypes, java.lang.Object[] parameterObjects, java.lang.Class stringName)
try
{
Class aClass = null;
if (targetedObject == null)
aClass = stringName;
else
aClass = targetedObject.getClass();
Method method = aClass.getMethod("cleanup", paramemeterTypes);
method.invoke(targetedObject, parameterObjects);
}
catch (Exception e)
{
return false;
}
return true;
| public org.jboss.aspects.asynchronous.AsynchronousResponse | process(org.jboss.aspects.asynchronous.AsynchronousParameters jp)
try
{
InvokeTaskInputParameters ijp = (InvokeTaskInputParameters) jp;
MethodInvocation invocation = ijp.invocation;
Object res = invocation.invokeNext();
return new AsynchronousResponseImpl(OK, res);
}
catch (Throwable e)
{
return new AsynchronousResponseImpl(EXCEPTIONCAUGHT, e);
}
|
|