javax.rmi.CORBA

Class Stub

public abstract class Stub extends ObjectImpl implements Serializable

A Stub descendants provide access to the object on the client side. This base class implements methods, required for remote or local invocation using CORBA mechanisms. The most of the functionality is forwarded to the stub delegate. This delegate can be altered by setting the system property "javax.rmi.CORBA.StubClass" to the name of the alternative class that must implement {@link StubDelegate}. Hence Stub contains two delegates, one for Stub-related operations and another inherited from the ObjectImpl.

UNKNOWN: GNU Classpath uses separate delegate per each Stub. The delegate holds information about the ORB and other data, specific for the each Stub.

Method Summary
voidconnect(ORB orb)

Finds the suitable {@link Tie} for this Stub and connects it to the given ORB.

booleanequals(Object obj)
The stubs are equal if they point to the same remote object.
inthashCode()
Returns the same hashcode for all stubs that point to the same remote object.
StringtoString()
Get the string representation of this Stub.

Method Detail

connect

public void connect(ORB orb)

Finds the suitable {@link Tie} for this Stub and connects it to the given ORB. The tie is found by the name pattern. If the found tie is derived from {@link org.omg.CORBA.PortableServer.Servant}, it is connected to the root POA, also activating it (if not already active).

This method does not allow to specify, to which POA the found Tie must be connected and requires to use the deprecated method {@link ORB#connect}. Many useful POA features remain unaccessible. A better alternative it might be to generate a {@link org.omg.CORBA.PortableServer.Servant} - derived Tie (-poa key in rmic) and connect it to POA in one of the many ways, listed in the description of the {@link orb.omg.PortableServer} package). The obtained CORBA object can be narrowed into stub using {@link PortableRemoteObject#narrow}.

It is frequently easier to call {@link PortableRemoteObject#connect} rather than this method.

Parameters: orb the ORB where the Stub must be connected.

Throws: RemoteException if the stub is already connected to some other ORB. If the stub is already connected to the ORB that was passed as parameter, the method returns without action. BAD_PARAM if the name of this stub does not match the stub name pattern, "_*_Stub" or if the Tie class, "_*Impl_Tie", does not exists or an instance of this class cannot be instantiated.

equals

public boolean equals(Object obj)
The stubs are equal if they point to the same remote object.

hashCode

public int hashCode()
Returns the same hashcode for all stubs that point to the same remote object.

toString

public String toString()
Get the string representation of this Stub.

Returns: the CORBA IOR reference.