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.PublisherDescription; 34 import org.omg.Components.SubscriberDescription; 35 36 43 public class PublisherContext 44 implements Context { 45 46 52 58 64 protected String getName(org.omg.CORBA.Object o) { 65 TypageCORBA tc = new TypageCORBA(o, org.objectweb.openccm.corba.TheORB.getORB()); 66 return tc.getTypeID(); 67 } 68 69 75 78 public Entry[] getEntries(Object object) { 79 PublisherContainer publisher = (PublisherContainer)object; 80 PublisherDescription publisherDesc = (PublisherDescription) publisher.getPublisher(); 81 SubscriberDescription[] sd = publisherDesc.consumers; 82 Entry[] values = new Entry[sd.length]; 83 for (int i = 0; i < sd.length; i++) { 84 SubscriberContainer sc = new SubscriberContainer(); 85 sc.setSubscriber_(sd[i]); 86 sc.setPublisherContainer_(publisher); 87 values[i] = new DefaultEntry("Connection (" + i + ")", sc); 88 } 89 return values; 90 } 91 92 } 93 | Popular Tags |