|
Server.java |
// Building Distributed Object Applications with CORBA // Infowave (Thailand) Co., Ltd. // http://www.waveman.com // Jan 1998 public class Server {
org.omg.CORBA.BOA boa = null;
Ship.AircraftCarrier carrier = new AircraftCarrierImpl("Nimitz"); try {
System.out.println(carrier + " ready for launch !!!"); try {
|
AircraftCarrierImpl.java |
// Building Distributed Object Applications with CORBA // Infowave (Thailand) Co., Ltd. // http://www.waveman.com // Jan 1998 public class AircraftCarrierImpl extends Ship._AircraftCarrierImplBase
{
public AircraftCarrierImpl() {
public Ship.Aircraft launch(String name) {
System.out.println(aircraft + " launched on Catapult 2"); return aircraft;
|
AircraftImpl.java |
// Building Distributed Object Applications with CORBA // Infowave (Thailand) Co., Ltd. // http://www.waveman.com // Jan 1998 public class AircraftImpl extends Ship._AircraftImplBase {
public AircraftImpl(String codeNumber) {
public String codeNumber() {
public void attitude(org.omg.CORBA.IntHolder altiude, String
direction) {
// otherwise no change in altitude
|
Building the server: Create a directory and place Ship.idl, Server.java, AircraftCarrierImpl.java, and AircraftImpl.java into it.
|
prompt> idl2java Ship.idl prompt> vbjc Server.java |
Running the program: You should have previously built the client.
|
prompt> osagent prompt> vbj Server prompt> vbj Client Nimitz "Ghost 202" |