Class Connection

java.lang.Object
  extended by Connection

public class Connection
extends java.lang.Object

Establishes a connection to the CORBA server RockFactory object.

Version:
1.0 (August 2007)
Author:
Mark S. Ghiorso, OFM-Research Inc.

Constructor Summary
Connection()
          Class initializer.
 
Method Summary
 org.omg.CORBA.Object getObjectReference(org.omg.CORBA.ORB orb, org.omg.CosNaming.NameComponent[] name)
          Obtain a generic object reference from the CORBA nameserver.
 org.omg.CORBA.ORB getORB(java.applet.Applet myapplet)
          Obtains the Object Request Broker for the Applet.
 org.omg.CORBA.ORB getORB(java.lang.String[] args, java.util.Properties props)
          Obtains the Object Request Broker for the standalone application.
 rock.RockFactory getRockFactory(org.omg.CORBA.ORB orb)
          Obtain a RockFactory object reference from the CORBA nameserver.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Connection

public Connection()
Class initializer.

Method Detail

getORB

public org.omg.CORBA.ORB getORB(java.applet.Applet myapplet)
Obtains the Object Request Broker for the Applet. The applet must originate from a web server that is running a CORBA nameservice and rockFactory server.

Parameters:
myapplet - Applet instance.
Returns:
ORB reference.

getORB

public org.omg.CORBA.ORB getORB(java.lang.String[] args,
                                java.util.Properties props)
Obtains the Object Request Broker for the standalone application.

Parameters:
args - Command line arguments.
props - Properties defined for ORB initialization call. Two properties must be set: org.omg.CORBA.ORBInitialPort to the CORBA nameserver port number (usually 2809) and org.omg.CORBA.ORBInitialHost to the IP address of the CORBA nameServer.
Returns:
ORB reference.

getObjectReference

public org.omg.CORBA.Object getObjectReference(org.omg.CORBA.ORB orb,
                                               org.omg.CosNaming.NameComponent[] name)
                                        throws java.lang.Exception
Obtain a generic object reference from the CORBA nameserver.

Parameters:
orb - ORB reference retuned from getORB.
name - Description of CORBA server object.
Returns:
Instance of requested server object.
Throws:
java.lang.Exception - CORBA connection error. Description output to System.err.

getRockFactory

public rock.RockFactory getRockFactory(org.omg.CORBA.ORB orb)
                                throws java.lang.Exception
Obtain a RockFactory object reference from the CORBA nameserver.

Parameters:
orb - ORB reference retuned from getORB.
Returns:
Instance of requested RockFactory object.
Throws:
java.lang.Exception - CORBA connection error. Description output to System.err.