private StatefulSessionContainerMethodInvocation _buildNewInvocation(MethodInfo info,
StatefulRemoteInvocation statefulInvocation, Class<?>[] initParameterTypes, Object[] initParameterValues)
{
StatefulSessionContainerMethodInvocation newStatefulInvocation = null;
StatefulBeanContext ctx = null;
this.pushEnc();
try
{
ctx = getCache().create(initParameterTypes, initParameterValues);
}
finally
{
this.popEnc();
}
Object newId = ctx.getId();
newStatefulInvocation = new StatefulSessionContainerMethodInvocation(info);
newStatefulInvocation.setSessionId(newId);
newStatefulInvocation.setArguments(statefulInvocation.getArguments());
newStatefulInvocation.setMetaData(statefulInvocation.getMetaData());
newStatefulInvocation.setAdvisor(getAdvisor());
SerializableMethod invokedMethod = new SerializableMethod(info.getUnadvisedMethod());
newStatefulInvocation.getMetaData().addMetaData(SessionSpecRemotingMetadata.TAG_SESSION_INVOCATION,
SessionSpecRemotingMetadata.KEY_INVOKED_METHOD, invokedMethod, PayloadKey.AS_IS);
return newStatefulInvocation;
}