Methods Summary |
---|
public EJBHome | getEJBHome()
return ejbHomeStub;
|
public java.lang.Class | getHomeInterfaceClass()
return homeClass;
|
public java.lang.Class | getPrimaryKeyClass()
if ( keyClass == null ) {
// for SessionBeans there is no primary key
throw new RuntimeException("SessionBeans do not have a primary key");
}
return keyClass;
|
public java.lang.Class | getRemoteInterfaceClass()
return remoteClass;
|
public boolean | isSession()
return isSessionBean;
|
public boolean | isStatelessSession()
return isStatelessSessionBean;
|
private void | readObject(java.io.ObjectInputStream in)
isSessionBean = in.readBoolean();
isStatelessSessionBean = in.readBoolean();
// Use thread context classloader to load home/remote/primarykey classes
// See EJB2.0 spec section 18.4.4
ClassLoader loader = Thread.currentThread().getContextClassLoader();
remoteClass = loader.loadClass(in.readUTF());
homeClass = loader.loadClass(in.readUTF());
if ( !isSessionBean )
keyClass = loader.loadClass(in.readUTF());
homeHandle = (HomeHandle)in.readObject();
ejbHomeStub = homeHandle.getEJBHome();
// narrow the home so that the application doesnt have to do
// a narrow after EJBMetaData.getEJBHome().
ejbHomeStub = (EJBHome)PortableRemoteObject.narrow(ejbHomeStub, homeClass);
|
private void | writeObject(java.io.ObjectOutputStream out)
out.writeBoolean(isSessionBean);
out.writeBoolean(isStatelessSessionBean);
// Write the String names of the Class objects,
// since Class objects cant be serialized unless the classes
// they represent are Serializable.
out.writeUTF(remoteClass.getName());
out.writeUTF(homeClass.getName());
if ( !isSessionBean )
out.writeUTF(keyClass.getName());
out.writeObject(homeHandle);
|