return invocation.invokeNext();
}
protected Object invokeLocal(Invocation invocation, Container container) throws Throwable
{
Invocation copy = (Invocation) new MarshalledObjectForLocalCalls(invocation).get();
copy.getMetaData().addMetaData(IS_LOCAL, IS_LOCAL, Boolean.TRUE, PayloadKey.AS_IS);
org.jboss.aop.joinpoint.InvocationResponse response = null;
/*
* EJBTHREE-1385
*
* Integration of EJB3 Proxy changed the invocation model,
* so SessionSpecContainers now are supported via
* dynamicInvoke(Invocation), where all other
* SessionContainers use the @deprecated
* dynamicInvoke(Object,Invocation)
*/
if (container instanceof SessionSpecContainer)
{
SessionSpecContainer ssc = (SessionSpecContainer) container;
response = ssc.dynamicInvoke(copy);
}
else
{
response = ((SessionContainer) container).dynamicInvoke(null, copy);
}
Map contextInfo = response.getContextInfo();
if (contextInfo != null)
{
MarshalledObjectForLocalCalls wrappedException = (MarshalledObjectForLocalCalls) response.getContextInfo().get(IS_LOCAL_EXCEPTION);
if (wrappedException != null)
{
throw (Throwable) wrappedException.get();
}
}
invocation.setResponseContextInfo(response.getContextInfo());
MarshalledObjectForLocalCalls wrapped = (MarshalledObjectForLocalCalls) response.getResponse();
Object rtn = null;
if (wrapped != null)
{
rtn = wrapped.get();
}
return rtn;
}