1 28 29 30 package org.objectweb.corba.runtime; 31 32 35 public class POAServiceImpl 36 extends org.omg.CORBA.LocalObject 37 implements POAService 38 { 39 static final private String _class_name = "POAServiceImpl"; 41 static final private String _service_id = POAService.SERVICE_ID; 42 private ORBService _orb_service; 43 private org.omg.PortableServer.POA _poa; 44 45 public 47 POAServiceImpl(org.omg.PortableServer.POA poa) 48 { 49 _orb_service = null; 51 _poa = poa; 52 } 53 54 58 final public void 59 system_configuration_complete(SystemConfiguration cfg) 60 { 61 POAConfiguration poacfg = (POAConfiguration)cfg; 62 _orb_service = poacfg.orb_service(); 63 } 64 65 final public void 66 destroy() 67 { 68 _poa.destroy(true, true); 73 } 74 75 79 final public String 80 service_id() 81 { 82 return _service_id; 83 } 84 85 89 final public void 90 activate_servant_with_id(Servant serv, byte[] oid) 91 { 92 org.omg.PortableServer.Servant nserv = null; 94 nserv = serv.as_native_servant(); 95 96 try { 98 _poa.activate_object_with_id(oid, nserv); 99 } catch (Exception ex) { 100 final String opname = "activate_servant_with_id"; 101 TheLogger.error(_class_name, opname, "FAILED", ex); 102 } 103 } 104 105 final public void 106 deactivate_servant(byte[] oid) 107 { 108 try { 110 _poa.deactivate_object(oid); 111 } catch (Exception ex) { 112 final String opname = "deactivate_servant"; 113 TheLogger.debug(_class_name, opname, "IGNORE", ex); 114 } 115 } 116 117 final public org.omg.CORBA.Object 118 create_ref(String repid) 119 { 120 byte[] oid = Double.toString(Math.random()).getBytes(); 122 123 return _poa.create_reference_with_id(oid, repid); 125 } 126 127 final public org.omg.CORBA.Object 128 create_ref_with_id(byte[] oid, String repid) 129 { 130 return _poa.create_reference_with_id(oid, repid); 132 } 133 134 final public byte[] 135 get_id_from_ref(org.omg.CORBA.Object ref) 136 { 137 try { 138 return _poa.reference_to_id(ref); 139 } catch (Exception ex) { 140 final String opname = "get_id_from_ref"; 141 TheLogger.error(_class_name, opname, "FAILED", ex); 142 return null; 143 } 144 } 145 } 146 | Popular Tags |