public EjbInvocation clone() { EjbInvocation newInv = (EjbInvocation) super.clone(); newInv.ejb = null; newInv.exception = null; newInv.exceptionFromBeanMethod = null; newInv.clientTx = null; newInv.preInvokeTxStatus = null; newInv.originalContextClassLoader = null; return newInv; }
private ComponentInvocation createComponentInvocation(ComponentInvocation currInv) { // ComponentInvocation newInv = new ComponentInvocation( // currInv.getComponentId(), // ComponentInvocation.ComponentInvocationType.SERVLET_INVOCATION, // currInv.getContainer(), // currInv.getAppName(), // currInv.getModuleName() // ); ComponentInvocation newInv = currInv.clone(); newInv.setResourceTableKey(null); newInv.instance = currInv.getInstance(); // if (naming) { // newInv.setJNDIEnvironment(currInv.getJNDIEnvironment()); // } if (!naming) { newInv.setJNDIEnvironment(null); } return newInv; }
public EjbInvocation clone() { EjbInvocation newInv = (EjbInvocation) super.clone(); newInv.ejb = null; newInv.exception = null; newInv.exceptionFromBeanMethod = null; newInv.clientTx = null; newInv.preInvokeTxStatus = null; newInv.originalContextClassLoader = null; //The cloned invocation contains a ResourceHandler that points to the same // resource list as the original invocation. If any one of these resource lists // are modified, then we may get a ConcurrentModification exception. // //To avoid this, we will create a new ResourceHandler for the cloned invocation. I // have simply reused SimpleEjbResourceHandlerImpl that was used in async Ejb invocation. newInv.setResourceHandler(SimpleEjbResourceHandlerImpl.createResourceHandler(EjbContainerUtilImpl.getInstance().getTransactionManager())); //The cloned invocation is most likely to be used for running a batch task. // In this case, we don't want TransactionOperationsManager restricting the Batch runtime // from performing a java:comp/UserTransaction lookup. So, we explicitly set a null // TransactionOperationsManager in this case. newInv.setTransactionOperationsManager(null); //We also don't want any JPA EMs registry entries from being shared. newInv.clearRegistry(); return newInv; }