private ClassLoader getWrapperProxyClassLoader ( BeanMetaData bmd , Class < ? > intf ) // F58064 throws EJBConfigurationException { // Wrapper proxies are intended to support application restart scenarios. // In order to allow GC of the target EJB class loader when the // application stops, the wrapper proxy class must not be defined by the // target EJB class loader. Instead, we directly define the class on the // class loader of the interface. ClassLoader loader = intf . getClassLoader ( ) ; // Classes defined by the boot class loader (i.e., java.lang.Runnable) // have a null class loader. if ( loader != null ) { try { loader . loadClass ( BusinessLocalWrapperProxy . class . getName ( ) ) ; return loader ; } catch ( ClassNotFoundException ex ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "unable to load EJSLocalWrapperProxy for " + intf . getName ( ) + " from " + loader ) ; } } // The class loader of the interface did not have visibility to our // com.ibm.ejs.container classes, which is required. Attempt to use the // server class loader instead. loader = bmd . container . getEJBRuntime ( ) . getServerClassLoader ( ) ; try { if ( loader . loadClass ( intf . getName ( ) ) == intf ) { return loader ; } } catch ( ClassNotFoundException ex ) { // Nothing. } // The server class loader did not have visibility to the interface // class. The interface was probably loaded by a non-runtime bundle that // didn't import com.ibm.ejs.container. Just use the application class // loader even though this will prevent it from being garbage collected, // and it will do the wrong thing for package-private methods in // no-interface view. return bmd . classLoader ; // d727494 }
Returns a class loader that can be used to define a proxy for the specified interface .