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


CORBA.LoaderClass


Contents

CORBA.LoaderClass.LoaderClass()
CORBA.LoaderClass.LoaderClass()
CORBA.LoaderClass.load()
CORBA.LoaderClass.record()
CORBA.LoaderClass.rename()
CORBA.LoaderClass.save()



Synopsis:

When an operation invocation arrives at a process, OrbixWeb searches for the target object in the process's object table. By default, if the object is not found, OrbixWeb returns an INV_OBJREF exception to the caller. However, by installing one or more loader objects in a process, a programmer can choose to intervene and be informed about the failure to find the object.

A loader object might handle such an "object fault" by reconstructing the required object from a persistent store–such as a flat file, an RDBMS, or an ODBMS.

OrbixWeb can then be asked to retry the invocation transparently to the caller.

Loaders are defined by defining a derived class of CORBA.LoaderClass and are installed by creating a (dynamic) instance of the new class. Chapter 23, "Loaders"of the OrbixWeb Programming Guide explains the details of defining and installing a loader.

OrbixWeb:

Notes:

OrbixWeb specific.



CORBA.LoaderClass.LoaderClass()


Synopsis:

Description:

The LoaderClass constructor has protected access–a programmer can not, therefore, create a direct instance of class LoaderClass.

Notes:

Orbix specific.

See Also:

Other class constructor.



CORBA.LoaderClass.LoaderClass()


Synopsis:

Description:

The LoaderClass constructor has protected access–a programmer can not, therefore, create a direct instance of class LoaderClass.

Parameters:



     registerMe
    
The value of this parameter must be true if the load() method of the new loader is to be called by OrbixWeb, rather than explicitly by the programmer.

Notes:

OrbixWeb specific.

See Also:

Other class constructor.



CORBA.LoaderClass.load()


Synopsis:

Description:

When an object fault occurs, the load() method is called on each loader in turn until one of them successfully returns the address of the object, or until they have all returned null.

The responsibility of the load() method is to determine if the required object is to be loaded by the current loader, and if so, then to create the object and assign the correct marker to it.

Parameters:



     interface
    
The interface name of the missing object is determined as follows: if an object fault occurs during the call:

     // Java
     pRef = I1._bind( <parameters> );
    
then the interface name in load() will be "I1". If the first parameter to _bind() is a full object reference string, OrbixWeb will return an exception if the reference's interface field is not I1 or a derived interface of I1.

If an object fault occurs during the call:

     // Java
     pRef = _CORBA.Orbix.string_to_object
     ( <full object reference string> );
    
then the interface name in load() will be that extracted from the full object reference string.

If a loader is called because of a reference entering an address space (as an in, out or inout parameter, a return value, or as the target object of an operation call), then the interface name in load() will be the interface name extracted from the object reference.

The switches passed to the IDL compiler affect how the interface name is seen by load(). See _CORBA.BaseObject._interfaceMarker().

     
    
     marker
    
The marker of the required object.

     isBind
    
Set to true if the object fault occurred because of a call to _bind() or _CORBA.Orbix.string_to_object() by the process itself.

Set to false if the object fault occurred because of an object fault on the target object of an incoming operation invocation, or on an in, out or inout parameter or return value.

Return Value:

Returns the object reference if the object is found.

Notes:

OrbixWeb specific.

See Also:



CORBA.LoaderClass.record()


Synopsis:

Description:

When a programmer names an object by passing a marker name to the TIE or BOAImpl constructor, OrbixWeb calls record() on the object's loader.

A derived class may redefine record() to override the programmer's choice of name.

The default loader, inherits its implementation of record() from LoaderClass. This implementation does not change the chosen name. It may, however, raise an exception if the name is in use (that is, an object with the same interface name and marker name already exists in the server process) and the object consequently can not be registered.

If no marker name is suggested, then the default record() method chooses a name that is a string of decimal digits, different to any generated before in the current process.

Note that a programmer may also name an object using the method CORBA.BaseObject._marker(). In this case, OrbixWeb calls rename() rather than record() on the object's loader.

Notes:

OrbixWeb specific.

See Also:



CORBA.LoaderClass.rename()


Synopsis:

Description:

When a programmer names an object by calling _CORBA.BaseObject._marker(), OrbixWeb calls rename() on the object's loader.

A derived class may redefine rename() to override the programmer's choice of name.

The default loader inherits its implementation of rename() from LoaderClass. This implementation does not change the chosen name. It may, however, raise an exception if the name is in use (that is, an object with the same interface name and marker name already exists in the server process).

Note that an object may also be named by passing a marker name to the TIE or BOAImpl constructor. In this case, OrbixWeb calls record() on the object's loader.

Return Value:

Returns true if the object is successfully renamed.

Notes:

OrbixWeb specific.

See Also:



CORBA.LoaderClass.save()


Synopsis:

Description:

Immediately before process termination, a programmer may invoke the method CORBA.ORB.finalize() on the _CORBA.Orbix object. OrbixWeb then iterates through all of the objects in its object table and calls save() on the loader associated with each object. A loader may save the object to persistent storage (either by calling a method on the object, or by accessing the object's data).

The associated loader's save() method is also called when an object is destroyed using CORBA.BOA.dispose(); and a programmer can call it explicitly for an object by calling its CORBA.BaseObject._save() method. CORBA.BaseObject._save() simply calls the save() method on the object's loader. The _save() method must be called in the same address space as the target object: calling it in a client process, that is, on a proxy, will have no effect.

Parameters:



     obj
    
The object on whose loader is save() is being called.

     reason
    
The reason that save() has been called. This may be:

_CORBA.processTermination: The process is about to exit.

_CORBA.explicitCall: The object's _save() method has been called.

_CORBA.objectDeletion: CORBA.BOA.dispose() has been called on the object.

Notes:

OrbixWeb specific.

See Also:



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