CS 696 Emerging Technologies: Distributed Objects |
---|
/opt/OrbixWeb3.0/classes
setenv ORBIXWEB_HOME /opt/OrbixWeb3.0 setenv IT_CONFIG_PATH $ORBIXWEB_HOME setenv LD_LIBRARY_PATH $ORBIXWEB_HOME/bin::/usr/local/lib:/usr/openwin/lib:/usr/lib:/usr/ucblib:/usr/dt/lib set path = ($ORBIXWEB_HOME/bin $path) # if (${?MANPATH} == 1) then setenv MANPATH $ORBIXWEB_HOME/man:$MANPATH else setenv MANPATH $ORBIXWEB_HOME/man endif
interface Greeter { string name(); };
class InheritedGreeter extends _GreeterImplBase { protected String name; public InheritedGreeter( String name) { this.name = name; } public String name() { return name;} }
class TieGreeter implements _GreeterOperations { protected String name; public TieGreeter( String name) { this.name = name; } public String name() { return name;} }
import IE.Iona.OrbixWeb._CORBA; import IE.Iona.OrbixWeb.CORBA.ORB; public class GreeterServer { public static void main (String args[]) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); Greeter upTown = null; Greeter mountain = null; try { upTown = new _tie_Greeter( new TieGreeter( "Upton"), "up"); mountain = new InheritedGreeter( "Mike", "high"); _CORBA.Orbix.impl_is_ready( "WhitneyTest" ); System.out.println("Server going Down"); } catch ( org.omg.CORBA.SystemException corbaError) { System.out.println("Exception " + corbaError); } } }
import IE.Iona.OrbixWeb._CORBA; import org.omg.CORBA.ORB; public class GreeterClient { public static void main(String args[]) { _CORBA.Orbix.setDiagnostics(3); ORB.init(); String hostname = "rohan.sdsu.edu"; Greeter serverObject; serverObject = GreeterHelper.bind( ":WhitneyTest", hostname); System.out.println( ":WhitneyTest\n" + serverObject.name() ); serverObject = GreeterHelper.bind( "up:WhitneyTest", hostname); System.out.println( "up:WhitneyTest\n" + serverObject.name() ); serverObject = GreeterHelper.bind( "high:WhitneyTest", hostname); System.out.println( "high:WhitneyTest\n" + serverObject.name() ); } }
idl Greeter.idl2. Place the implementation files from above into the java_output directory created from above
javac *.java4. Register the server
putit WhitneyTest -j -addpath /home/ma/whitney/languages/java/whitney/corba/examples/firstExample/java_output GreeterServer
putit ServeName -j -addpath paths_to_add_to_the_classpath_for_the_server ServerClass
java GreeterServer
java GreeterClient
_CORBA.Orbix.setDiagnostics(X);
Name : WhitneyTest Comms : xdr/tcp Activation : shared Owner : whitney Launch : ; Invoke : ; ImpRep Version : 2 no. of servers : 1 server's port : 0 Marker Launch Command * ###ORBIXWEB### -addpath /home/ma/whitney/languages/java/whitney/corba/examples/firstExample/java_output GreeterServer