org.omg.PortableServer
public abstract class Servant extends Object
The servant is responsible for handling the method invocation on the target object. It can be one servant per object, or the same servant can support several (possibly all) objects, associated with the given POA.
Till JDK 1.3 inclusive, a typical IDL to java compiler generates an implementation base (name pattern _*ImplBase.java) that is derived from the {@link org.omg.CORBA.portable.ObjectImpl}. Since JDK 1.4 the implementation base is derived from the Servant, also having a different name pattern (*POA.java). This suffix may be confusing, as the servant itself is not POA nor it is derived from it.
In both cases, the implementation base also inherits an interface, containing definitions of the application specific methods. The application programmer writes a child of the implementation base, implementing these methods for the application-specific functionality. The ObjectImpl is connected directly to the ORB. The Servant is connected to POA that can be obtained from the ORB.
If the servant is connected to more than one object, the exact object being currently served can be identified with {@link #_object_id}.
The derivativ of Servant, being directly connected to serve requests, must inherit either from {@link org.omg.CORBA.portable.InvokeHandler} or from {@link org.omg.PortableServer.DynamicImplementation}).
The Servant type is a CORBA native
type.
Method Summary | |
---|---|
abstract String[] | _all_interfaces(POA poa, byte[] object_ID)
Get the repository ids of all interfaces, supported by the
CORBA object, identified by the passed Id. |
POA | _default_POA()
Returns the root POA of the ORB instance, associated with this servant.
|
Delegate | _get_delegate()
Get the delegate, where calls to some Servant methods are forwarded. |
Object | _get_interface_def()
Get the interface repository definition InterfaceDef for this
Object. |
boolean | _is_a(String repository_id)
Checks if the passed servant is an instance of the given CORBA IDL type.
|
boolean | _non_existent()
Determines if the server object for this reference has already
been destroyed. |
byte[] | _object_id()
Return the invocation target object identifier as a byte array.
|
ORB | _orb()
Returns the ORB that is directly associated with the given servant.
|
POA | _poa()
Get POA that is directly associated with the given servant.
|
void | _set_delegate(Delegate a_delegate)
Set the delegate for this servant. |
Object | _this_object(ORB an_orb)
Obtains the CORBA object reference that is a current invocation target for
the given servant. |
Object | _this_object()
Obtains the CORBA object reference that is a current invocation target for
the given servant. |
Parameters: poa a POA of the given object. object_ID the object Id of the given object.
Returns: an array, containing the repository ids.
See Also: ORB
InterfaceDef
for this
Object. By default, forwards request to the delegate.
UNKNOWN: The interface repository is officially not implemented up till JDK 1.5 inclusive. The delegate throws NO_IMPLEMENT, always.
Parameters: repository_id a repository ID, representing an IDL type for that the servant must be checked.
Returns: true if the servant is an instance of the given type, false otherwise.
Returns: true if the object has been destroyed, false otherwise.
Parameters: an_orb the ORB with relate to that the object is requested.