1 28 29 30 package org.objectweb.corba.logservice; 31 32 import org.objectweb.corba.runtime.*; 33 34 42 public class LogCurrentImpl 43 extends org.omg.CORBA.LocalObject 44 implements LogCurrent 45 { 46 private org.omg.PortableInterceptor.ORBInitInfo _info; 48 private int _slot_id; 49 private String _orb_id; 50 51 public 52 LogCurrentImpl(org.omg.PortableInterceptor.ORBInitInfo info, 53 int slotid, 54 String orbid) 55 { 56 _info = info; 57 _slot_id = slotid; 58 _orb_id = orbid; 59 } 60 61 65 private org.omg.PortableInterceptor.Current 66 getPICurrent() 67 { 68 org.omg.CORBA.Object obj = null; 69 org.omg.PortableInterceptor.Current current = null; 70 try { 71 obj = _info.resolve_initial_references("PICurrent"); 72 } catch (org.omg.PortableInterceptor.ORBInitInfoPackage.InvalidName ex) { 73 } catch (Exception ex) { 74 System.err.println("!!! LogCurrentImpl::getPICurrent exception caught: "+ex.getMessage()); 75 } catch (Error err) { 76 System.err.println("!!! LogCurrentImpl::getPICurrent error caught: "+err.getMessage()); 77 } 78 79 return org.omg.PortableInterceptor.CurrentHelper.narrow(obj); 80 } 81 82 private org.omg.CORBA.Any 83 extractId() 84 { 85 System.err.println("### LogCurrentImpl::extractId called"); 87 try { 88 return getPICurrent().get_slot(_slot_id); 89 } catch (org.omg.PortableInterceptor.InvalidSlot ex) { 90 System.err.println("!!! LogCurrentImpl::extractId slot_id does not exists: "+_slot_id); 91 } 92 93 return null; 94 } 95 96 private void 97 insertId(org.omg.CORBA.Any id) 98 { 99 System.err.println("### LogCurrentImpl::insertId called"); 101 try { 102 getPICurrent().set_slot(_slot_id, id); 103 } catch (org.omg.PortableInterceptor.InvalidSlot ex) { 104 System.err.println("!!! LogCurrentImpl::insertId slot_id does not exists: "+_slot_id); 105 } 106 } 107 108 112 final public org.omg.CORBA.Any 113 current_id() 114 { 115 return extractId(); 116 } 117 118 final public void 119 current_id(org.omg.CORBA.Any cid) 120 { 121 insertId(cid); 122 } 123 } 124 | Popular Tags |