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 storesuch 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.// Java package IE.Iona.Orbix2.CORBA; public class LoaderClass { // Constructors. public LoaderClass(); public LoaderClass(boolean registerMe); // Methods. public _ObjectRef load (String interfaceMarker, String marker, boolean isBind) throws SystemException; public void save (_ObjectRef obj, int reason) throws SystemException; public void record (_ObjectRef obj, StringHolder marker) throws SystemException; public boolean rename (_ObjectRef obj, StringHolder marker) throws SystemException; }
public LoaderClass();
LoaderClass
constructor has protected accessa programmer can not, therefore, create a direct instance of class LoaderClass
.
public LoaderClass(boolean registerMe);
LoaderClass
constructor has protected accessa programmer can not, therefore, create a direct instance of class LoaderClass
.
|
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.
|
CORBA.LoaderClass.load()
Other class constructor.
public _ObjectRef load (String interfaceMarker,
String marker, boolean isBind)
throws SystemException;
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.
CORBA.ORB.string_to_object()
CORBA.LoaderClass.save()
CORBA.BaseObject._interfaceMarker()
public void record (_ObjectRef obj, StringHolder marker)
throws SystemException;
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.
CORBA.LoaderClass.rename()
public boolean rename (_ObjectRef obj, StringHolder marker)
throws SystemException;
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.
true
if the object is successfully renamed.
CORBA.LoaderClass.record()
CORBA.BaseObject._marker()
public void save (_ObjectRef obj, int reason) throws SystemException;
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.
CORBA.BaseObject._save() CORBA.LoaderClass.load()