In S, facilities for attaching naming contexts from the naming service as regular S databases allow CORBA objects to be used as local variables. Also, methods can be invoked on these objects using a notation similar in spirit to C++/Java
server$method(...)
See Getting Started
and other documents for a description of installing
and using the S and R CORBA interfaces.
The DII provides three different classes for invoking requests. These are one-way, blocking and deferred. These are explained in the CORBA documentation and are somewhat suggestive of their behavior.
call = new CorbaCall(server, "methodName", new Object[]{arg, arg, arg});
call.result();
We provide syntactic sugar for the interactive user
to allow the same call to be specified
interactively as
Server.methodName(arg,arg,arg);where
Server is accessed directly from the
CORBA Naming Service.
This utilizes the extensibility of the parser, evaluator and
expression classes and the facility to attach general objects
as databases in the search path.
Calls involving primitive-type arguments (e.g
String, int, double,...
and their corresponding class-based versions
Integer, Double)
are handled automatically by the default
CorbaConverter.
Non-primitive objects can be either compiled from the CORBA stubs and
skeletons
or more easily by arranging for
DynamicJavaObject class
as a proxy, or
Evaluator
corresponding to the CORBA methods, each taking the local server
object as the argument.
BasicDynamicOmegaObject class is used as the
dynamic proxy.
The local non-primitive arguments in a CORBA call are automatically
converted to dynamic CORBA objects using one of these dynamic proxy
classes.
This is controlled by the CorbaConverter
which can be extended programmatically or customized
using properties mapping local classes
to CORBA classes.
This is explained in more detail in other documents.
The basic points are:
NamingService class provides a
simplified interface to the CORBA NamingContext class.
There are methods accept Strings and
String[] rather than NameComponents.
Similalry, many of the exceptions are handled locally
and re-assignments performed without the need to remove the original
object.
Perhaps more important to the user is that
NamingServiceDatabase objects (which extend
NamingService) can be attached to the Evaluator's SearchPath. In this way, objects in that
naming context can be referenced directly as local Omega variables.
When the top-level name server is attached, objects within it can be
used simply by referring to their name. The usual search rules of the
Evaluator apply. (See the NameServerViewer Tool
for more information about examining the contents of the Naming Service.)
[1] orb = ORB.init(commandLine(), System.getProperties()); com.ooc.CORBA.ORB@80cdd48 [2] attach(new NamingServiceDatabase(orb),0) org.omegahat.Environment.Databases.AttachedDatabase@80ce90d [3] objects() A z Trace delta GlobalServer ... Call Center Server Wafers [4] [5] Server com.ooc.CORBA.StubForObject@80ce2df [6] A org.omegahat.Interfaces.CORBA.NamingService@80ce028The object
A illustrates that Naming Contexts can be
nested in the CORBA naming service. Accordingly, referring to CORBA objects in the naming service
may involve specifying nested qualifiers. The
NamingService supports the
DynamicFieldAccessInt interface which allows nested
qualifiers to evaluate to the appropriate object. For example, to
obtain the object c in the naming context B
which is itself contained in the naming context A, the
Omegahat language supports
A.B.cNamingService object.
This can be converted to a NamingServiceDatabase
by passing it to that class' constructor.
As objects can be retrieved from NamingServiceDatabase
objects, they can also be assigned in the same.
For example, the commands
A.foo = Server bar = new TraceServer()binds the name
foo in the
NamingContext named A
with the CORBA object Server
retrieved from the top-level
NamingServiceDatabase attached
in the SearchPath
and the second binds
a newly created CORBA Object to the name
bar. If the default database
is a NamingServiceDatabase object,
other applications can see this object.
When the attaching of NamingServiceDatabase is used in conjunction with the CORBA-extended grammar mentioned above, CORBA invocations appear identical to local method invocations and their complexity is hidden (except when errors occur!).
Errors can manifest themselves as Exceptions when
non-existent objects are retrieved from a NamingContext
or when new objects are assigned to a NamingContext
before a BOA has been initialized.
Evaluator's search path.
Evaluator classes that provide this syntactic
sugar to make the CORBA access appear as local calls, etc. These are
CorbaAugmentedEvaluator and
OrbacusEvaluator. The former provides the connection to
the ORB and the facilities for obtaining the toplevel
NamingServiceDatabase and
AttachableInterfaceRepository and attaching the former
simply. For experimenting with CORBA, I suggest that you change
the configuration OmegaOptions file
to use one of these.
Both components connect to the appropriate default top-level
server. However, they can also be instantiated with sub-servers
(e.g. sub-NamingContexts
or IR Container objects) so that small segments of the
overall contents can be viewer.
Interface Repository Viewer |
Name Server Viewer |
|---|---|
![]() |
Note the entry delta
is being edited. The enter key in this textfield
commits the renaming change in the CORBA name server.
|
| omega -CORBA -ix InterfaceRepository.IRViewer | omega -CORBA -ix NameServer.NameServerViewer |
object_to_string() method it supports. The slight expense
of converting between this and the native reference should not be
overwhelming.
u = new URL("http://piglet/IR.ref");
s = u.openConnection().getContent();
r = new BufferedReader(new InputStreamReader(s));
r.readLine();

The benefits of this approach include
Saikat DebRoy, Jose Pinheiro, Greg Warnes, John Chambers and I have used this to implement a distributed bootstrap for LME setup. While the server code (LME material) was written in Java, the distributed task management can be used to control arbitrary (and non-homogeneous) CORBA servers and tasks. Thus, it can be used to distribute R/S computations across a cluster. The primitives exist for implementing the task management in those languages. See getRequestValue, .Corba, etc.