Java and Corba
Integrating Java and CORBA: A programmer's perspective
Before you can start, download and unzip this zip-File to an arbitrary directory (we will refer to this directory as <dir>). Add <dir> to your classpath (set classpath=<dir>;%classpath%). You should also have JDK 1.3 (available online at http://java.sun.com/j2se/1.3/) installed on your machine. Make sure that the directories containing the JDK binaries (eg. C:\jdk1.3\bin;C:\jdk1.3\jre\bin) are in your PATH. If not, do so by entering set path=C:\jdk1.3\bin;C:\jdk1.3\jre\bin;%path%.
The RMI Example
- Change into directory:cd <dir>
- Compile the classes: javac example\rmi\*.java; javac example\rmi\ui\*.java
- Generate stubs and skeletons: rmic example.rmi.ChatRoomImp; rmic example.rmi.UserImp
- Start the RMI naming service: rmiregistry.exe
- Start a chat room server: java example.rmi.ChatRoomImp <name to register>
- Start a chat client: java example.rmi.ui.ChatClient
- Provide the URL of the chat room server (eg.rmi://<host>/<name to register>) and your desired username
(This blocks your current command window. Therefore, you may prefix the command with start to allow a new command window to be created)
(A window like the one below should open)
The RMI-over-IIOP Example
- Change into directory:>cd <dir>
- Compile the classes: javac example\rmiiiop\*.java; javac example\rmiiiop\ui\*.java
- Generate stubs and ties: rmic -iiop example.rmiiiop.ChatRoomImp; rmic -iiop example.rmiiiop.UserImp
- Start the transient naming service: tnameserv.exe
- Start a chat room server (one line):
- Start a chat client (one line):
- Provide the name of the chat room server specified on server startup (<name to register>) and your desired username
java -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory \\
-Djava.naming.provider.url=iiop://localhost:900 \\
example.rmiiiop.ChatRoomImp <name to register>
(This blocks your current command window. Therefore, you may prefix the command with start to allow a new command window to be created)
java -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory \\
-Djava.naming.provider.url=iiop://localhost:900 \\
example.rmiiiop.ui.ChatClient
(A window like the one below should open)
Java RMI and CORBA Resources
Java Remote Method Invocation (RMI) Homepage | http://java.sun.com/j2se/1.3/docs/guide/rmi/index.html |
RMI Specifications | http://java.sun.com/j2se/1.3/docs/guide/rmi/spec/rmiTOC.html |
RMI Tutorials | http://java.sun.com/j2se/1.3/docs/guide/rmi/getstart.doc.html http://java.sun.com/j2se/1.3/docs/guide/rmi/rmisocketfactory.doc.html http://java.sun.com/j2se/1.3/docs/guide/rmi/activation.html |
OMG Homepage | http://www.omg.org/ |
RMI over IIOP at Sun | http://java.sun.com/products/rmi-iiop/index.html |
CORBA Language Mapping Specifications | http://www.omg.org/technology/documents/formal/corba_language_mapping_specifica.htm |
Java IDL | http://java.sun.com/j2se/1.3/docs/guide/idl/index.html |
RMI over IIOP at IBM | http://www.ibm.com/java/jdk/rmi-iiop/ |
CORBA Technology and the Java Platform | http://java.sun.com/j2ee/corba/ |
Objects-by-Value Specification | ftp://ftp.omg.org/pub/docs/orbos/98-01-18.pdf |