1 26 package org.objectweb.openccm.explorer.Deployment; 27 28 import org.objectweb.openccm.explorer.CORBA.TypageCORBA; 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.Components.CCMHome; 33 import org.omg.Components.Deployment.Container; 34 35 43 public class ContainerContext 44 implements Context { 45 46 52 58 64 67 protected String getName(org.omg.CORBA.Object o) { 68 TypageCORBA tc = new TypageCORBA(o, org.objectweb.openccm.corba.TheORB.getORB()); 69 return tc.getTypeID(); 70 } 71 72 78 public Entry[] getEntries(Object object) { 79 Container container = (Container) object; 80 CCMHome[] objects = container.get_homes(); 81 Entry[] values = new Entry[objects.length]; 82 for (int i = 0; i < objects.length; i++) 83 values[i] = new DefaultEntry(getName(objects[i]) + " (" + i + ")", objects[i]); 84 return values; 85 } 86 87 } 88 | Popular Tags |