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
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 _object_id()
.
The derivativ of Servant, being directly connected to serve requests,
must inherit either from InvokeHandler
or from DynamicImplementation
).
The Servant type is a CORBA native
type.
Constructor and Description |
---|
Servant() |
Modifier and Type | Method and Description |
---|---|
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()
Obtains the CORBA object reference that is a current invocation target for
the given servant.
|
Object |
_this_object(ORB an_orb)
Obtains the CORBA object reference that is a current invocation target for
the given servant.
|
public Servant()
public abstract String[] _all_interfaces(POA poa, byte[] object_ID)
poa
- a POA of the given object.object_ID
- the object Id of the given object.public final Delegate _get_delegate()
public Object _get_interface_def()
InterfaceDef
for this
Object. By default, forwards request to the delegate.public boolean _is_a(String repository_id)
repository_id
- a repository ID, representing an IDL type for that the
servant must be checked.public boolean _non_existent()
public final ORB _orb()
public POA _default_POA()
public final byte[] _object_id()
public final POA _poa()
public final void _set_delegate(Delegate a_delegate)
public final Object _this_object(ORB an_orb)
_default_POA()
. That method can be overridden to
get poa where the object must be automatically connected when
calling this method.an_orb
- the ORB with relate to that the object is requested.public final Object _this_object()