1 21 package org.jacorb.orb.portableInterceptor; 22 23 import org.omg.PortableInterceptor.*; 24 import org.omg.CORBA.*; 25 import java.util.*; 26 36 37 public class PICurrentImpl extends org.omg.CORBA.LocalObject 38 implements org.omg.PortableInterceptor.Current { 39 40 private Any[] m_slots = null; 41 private ORB m_orb = null; 42 43 47 public PICurrentImpl(ORB orb, int no_of_anys) { 48 m_orb = orb; 49 m_slots = new Any[no_of_anys]; 50 51 for(int _i = 0; _i < m_slots.length; _i++) 52 m_slots[_i] = m_orb.create_any(); 53 } 54 55 58 public PICurrentImpl(PICurrentImpl source){ 59 m_orb = source.m_orb; 60 m_slots = new Any[source.m_slots.length]; 61 62 for(int _i = 0; _i < m_slots.length; _i++){ 63 m_slots[_i] = m_orb.create_any(); 64 ((org.jacorb.orb.Any) m_slots[_i]).insert_object(source.m_slots[_i].type(), 65 ((org.jacorb.orb.Any) source.m_slots[_i]).value()); 66 } 67 } 68 69 public Any get_slot(int id) throws InvalidSlot { 71 if ((id >= m_slots.length) || (id < 0)) 72 throw new InvalidSlot(); 73 74 return (Any) m_slots[id]; 75 } 76 77 public void set_slot(int id, Any data) throws InvalidSlot { 78 if ((id >= m_slots.length) || (id < 0)) 79 throw new InvalidSlot(); 80 81 m_slots[id] = data; 82 } 83 } 85 86 87 88 89 90 | Popular Tags |