CORBAservices are widely available object services that virtually all CORBA objects are most likely to use.
-
Event Notification, Persistence, Lifecycles, Naming, Concurrency Control, Relationships, Transactions, Collections, Externalization, Time, Security, Query Service, Licensing, Trading, Change Management, Properties
|
CORBAfacilities are commonly occurring object frameworks that many CORBA applications could possibly use
-
Facilities that possess a wide user-base are known as Horizontal Facilities.
-
User Interface, Information Management, Systems Management, Task Management.
-
Others that one would expect to see a wide use by the market, or by the industry, are referred to as Vertical Facilities.
-
Imagery, Internet, Computer Integrated Manufacturing, Distributed Simulation, Finance and Accounting, Application Development, Mapping, Telecommunications, Health Care Providers
|
The jdceMessageQueue is implemented as a Linked List for faster operations of addition/removal of messages.
|
The message queue provides for reporting availability of data on the queuebesides providing for returning the queue Contents as a stream of bytes or an array of Strings.
|
The queue has a in-lined class the QueueEnumerator which provides an Enumeration of the QueueContents.
|
The queueWidget has pointers to the preceeding Element and the elements successor.
-
class QueueWidget {
-
Object object;
-
QueueWidget prev;
-
QueueWidget next;
-
QueueWidget(Object object,
-
QueueWidget queueWidget1, QueueWidget queueWidget2) {
-
this.object = object;
-
prev = queueWidget1;
-
next = queueWidget2; } }
|
Besides the operations mentioned above, the queue provides for handling priority messages expressed by the addItemToTop() method.
|
Starting the Active Object Server, the default port it binds to is 14000 % osagent
|
Starting the Gatekeeper which acts as a HTTP-tunneler for Callbacks through firewalls, the default port it runs on is 15000 % gatekeeper
|
Starting up the RMIregistry on some port, (ports less than 1024 require administrative priveleges) say 7000 % rmiregistry 7000
|
Starting the Naming Service, with the nameContext Root as JDCE %java -DORBservices=CosNaming -DSVCnameroot=JDCE -DJDKrenameBug com.visigenic.vbroker.services.CosNaming.ExtFactory JDCE namingLog
|
Starting the main Object Server, which starts up both the RMI/CORBA sessionScheduler. %java -DORBservices=CosNaming -DSVCnameroot=JDCE jdce.impl.corba.sessionServer
|
CORBA Binding Process. private void getSessionSchedulerHandle() {
|
try {
|
// Initialize the ORB.
|
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(this, null);
|
// Calculate Start time
|
long startTime = System.currentTimeMillis();
|
// Bind to the Scheduler Object
|
/* Get a reference to the Naming Service */
|
org.omg.CORBA.Object nameServiceObj =
|
orb.resolve_initial_references("NameService");
|
if (nameServiceObj == null) {
|
System.out.println("Name Service Object = null");
|
return; }
|
org.omg.CosNaming.NamingContext nameService =
|
org.omg.CosNaming.NamingContextHelper.narrow (nameServiceObj);
|
if (nameService == null) {
|
System.out.println("nameService = null");
|
return; }
|
NameComponent[] collabName =
|
{ new NameComponent("Collaboration", "Scheduler")};
|
_chatSession=
|
jdce.scheduler.sessionSchedulerHelper.narrow (nameService.resolve(collabName));
|
} catch(Exception e) {
|
System.out.println("Exception: " + e); } }
|
RMI Binding Process
|
|
private void getSessionSchedulerHandle() {
|
try {
|
remoteObject =
|
Naming.lookup(
|
"rmi://jojo.npac.syr.edu:7000/Scheduler");
|
} catch (java.lang.Exception exec) {
|
System.out.println( "Unable to lookup created Scheduler");
|
}
|
_chatSession = (jdce.scheduler.RMISessionScheduler) remoteObject;
|
}
|
public void getDataBahnHandle() {
|
try {
|
_chatSession.createBahn(partyName, "Chat");
|
System.out.println("New Party created");
|
} catch (jdceBahnException e) {
|
System.out.println("Exception in creations" +e);
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
long startTime = System.currentTimeMillis();
|
try {
|
// Initialize the ORB.
|
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(this, null);
|
|
/* Get a reference to the Naming Service */
|
org.omg.CORBA.Object nameServiceObj =
|
orb.resolve_initial_references("NameService");
|
if (nameServiceObj == null) {
|
System.out.println("Name Service Object = null");
|
return;
|
}
|
org.omg.CosNaming.NamingContext nameService =
|
org.omg.CosNaming.NamingContextHelper.narrow(nameServiceObj);
|
|
if (nameService == null) {
|
System.out.println("nameService = null");
|
return;
|
}
|
NameComponent[] collabName =
|
{ new NameComponent("Collaboration", partyName+"Chat"+"Coordinator")};
|
|
_chatBahn=
|
jdce.byteways.dataBahnHelper.narrow (nameService.resolve(collabName));
|
} catch(Exception e) {
|
System.out.println("Exception: " + e);
|
}
|
long stopTime = System.currentTimeMillis();
|
System.out.println("Avg Ping to invoke = "
|
+ ((stopTime - startTime)/1000f) + " msecs");
|
}
|
public void getDataBahnHandle() {
|
try {
|
_chatSession.createBahn(partyName, "Chat");
|
System.out.println("New Party created");
|
} catch (jdceRMIBahnException e) {
|
System.out.println("Exception in creations" +e);
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
|
// long startTime = System.currentTimeMillis();
|
|
try {
|
_chatBahn = _chatSession.getDataBahnHandle(partyName, "Chat");
|
} catch (jdceRMIBahnException e) {
|
System.out.println("Exception in creations" +e);
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
}
|
{ // Initialize the ORB. org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(thisClient);
|
// Create the ClientControl object. ClientControlImpl control = new ClientControlImpl(thisClient); orb.connect(control);
|
try { /* Get a reference to the Naming Service */ org.omg.CORBA.Object
|
nameServiceObj = orb.resolve_initial_references("NameService");
|
if (nameServiceObj == null) {
|
System.out.println("Name Service Object = null");
|
return; }
|
org.omg.CosNaming.NamingContext nameService = org.omg.CosNaming.NamingContextHelper.narrow(nameServiceObj);
|
if (nameService == null) {
|
System.out.println("nameService = null"); return; }
|
NameComponent[] collabName =new NameComponent ("Collaboration", thisClient.partyName+"Chat"+"Coordinator")
|
};
|
System.out.println(thisClient.partyName+"Chat"+"Coordinator");
|
try { int id= thisClient._chatBahn.register(thisClient.clientName, control);
|
thisClient.clientID=id;
|
System.out.println("Registration Succeeded");
|
} catch (jdceRMIBahnException e) {
|
System.out.println(e.typeToString(e.getType()));
|
System.out.println("Registration Failed"); }
|
catch (jdceRMIClientException e){}
|
catch (RemoteException e) {
|
System.out.println("OPOOOOuch!!");
|
}
|
}
|