Methods Summary |
---|
public void | connect(org.omg.CORBA.ORB orb)Connects this stub to an ORB. Required after the stub is deserialized
but not after it is demarshalled by an ORB stream. If an unconnected
stub is passed to an ORB stream for marshalling, it is implicitly
connected to that ORB. Application code should not call this method
directly, but should call the portable wrapper method
{@link javax.rmi.PortableRemoteObject#connect}.
if (stubDelegate == null) {
setDefaultDelegate();
}
if (stubDelegate != null) {
stubDelegate.connect(this, orb);
}
|
private static java.lang.Object | createDelegateIfSpecified(java.lang.String classKey, java.lang.String defaultClassName)
String className = (String)
AccessController.doPrivileged(new GetPropertyAction(classKey));
if (className == null) {
Properties props = getORBPropertiesFile();
if (props != null) {
className = props.getProperty(classKey);
}
}
if (className == null) {
className = defaultClassName;
}
try {
return loadDelegateClass(className).newInstance();
} catch (ClassNotFoundException ex) {
INITIALIZE exc = new INITIALIZE( "Cannot instantiate " + className);
exc.initCause( ex ) ;
throw exc ;
} catch (Exception ex) {
INITIALIZE exc = new INITIALIZE( "Error while instantiating" + className);
exc.initCause( ex ) ;
throw exc ;
}
|
public boolean | equals(java.lang.Object obj)Compares two stubs for equality. Returns true when used to compare stubs
that represent the same remote object, and false otherwise.
if (stubDelegate == null) {
setDefaultDelegate();
}
if (stubDelegate != null) {
return stubDelegate.equals(this, obj);
}
return false;
|
private static java.util.Properties | getORBPropertiesFile()Load the orb.properties file.
return (Properties) AccessController.doPrivileged(new GetORBPropertiesFileAction());
|
public int | hashCode()Returns a hash code value for the object which is the same for all stubs
that represent the same remote object.
Object stubDelegateInstance = (Object) createDelegateIfSpecified(StubClassKey, defaultStubImplName);
if (stubDelegateInstance != null)
stubDelegateClass = stubDelegateInstance.getClass();
if (stubDelegate == null) {
setDefaultDelegate();
}
if (stubDelegate != null) {
return stubDelegate.hashCode(this);
}
return 0;
|
private static java.lang.Class | loadDelegateClass(java.lang.String className)
try {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
return Class.forName(className, false, loader);
} catch (ClassNotFoundException e) {
// ignore, then try RMIClassLoader
}
try {
return RMIClassLoader.loadClass(className);
} catch (MalformedURLException e) {
String msg = "Could not load " + className + ": " + e.toString();
ClassNotFoundException exc = new ClassNotFoundException( msg ) ;
throw exc ;
}
|
private void | readObject(java.io.ObjectInputStream stream)Serialization method to restore the IOR state.
if (stubDelegate == null) {
setDefaultDelegate();
}
if (stubDelegate != null) {
stubDelegate.readObject(this, stream);
}
|
private void | setDefaultDelegate()
if (stubDelegateClass != null) {
try {
stubDelegate = (javax.rmi.CORBA.StubDelegate) stubDelegateClass.newInstance();
} catch (Exception ex) {
// what kind of exception to throw
// delegate not set therefore it is null and will return default
// values
}
}
|
public java.lang.String | toString()Returns a string representation of this stub. Returns the same string
for all stubs that represent the same remote object.
if (stubDelegate == null) {
setDefaultDelegate();
}
String ior;
if (stubDelegate != null) {
ior = stubDelegate.toString(this);
if (ior == null) {
return super.toString();
} else {
return ior;
}
}
return super.toString();
|
private void | writeObject(java.io.ObjectOutputStream stream)Serialization method to save the IOR state.
if (stubDelegate == null) {
setDefaultDelegate();
}
if (stubDelegate != null) {
stubDelegate.writeObject(this, stream);
}
|