{
boolean scheduleAsync = invocation.getMethod().isAnnotationPresent(Asynchronous.class) &&
!Contexts.getEventContext().isSet(Dispatcher.EXECUTING_ASYNCHRONOUS_CALL);
if (scheduleAsync)
{
LocalDispatcher dispatcher = Dispatcher.instance();
if (dispatcher==null)
{
throw new IllegalStateException("org.jboss.seam.core.dispatcher is not installed in components.xml");
}
Timer timer = dispatcher.scheduleInvocation( invocation, getComponent() );
//if the method returns a Timer, return it to the client
return invocation.getMethod().getReturnType().equals(Timer.class) ? timer : null;
}
else
{