U E D R , A S I H C RSS

코바예제/시계



1.

CORBA . 그 . 구 . ORB 게 구 .

2.

CORBA FRAMEWORK .

3.

간 객 ObjTimeServer getTime() getTime() . CORBA 객 . IDL IDL . IDL ( VisiBroker) ORB . IDL . 각 IDL . ORB Java ORB Java(Stub, Skeleton) . IDL (proxy object) . IDL . ("stand-in") 객 격 객 . . . , 객 고, 고 그 결과 . IDL , 그 . ORB ORB 결과 . .

4. IDL

~cpp 
//TestTimeServer
module TestTimeServer {
    interface ObjTimeServer {
        string getTime();
    };
};

IDL (idl2java) .

5. (implementation object)

IDL . ObjTimeServer_Skeleton.java , . IDL . , . 그 IDL . .

~cpp 
//구    
//TestTimeServerImpl.java
import CORBA.*;

class ObjTimeServerImpl extends TestTimeServer.ObjTimeServer_Skeleton {
// 

//
public ObjTimeServerImpl() { }

//
public String getTime() throws SystemException {
  return ("The current time is : " + current_time);
}

}


6.

고, 구 , 고, .

~cpp 
//   
import CORBA.*;
public class TimeServer_Server {
public static void main(String [] args) {
try {
// ORB 
ORB orb = ORB.init();
.
.

// 구  
ObjTimeServerImpl time_server_obj = new ObjTimeServerImpl(args[0]);
.
.
} catch(SystemException e) {
System.err.println(e);
}
}
}
IOR . .
IOR : 00000012346121112444232....( .)

7.

. CORBA 경, ORB . ORB ORB (pseudo-object) . ORB '' , CORBA . 그 . 객 . 그 . '객 ' , 그 결과 ' '.(IOR) "" 객 . CORBA, ORB object_to_string()과 string_to_object() . CORBA 2.0 ORB . 결과 . 'narrow' . ORB 고 객 CORBA . , 격 객 .

~cpp 
//    
//TimeServer_Client.java
import java.io.*;
import CORBA.*;

public class TimeServer_Client {
public static void main(String [] args) {
try{
//ORB 
ORB orb = ORB.init();
.
.

// 객   ,        .
object myObj = orb.string_to_object(args[0]);
.
.

//     .(narrow down)
TestTimeServer.ObjTimeServer TimeServer = TestTimeServer.ObjTimeServer_var.narrow(obj);

} catch(SystemException e) {
System.err.println(e);
}
}
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:31:19
Processing time 0.0286 sec