private void registerServant ( BusinessRemoteWrapper wrapper , int i ) { // synchronized on the remote Wrapper to set the isRemoteRegistered flag synchronized ( wrapper ) { if ( ! ivBusinessRemoteRegistered [ i ] ) { try { if ( ! isZOS ) { // Since there may be multiple remote interfaces per bean // type, a unique WrapperId must be formed by combining the // BeanId with specific remote interface information. d419704 WrapperId wrapperId = new WrapperId ( wrapper . beanId . getByteArrayBytes ( ) , wrapper . bmd . ivBusinessRemoteInterfaceClasses [ i ] . getName ( ) , i ) ; // Servant registration must be performed with the application classloader // in force. This is especially needed for JITDeploy since // the JIT pluggin will be on the application classloader. // Without the JIT pluggin the classloader will not trigger // JITDeploy to create the stub. //d521388 Object originalLoader = ThreadContextAccessor . UNCHANGED ; try { if ( ivBMD != null ) // EJBFactories have no BMD. d529446 { originalLoader = EJBThreadData . svThreadContextAccessor . pushContextClassLoaderForUnprivileged ( ivBMD . classLoader ) ; //PK83186 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { if ( originalLoader != ThreadContextAccessor . UNCHANGED ) { Tr . debug ( tc , "registerServant : old ClassLoader = " + originalLoader ) ; Tr . debug ( tc , "registerServant : new ClassLoader = " + ivBMD . classLoader ) ; } else { Tr . debug ( tc , "registerServant : current ClassLoader = " + ivBMD . classLoader ) ; } } } wrapper . container . getEJBRuntime ( ) . registerServant ( wrapperId , wrapper ) ; } finally { EJBThreadData . svThreadContextAccessor . popContextClassLoaderForUnprivileged ( originalLoader ) ; } // finally } // if( !isZOS ) ivBusinessRemoteRegistered [ i ] = true ; } catch ( Throwable ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".registerServant" , "439" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Failed to register wrapper instance" , new Object [ ] { wrapper , ex } ) ; } } } // if ( ! ivBusinessRemoteRegistered[i] ) } //synchronized( wrapper ) }
d416391 added entire method .