Developing a CORBA Interface to ACeDB
Steps in Creating a CORBA System:
- Create an idl
- Generate stubs and skeletons in the language(s) of choice
- Write implementation code for server object
- Write "driver" server application
- Write client
- Start server
- Start client
- Let's go corba now, everybody's learning how...
Create IDL
This is the hard bit, and was mostly taken care of by the libace c api inspired
by Gregg Miller. We wrapped the libace library into IDL, with only minor
modifications (changes due to client/server context and adding exceptions,
etc.). There are no semantics in the current IDL, as it provides a kind of
"clear window" into the ace database; where to put the semantics
is an ongoing discussion. Here is the current version
of the IDL. Comments encouraged.
Generate stubs and skeletons in the language(s) of choice
This is highly orb-specific. We used Visigenic's VisiBroker for Java 2.5 as
a client orb and Object-Oriented Concepts' Object Broker for C++ as a server
orb. Each orb has a program that parses the idl file and creates stubs and
skeletons in the target language. As long as there are no syntax errors in
the IDL, this bit is trivial.
Write implementation code for server object
In our current IDL this involves merely writing wrapper methods around the
libace library functions. There is some typecasting done to convert
c types into orb-specific CORBA types, for memory management purposes. I
also wrapped the aceErrorMessage into aceExceptions that get thrown to the
client program. Here is the header file for the
implementation, and here is the body.
Write "driver" server application
This involves writing an application that initializes the corba service,
starts up the implementation object, stores a reference pointer to the
object in a findable place (in a text file on a web server for now, on a
naming service in the future), and waits around for client connections. This
code is partly orb-specific, but the general structure is fairly consistent
across orbs. Here is the current server program
code.
Write client
This involves connecting to the corba service and retrieving a reference
to the served object, and then treating the served object just like a
local one. So far we're just exercising a few functions from the
acelib library, but once the library and our server are completed we
should be able to write a fully functioning java display on top of a
corba client. Here is our current
client code.
Start your engines...
Getting the corba service going involves the following:
- Start the server program. The server program should:
- Start the corba service (using some orb-specific magic phrases).
- Instantiate an instance of the served object (the one from the server
implementation code).
- Store a reference to the served object somewhere. At the moment we
are storing it as a stringified object reference written to a text file, served
by an html server.
- Wait.
- Start the client program. The client program should:
- Start it's own corba "agent," if one is not already running on the
client machine. The agent handles actually finding the corba service.
- Grab a reference to the served object from wherever the server stored it.
- Use the served object as a local one.
Issues to resolve
- Completion of current IDL and library;
- Refinded and/or semantically rich IDL's;
- Memory management and CORBA;
- Naming services and traders as a place to store object references;
- Architecture for a sharable, appropriately generic system;
- Finding other issues to resolve.