[Previous] [Contents] [Next] [IONA Technologies]


CORBA.BOA


Contents

CORBA.BOA.anyClientsConnected()
CORBA.BOA.change_implementation()
CORBA.BOA.create()
CORBA.BOA.deactivate_impl()
CORBA.BOA.deactivate_obj()
CORBA.BOA.dispose()
CORBA.BOA.get_principal()
CORBA.BOA.impl_is_ready()
CORBA.BOA.isEventPending()
CORBA.BOA.myActivationMode()
CORBA.BOA.myImplementationName()
CORBA.BOA.myMarkerName()
CORBA.BOA.myMarkerPattern()
CORBA.BOA.myMethodName()
CORBA.BOA.obj_is_ready()
CORBA.BOA.processEvents()
CORBA.BOA.processNextEvent()
CORBA.BOA.setNoHangup()



Synopsis:

Class 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:

The methods of this class are invoked through the _CORBA.Orbix object on the server; this is, by default, a static object of class CORBA.BOA.

CORBA:

OrbixWeb:

See Also:

Notes:

CORBA defined.



CORBA.BOA.anyClientsConnected()


Synopsis:

Description:

Determines if there are any connections from clients to the server.

Return Value:

Returns true if any clients are connected; returns false otherwise.

Notes:

OrbixWeb specific.



CORBA.BOA.change_implementation()


Synopsis:

Description:

Changes the implementation (server name) associated with the object 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.

Parameters:



oref

The object reference for which the implementation is to be changed.

impl

The name of the new implementation (server).

Notes:

CORBA defined. OrbixWeb programmers are unlikely to need this method.

See Also:



CORBA.BOA.create()


Synopsis:

Description:

Creates a new object reference. Note that this method does not create an implementation object. As such, it makes little sense to use it unless an implementation object exists in the server or an appropriate loader is installed.

Parameters:



     id
    
Opaque identification information, supplied by the caller, and stored in an object. This is an IDL sequence of octets which, in OrbixWeb, is mapped to the object marker.

     intf
    
The Interface Repository object that specifies the set of interfaces implemented by the object.

     impl
    
The Implementation Repository entry (server name) that specifies the implementation to be used for the object.

Exceptions:

If the 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.

Notes:

CORBA defined. An OrbixWeb programmer is unlikely to need this method.

See Also:



CORBA.BOA.deactivate_impl()


Synopsis:

Description:

A server that has called 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.

Parameters:



     impl
    
The server name, as passed to impl_is_ready().

Notes:

CORBA defined.

See Also:



CORBA.BOA.deactivate_obj()


Synopsis:

Description:

A server (running in unshared activation mode) that has called 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.

Notes:

CORBA defined.

See Also:



CORBA.BOA.dispose()


Synopsis:

Description:

Invalidates the object reference oref.

Notes:

CORBA defined.



CORBA.BOA.get_principal()


Synopsis:

Description:

This method obtains the name of the principal (end-user) who owns the process that made the current operation call on the _CORBA.Orbix object. The parameter oref is ignored.

Notes:

CORBA defined.

See Also:



CORBA.BOA.impl_is_ready()


Synopsis:

Description:

Once a server is registered with OrbixWeb, a process may be automatically launched to run it if an operation is invoked on one of its objects or may be manually launched. Once launched, the server should initialise itself, creating any objects it requires, and it should then call _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:

A persistent server (one that is run manually rather than being launched by OrbixWeb) should call the 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.

Other interactions with OrbixWeb, such as calling an operation on a remote object, or using the locator, also cause difficulties if they occur in a persistent server before 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.

Parameters:



serverName The serverName parameter is optional if the server is launched by OrbixWeb; it is mandatory if the server is launched manually or externally to OrbixWeb (that is, for a so-called CORBA persistent server). It is recommended, therefore, that the serverName parameter be specified. If the serverName parameter is specified, it must be exactly the server name with which the server was registered. Note that the serverName parameter need not be the name of a class or interface; it is the name of a server registered with the Implementation Repository.

timeOut Indicates the number of milliseconds to wait between events; a timeout will occur if OrbixWeb has to wait longer than the specified timeout for the next event. A timeout of zero indicates that impl_is_ready() should timeout and return immediately without checking if there is any pending event. A timeout does not cause impl_is_ready() to raise an exception. The default timeout can be passed explicitly as _CORBA.IT_DEFAULT_TIMEOUT. An infinite timeout can be specified by passing _CORBA.IT_INFINITE_TIMEOUT. The timeOut parameter is meaningless for the per-method call activation mode, since the process will be terminated once the operation call that caused it to be launched has completed.

Notes:

CORBA defined.

See Also:



CORBA.BOA.isEventPending()


Synopsis:

Description:

Tests whether or not there is an outstanding event, that is whether or not CORBA.BOA.processNextEvent() would block the server for a period.

Return Value:

Returns true if there is a pending event, returns false otherwise.

Notes:

OrbixWeb specific.

See Also:



CORBA.BOA.myActivationMode()


Synopsis:

Description:

Determines the fundamental activation mode with which the server was launched: shared, unshared, persistent, or per-method.

Return Value:

Returns one of the following values:

CORBA.BOA.persistentActivationMode

Indicates that the server was launched manually.

CORBA.BOA.sharedActivationMode

Indicates that the server was automatically launched in shared mode.

CORBA.BOA.unsharedActivationMode

Indicates that the server was automatically launched in unshared mode.

CORBA.BOA.perMethodActivationMode

Indicates that the server was automatically launched in per-method mode.

CORBA.BOA.unknownActivationMode

OrbixWeb cannot determine the mode in which the server was launched.

Exceptions:

If called within a client application, it raises the NO_IMPLEMENT exception and returns unknownActivationMode.

Notes:

OrbixWeb specific.



CORBA.BOA.myImplementationName()


Synopsis:

Description:

Finds the server's name as registered in the Implementation Repository. For a persistent server, the contents of the string are unspecified until CORBA.BOA.impl_is_ready(), CORBA.BOA.obj_is_ready() or CORBA.ORB.setServerName() is called.

Notes:

OrbixWeb specific.

See Also:



CORBA.BOA.myMarkerName()


Synopsis:

Description:

Finds the marker name of the activation object that caused the server to be launched. For a persistent or a per-method server, this will be null.

Notes:

OrbixWeb specific.

See Also:



CORBA.BOA.myMarkerPattern()


Synopsis:

Description:

Finds the marker pattern which the activation object matched in the Implementation Repository and hence caused this server to be launched.

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.myMethodName()


Synopsis:

Description:

Finds the method that caused server to be launched. For a non per-method server, this will be null.

Notes:

OrbixWeb specific.



CORBA.BOA.obj_is_ready()


Synopsis:

Description:

A server running in the unshared activation mode (that is, with one registered object per process) may call the 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:

Parameters:



     oref
    
The registered object that the process manages.

     impl
    
The server name.

     timeOut
    
The timeout period. A server can time out either because it has no clients for the timeout duration, or because none of its clients uses it for that period. The default timeout is given by _CORBA.IT_DEFAULT_TIMEOUT. An infinite timeout is specified by _CORBA.IT_INFINITE_TIMEOUT.

Notes:

CORBA defined.

See Also:



CORBA.BOA.processEvents()


Synopsis:

Description:

There are three kinds of OrbixWeb events:

If a zero timeout period is given to CORBA.BOA.impl_is_ready() or CORBA.BOA.obj_is_ready(), when invoked on the _CORBA.Orbix object, then the call will return immediately–allowing 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().

Parameters:



     timeOut
    
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.

Return Value:

Normally returns 0. Returns 1 if an exception occurs while waiting for or processing an event or if the ORB has been deactivated.

Notes:

OrbixWeb specific.

See Also:



CORBA.BOA.processNextEvent()


Synopsis:

Description:

A programmer may wish to have more control over the handling of events in a server. There are three kinds of events:

This method blocks the server until an event arrives, handles that one event, and normally returns zero.

If a zero timeout period is given to CORBA.BOA.impl_is_ready() or CORBA.BOA.obj_is_ready(), then the call will return immediately–allowing 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().

Parameters:



     timeOut
    
Indicates how long (in milliseconds) the server should be blocked. A timeout of zero indicates that processNextEvent() should not block; it will return immediately if there is no waiting event.

Return Value:

Normally returns 0 (false). Returns 1 (true) if an exception occurs while waiting for or processing an event or if the ORB has been deactivated.

Notes:

OrbixWeb specific.

See Also:



CORBA.BOA.setNoHangup()


Synopsis:

Description:

By default, the 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.

Parameters:



     value
    
When setNoHangup(true) is called, the timeout period to impl_is_ready() and obj_is_ready() specifies the amount of time a server will remain waiting while there are no client connections to it. When setNoHangup(false) is called, the timeout period to impl_is_ready() and obj_is_ready() specifies the amount of time a server will remain waiting while there are no events (operation calls, connections, disconnections).

When set to true, impl_is_ready() and obj_is_ready() will not timeout while there are clients connected to the server; when set to false, impl_is_ready() and obj_is_ready() can timeout if the specified period elapses between events. The default setting is false.

Return Value:

Returns the previous setting.

Notes:

OrbixWeb specific.

See Also:



[Roadmap] [Utilities] [Compiling] [Configuration]
[Class Reference] [IR Reference] [Daemon Reference] [IDL Grammar] [System Exceptions]
[Index]