CORBA.BOA
is a derived class of CORBA.ORB
which implements the OMG CORBA BOA
pseudo interface, and adds a number of methods specific to OrbixWeb. BOA stands for "Basic Object Adapter".
CORBA.BOA
provides methods that control OrbixWeb from the server. These include methods to:
_CORBA.Orbix
object on the server; this is, by default, a static object of class CORBA.BOA
.
// Pseudo IDL pseudo interface BOA ( Object create(in ReferenceData id, in InterfaceDef intf, in ImplementationDef impl); void dispose(in Object obj); void change_implementation(in Object obj, in ImplementationDef impl); Principal get_principal(in Object obj, in Environment env); void impl_is_ready(in Object obj, in ImplementationDef impl); void deactivate_impl( in ImplementationDef impl); void obj_is_ready(in ImplementationDef impl); void deactivate_obj(in Object obj); };
// Java package IE.Iona.Orbix2.CORBA; public class BOA extends ORB { // constants // server activation modes static final short perMethodActivationMode; static final short unsharedActivationMode; static final short persistentActivationMode; static final short sharedActivationMode; static final short unknownActivationMode; // methods public IE.Iona.Orbix2.CORBA._ObjectRef create (_sequence_Octet id, IE.Iona.Orbix2._InterfaceDefRef intf, String impl) throws SystemException; public _sequence_Octet get_id (IE.Iona.Orbix2.CORBA._ObjectRef oref) throws SystemException; public void dispose (IE.Iona.Orbix2.CORBA._ObjectRef oref) throws SystemException; public void change_implementation (IE.Iona.Orbix2.CORBA._ObjectRef oref, String impl) throws SystemException; public String get_principal (IE.Iona.Orbix2.CORBA._ObjectRef oref) throws SystemException; public int processNextEvent (int timeOut) throws SystemException; public int processNextEvent () throws SystemException; public int processEvents (int timeOut) throws SystemException; public int processEvents () throws SystemException; public boolean isEventPending () throws SystemException; public boolean anyClientsConnected () throws SystemException; public boolean setNoHangup (boolean b) throws SystemException; public void impl_is_ready () throws SystemException; public void impl_is_ready (String serverName) throws SystemException; public void impl_is_ready (int timeOut) throws SystemException; public void impl_is_ready (String serverName, int timeOut) throws SystemException; public void deactivate_impl (String impl) throws SystemException; public void obj_is_ready (IE.Iona.Orbix2.CORBA._ObjectRef oref, String impl, int timeOut) throws SystemException; public void obj_is_ready (IE.Iona.Orbix2.CORBA._ObjectRef oref, String impl) throws SystemException; public void deactivate_obj (IE.Iona.Orbix2.CORBA._ObjectRef oref) throws SystemException; public String myImplementationName () throws SystemException; public String myMarkerName () throws SystemException; public String myMarkerPattern () throws SystemException; public String myMethodName () throws SystemException; public short myActivationMode () throws SystemException; }
CORBA.ORB
public boolean anyClientsConnected ()
throws SystemException;
true
if any clients are connected; returns false
otherwise.
public void change_implementation (IE.Iona.Orbix2.CORBA._ObjectRef oref, String impl) throws SystemException;
oref
. This method may be used to overcome the problem of exporting an object reference from a persistent server before impl_is_ready()
is called.The method
CORBA.ORB.setServerName()
can be used to change the implementation for all objects created by a server.Note that if a server creates an object and clients then invoke on this object, subsequent invocations on the object may fail following a call to
CORBA.BOA.change_implementation()
on that object.
oref
|
The object reference for which the implementation is to be changed.
|
impl
|
The name of the new implementation (server).
|
CORBA.BOA.impl_is_ready()
CORBA.ORB.setServerName()
public IE.Iona.Orbix2.CORBA._ObjectRef create
(_sequence_Octet id,
IE.Iona.Orbix2._InterfaceDefRef intf,
String impl)
throws SystemException;
id
does not match the marker of an object currently resident in (or loaded into) the server's address space, then CORBA.BOA.create()
raises a CORBA.INV_OBJREF
exception.
CORBA.Object.Object()
CORBA.ORB.string_to_object()
CORBA.LoaderClass
public void deactivate_impl (String impl) throws SystemException;
impl_is_ready()
to indicate that it has completed initialisation and is ready to receive requests, may subsequently indicate to OrbixWeb that it wishes to discontinue receiving requests. It does so by calling deactivate_impl()
, and passing the server name in the parameter impl
. Calling deactivate_impl()
causes impl_is_ready()
to return.
|
The server name, as passed to impl_is_ready() .
|
CORBA.BOA.impl_is_ready()
public void deactivate_obj
(IE.Iona.Orbix2.CORBA._ObjectRef oref)
throws SystemException;
obj_is_ready()
to indicate that it has completed initialisation and is ready to receive requests, may subsequently indicate to OrbixWeb that it wishes to discontinue receiving requests for this object. It does so by calling deactivate_obj()
, and passing the object whose marker caused the server process to be launched, in the parameter oref
.
CORBA.BOA.obj_is_ready()
public void dispose
(IE.Iona.Orbix2.CORBA._ObjectRef oref)
throws SystemException;
oref
.
public String get_principal
(IE.Iona.Orbix2.CORBA._ObjectRef oref)
throws SystemException;
_CORBA.Orbix
object. The parameter oref
is ignored.
CORBA.Principal
public void impl_is_ready () throws SystemException; public void impl_is_ready (String serverName) throws SystemException; public void impl_is_ready (int timeOut) throws SystemException; public void impl_is_ready (String serverName, int timeOut) throws SystemException;
_CORBA.Orbix.impl_is_ready()
to indicate that it has completed its initialisation and is ready to receive operation requests on its objects.The
impl_is_ready()
method normally does not return immediately; it blocks the server until an event occurs, handles the event, and re-blocks the server to await another event. (The methods CORBA.BOA.processEvents()
and CORBA.BOA.processNextEvent()
provide alternative ways of handling events.)The
impl_is_ready()
method returns only when:
CORBA.BOA.deactivate_impl()
is called.
impl_is_ready()
method before it has any interaction with OrbixWeb. For example, a persistent server should not pass out an object reference for one of its objects (for example, as a parameter or return value, or even by printing it) until impl_is_ready()
is called. Such an object reference would not have the correct server name since OrbixWeb has no way of determining this before impl_is_ready()
is called.
impl_is_ready()
will insert the correct server name into the object names of the server's objects, but it cannot do so for any object references that have already been passed out of the address space.
impl_is_ready()
is called. Note that this problem can be circumvented calling the CORBA.ORB.setServerName()
method on the _CORBA.Orbix
object before making external calls.Persistent servers, once they have called
impl_is_ready()
behave as shared activation mode servers. However, if a server is registered as unshared or per-method, then, as required by the CORBA specification, impl_is_ready()
will fail if the server is launched manually.Normally, a server must be registered in the Implementation Repository (using
putit
) before it can call impl_is_ready()
. However, if the -u
switch is specified to the orbixd
daemon, a persistent server can call impl_is_ready()
without being registered.
CORBA.BOA.deactivate_impl()
CORBA.BOA.obj_is_ready()
CORBA.BOA.processEvents()
CORBA.BOA.processNextEvent()
CORBA.ORB.setServerName()
public boolean isEventPending ()
throws SystemException;
CORBA.BOA.processNextEvent()
would block the server for a period.
true
if there is a pending event, returns false
otherwise.
CORBA.BOA.processNextEvent()
public short myActivationMode ()
throws SystemException;
NO_IMPLEMENT
exception and returns unknownActivationMode
.
public String myImplementationName ()
throws SystemException;
CORBA.BOA.impl_is_ready()
, CORBA.BOA.obj_is_ready()
or CORBA.ORB.setServerName()
is called.
CORBA.BOA.impl_is_ready()
CORBA.ORB.setServerName()
public String myMarkerName ()
throws SystemException;
CORBA.BOA.myMarkerPattern
()
public String myMarkerPattern ()
throws SystemException;
For a persistent or per-method server, this will be null.
Marker patterns are explained in Chapter 1, "The OrbixWeb Utilities".
Notes:
OrbixWeb specific. See Also:
CORBA.BOA.myMarkerName()
public String myMethodName ()
throws SystemException;
public void obj_is_ready
(IE.Iona.Orbix2.CORBA._ObjectRef oref,
String impl,
int timeOut)
throws SystemException;
public void obj_is_ready
(IE.Iona.Orbix2.CORBA._ObjectRef oref,
String impl)
throws SystemException;
CORBA.BOA.obj_is_ready()
method on the _CORBA.Orbix
object to indicate that it has completed its initialisation. The server remains active and will receive requests for its registered object until:
CORBA.BOA.deactivate_obj()
.
obj_is_ready()
times out.
CORBA.BOA.deactivate_obj()
CORBA.BOA.impl_is_ready()
public int processEvents (int timeOut)
throws SystemException;
public int processEvents ()
throws SystemException;
CORBA.BOA.impl_is_ready()
or CORBA.BOA.obj_is_ready()
, when invoked on the _CORBA.Orbix
object, then the call will return immediatelyallowing a program to subsequently state at what points it is willing to accept incoming OrbixWeb events.The method
processEvents()
blocks the server until an event arrives, handles the event, and continues to process events, until none arrives within the timeout period. It has the same effect as calling CORBA.BOA.processNextEvent()
repeatedly until it times-out.The method
processEvents()
is similar in functionality to impl_is_ready()
(or obj_is_ready()
) because it processes any number of events until it times out. However, use of processEvents()
does not initialise the server and therefore does not fulfil a server's requirement to call impl_is_ready()
(or obj_is_ready()
). One example of using
processEvents()
is where a manually launched server wishes to interact with OrbixWeb (for example, by calling a remote operation or by passing out or printing an object reference for one of its objects) before it is ready to handle events. Before it interacts with OrbixWeb, it might call impl_is_ready()
(or obj_is_ready()
), in this case with a zero timeout, and then call processEvents()
when it is ready to handle events. Alternatively, before it interacts with OrbixWeb it may call CORBA.ORB.setServerName()
and then call processEvents()
.
|
Indicates how long (in milliseconds) the server should be blocked. A timeout of zero indicates that processEvents() should not block; it will return immediately if there is no waiting event.
|
0
. Returns 1
if an exception occurs while waiting for or processing an event or if the ORB has been deactivated.
CORBA.BOA.processNextEvent()
CORBA.BOA.impl_is_ready()
CORBA.BOA.obj_is_ready()
CORBA.ORB.setServerName()
public int processNextEvent (int timeOut)
throws SystemException;
public int processNextEvent ()
throws SystemException;
If a zero timeout period is given to
CORBA.BOA.impl_is_ready()
or CORBA.BOA.obj_is_ready()
, then the call will return immediatelyallowing a program to subsequently state at what points it is willing to accept incoming OrbixWeb events. This can be done by calling _CORBA.Orbix.processNextEvent()
.
0
(false). Returns 1
(true) if an exception occurs while waiting for or processing an event or if the ORB has been deactivated.
CORBA.BOA.processEvents()
CORBA.BOA.impl_is_ready()
CORBA.BOA.obj_is_ready()
CORBA.BOA.deactivate_impl()
public boolean setNoHangup (boolean b)
throws SystemException;
CORBA.BOA.impl_is_ready()
and CORBA.BOA.obj_is_ready()
methods time out when a (user defined or defaulted) period has elapsed between events. An event is an incoming operation call or the connection or disconnection by a client.This means that
impl_is_ready()
and obj_is_ready()
can timeout when clients are idle for a period. If a server would prefer to remain active while it has any clients, active or not, then it can call the function setNoHangup(true)
on the _CORBA.Orbix
object.
CORBA.ORB.defaultTxTimeout()