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); } } }
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); } } }