StatefulSessionProxyFactory.class);
// Create a new EJB2.x Proxy
Object proxy = proxyFactory.createProxyEjb2x((Serializable)newStatefulInvocation.getSessionId());
InvocationResponse response = marshallResponse(statefulInvocation, proxy, newStatefulInvocation.getResponseContextInfo());
if (newStatefulInvocation.getSessionId() != null)
response.addAttachment(StatefulConstants.NEW_ID,
newStatefulInvocation.getSessionId());
return response;
}
else if (unadvisedMethod.getName().equals("remove"))
{
Object argument = statefulInvocation.getArguments()[0];
remove(argument);
InvocationResponse response = new InvocationResponse(null);
response.setContextInfo(statefulInvocation.getResponseContextInfo());
return response;
}
else if (unadvisedMethod.getName().equals("getEJBMetaData"))
{
Class<?> remote = null;
Class<?> home = null;
Class<?> pkClass = Object.class;
HomeHandleImpl homeHandle = null;
Class<?>[] remotes = ProxyFactoryHelper.getRemoteInterfaces(this);
if (remotes != null && remotes.length > 0)
{
remote = remotes[0];
}
RemoteHome homeAnnotation = this.getAnnotation(RemoteHome.class);
if (homeAnnotation != null)
home = homeAnnotation.value();
RemoteHomeBinding remoteHomeBinding = this.getAnnotation(RemoteHomeBinding.class);
assert remoteHomeBinding != null : "remoteHomeBinding is null";
homeHandle = new HomeHandleImpl(remoteHomeBinding.jndiBinding());
EJBMetaDataImpl metadata = new EJBMetaDataImpl(remote, home, pkClass,
true, false, homeHandle);
InvocationResponse response = marshallResponse(statefulInvocation, metadata, null);
return response;
}
else if (unadvisedMethod.getName().equals("getHomeHandle"))
{
HomeHandleImpl homeHandle = null;
RemoteHomeBinding remoteHomeBinding = this.getAnnotation(RemoteHomeBinding.class);
assert remoteHomeBinding != null : "remoteHomeBinding is null";
homeHandle = new HomeHandleImpl(remoteHomeBinding.jndiBinding());
InvocationResponse response = marshallResponse(statefulInvocation, homeHandle, null);
return response;
}
else
{
return null;