Java Reference
In-Depth Information
catch (Exception ex)
System.out.println("*** Server error! ***");
class HelloServant extends _HelloImplBase
public String getGreeting()
return ("Hello there!");
5. Compile the server and the idlj-generated fi les.
From the directory above directory SimpleCORBAExample , execute the following
command within a command window:
javac SimpleCORBAExample\*.java
(Correct errors and recompile, as necessary.)
6. Create a client.
Our client program will be called and, like the server program, will
import package SimpleCORBAExample . It should also import two of the three CORBA
packages imported by the server: org.omg.CosNaming and org.omg.CORBA . There are
several steps required of the client, most of them being identical to those required of the
server, so the explanations given for the server in step 4 above are not repeated hereā€¦
(i) Create and initialise the ORB .
ORB orb = ORB.init(args,null);
(ii) Get a reference to the root naming context .
org.omg.CORBA.Object objectRef =
(iii) 'Narrow' the context reference .
NamingContext namingContext =
(iv) Create a NameComponent object for our interface .
NameComponent nameComp =
new NameComponent("Hello", "");
Search WWH ::

Custom Search