1 26 package org.objectweb.openccm.explorer.Components; 27 28 29 import org.objectweb.openccm.explorer.CORBA.TypageCORBA; 30 import org.objectweb.util.explorer.api.Context; 31 import org.objectweb.util.explorer.api.Entry; 32 import org.objectweb.util.explorer.core.naming.lib.DefaultEntry; 33 import org.omg.Components.ReceptacleDescription; 34 import org.omg.Components.ConnectionDescription; 35 36 43 public class ReceptacleContext 44 implements Context 45 { 46 47 53 59 65 protected String getName(org.omg.CORBA.Object o) { 66 TypageCORBA tc = new TypageCORBA(o, org.objectweb.openccm.corba.TheORB.getORB()); 67 return tc.getTypeID(); 68 } 69 70 76 79 public Entry[] getEntries(Object object) { 80 ReceptacleContainer receptacle = (ReceptacleContainer)object; 81 ReceptacleDescription receptacleDesc = (ReceptacleDescription) receptacle.getReceptacle(); 82 ConnectionDescription[] cd = receptacleDesc.connections; 83 Entry[] values = new Entry[cd.length]; 84 for (int i = 0; i < cd.length; i++) { 85 ConnectionContainer cc = new ConnectionContainer(); 86 cc.setConnection(cd[i]); 87 cc.setReceptacleContainer(receptacle); 88 values[i] = new DefaultEntry("Connection (" + i + ")", cc); 89 } 90 return values; 91 } 92 93 } 94 | Popular Tags |