IsLocalInterceptorpublic class IsLocalInterceptor extends Object implements Serializable, org.jboss.aop.advice.InterceptorRoutes the call to the local container, bypassing further client-side
interceptors and any remoting layer, if this interceptor was created
in this JVM. |
Fields Summary |
---|
private static final long | serialVersionUID | private static final Logger | log | public static final String | IS_LOCAL | public static final String | IS_LOCAL_EXCEPTION | private static final long | stamp | private long | marshalledStamp |
Methods Summary |
---|
public java.lang.String | getName()
return getClass().getName();
| public java.lang.Object | invoke(org.jboss.aop.joinpoint.Invocation invocation)
if (isLocal())
{
Object oid = invocation.getMetaData(Dispatcher.DISPATCHER, Dispatcher.OID);
Container container = Ejb3Registry.getContainer(oid.toString());
return invokeLocal(invocation, container);
}
return invocation.invokeNext();
| protected java.lang.Object | invokeLocal(org.jboss.aop.joinpoint.Invocation invocation, org.jboss.ejb3.Container container)
Invocation copy = (Invocation) new MarshalledObjectForLocalCalls(invocation).get();
copy.getMetaData().addMetaData(IS_LOCAL, IS_LOCAL, Boolean.TRUE);
org.jboss.aop.joinpoint.InvocationResponse response = ((Advisor) 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;
| protected boolean | isLocal()
return stamp == marshalledStamp;
|
|