1 26 package org.objectweb.openccm.explorer.CORBA; 27 28 29 import org.objectweb.util.explorer.api.Context; 30 import org.objectweb.util.explorer.api.Entry; 31 import org.objectweb.util.explorer.core.naming.lib.DefaultEntry; 32 import org.omg.PortableServer.POA ; 33 34 42 public class POAContext 43 implements Context 44 { 45 46 52 58 64 protected Entry getLocalEntry(String name, POA poa) { 65 if (poa != null) { 66 Object value = getLocalValue(name, poa); 67 return (value != null) ? new DefaultEntry(name, value) : null; 69 } 70 return null; 71 } 72 73 protected Object getLocalValue(String name, POA poa) { 74 if (poa != null) { 75 POA obj = null; 76 try { 77 obj = poa.find_POA(name, false); 78 } catch (org.omg.PortableServer.POAPackage.AdapterNonExistent e) { 79 System.out.println("AdapterNonExistent"); 80 } 81 return obj; 82 } 83 return null; 84 } 85 86 92 96 public Entry[] getEntries(Object object) { 97 POA poa = (POA )object; 98 POA [] objects = poa.the_children(); 99 Entry[] values = new Entry[objects.length]; 100 for (int i = 0; i < values.length; i++) 101 values[i] = getLocalEntry(objects[i].the_name(), poa); 102 return values; 103 } 104 105 } 106 | Popular Tags |