The mechanisms of EJBHome and EJBObject
The following code snippet is a typical procedure to locate remote references to EJBs. My question is whether the instances of remote references EJBHome and EJBObject exist on both client and server sides?
In this case, I found that the class names for the ConverterHome and Converter objects are_ConverterHome_DynamicStub and_Converter_DynamicStub respectively, and they share a common super class namedcom.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase. It means that both EJBHome and EJBObject objects are stubs, right? Therefore, there will be a counterpart stub on the server side, for both EJBHome and EJBObject, right? Stubs from both sides are in charge of something like communication, serialization, deserialization and so on, right?
Please give me a full-view descriptions of the RMI mechanism.
========================================================
Context initial = new subInitialContext();
Context myEnv = (Context) initial.lookup( "java:comp/env" );
String EnvName = myEnv.getNameInNamespace();
Object objref = myEnv.lookup("ejb/SimpleConverter");
ConverterHome home =
( ConverterHome )PortableRemoteObject.narrow( objref,
ConverterHome.class );
Class home_class = home.getClass();
System.out.println( "The class name of home is (" + home_class.getName() + ")" );
Class sup_class = home_class.getSuperclass();
System.out.println( "The class name of sup_class is (" + sup_class.getName() + ")" );
Converter currencyConverter = home.create();
Class obj_class = currencyConverter.getClass();
System.out.println( "The class name of currencyConverter is (" + obj_class.getName() + ")" );
Class sup2_class = obj_class.getSuperclass();
System.out.println( "The class name of sup2_class is (" + sup2_class.getName() + ")" );
========================================================

