question: private static RemoteStub createStub ( Class < ? > remoteClass , RemoteRef ref ) throws StubNotFoundException { String stubname = remoteClass . getName ( ) + "_Stub" ; try { Class < ? > stubcl = Class . forName ( stubname , false , remoteClass . getClassLoader ( ) ) ; Constructor < ? > cons = stubcl . getConstructor ( stubConsParamTypes ) ; return ( RemoteStub ) cons . newInstance ( new Object [ ] { ref } ) ; } catch ( ClassNotFoundException e ) { throw new StubNotFoundException ( "Stub class not found: " + stubname , e ) ; } catch ( NoSuchMethodException e ) { throw new StubNotFoundException ( "Stub class missing constructor: " + stubname , e ) ; } catch ( InstantiationException e ) { throw new StubNotFoundException ( "Can't create instance of stub class: " + stubname , e ) ; } catch ( IllegalAccessException e ) { throw new StubNotFoundException ( "Stub class constructor not public: " + stubname , e ) ; } catch ( InvocationTargetException e ) { throw new StubNotFoundException ( "Exception creating instance of stub class: " + stubname , e ) ; } catch ( ClassCastException e ) { throw new StubNotFoundException ( "Stub class not instance of RemoteStub: " + stubname , e ) ; } }
target:  Creates a RemoteStub instance for the specified class, constructed with the specified RemoteRef.  The supplied class must be the most derived class in the remote object's superclass chain that implements a remote interface.  The stub class name is the name of the specified remoteClass with the suffix "_Stub".  The loading of the stub class is initiated from class loader of the specified class (which may be the bootstrap class loader).