Horus Doc || Database Reference || VxSegmentation   CorbaServer   Maintenance  

Java Structure

dbJavaClasses.gif

Java Structure of DatabaseServer

Operations interfaces and Tie servants

Usually servants for a Aaa CORBA Object are implemented as classes that extend the corresponding AaaPOA class (generated by the compiler), but all the servants described above implement AaaOperations instead. Why?

This is that way to be able to implement a servant for a Bbb CORBA Object (where the interface Bbb inherits from the interface Aaa) extending the servant for Aaa (because we don't want to implement again the operations of Aaa in the servant for Bbb).

AaaServant class extends AaaPOA class, but BbbServant class can not be implemented extending both AaaServant and BbbPOA, because Java classes can only extend one class. The solution is implementing BbbServant as a class that extends AaaServant and implements BbbOperations. This BbbServant class is not yet a servant for Bbb, because BbbPOA is not in its inheritance tree. But it can be used to instantiate a BbbPOATie class, and then we have finally a servant for Bbb.

dbJavaTie.gif

Using Tie classes to implement extensible servants

To be consistent, AaaServant could be implement AaaOperations instead of extending AaaPOA, and be used with a AaaPOATie. Then all servants are implemented the same way.

Default servants

From a client point of view, the server contains a different CORBA object for each "entity" (or "entry") of the database: an object for each segmentation, an object for each segment, etc...

But the server can not keep a servant for each "entry" of the database: it would be quite expensive.

The solution is to use a single servant for all "entities" of the same type. These servants are called Default servants. We will have a default servant for segmentations (VxSegmentationServant), a default servant for segments (VxSegmentServant) and so on.

The default servant implements the functionality of multiple objects (all of the same type). These objects have different "state" (the "state" of the object is what we store about it in the database), and the result of the operations of the objects depend on their states. Then, the default servant needs to know which object is calling the client. This is done through the ObjectId.

Each CORBA Object of a server has a different ObjectId. Although objects exist in the server only in a "logical" point of view, not "physically" (because there is no a servant for each object) they still do have an ObjectId. And our servers will choose an ObjectId that will help in accessing the "state" of the objects: ObjectIds will usually be the primary keys of the tables storing the objects.

When a default servant receives a request, it will obtain the ObjectId of the object that is being called, access the "state" of the object through this ObjectId and process the request based on this "state".

Next we will see how OracleServer and MySQLServer have been built using all these classes.


Go to the next section or return to the index.


Generated on Mon Jan 27 15:11:57 2003 for DatabaseReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001