1 28 29 package org.objectweb.fractal.explorer.context; 30 31 import java.util.List ; 32 import java.util.Vector ; 33 34 import org.objectweb.fractal.api.Component; 35 import org.objectweb.fractal.api.Interface; 36 import org.objectweb.fractal.api.control.BindingController; 37 import org.objectweb.fractal.explorer.FcExplorer; 38 import org.objectweb.util.explorer.api.Context; 39 import org.objectweb.util.explorer.api.Entry; 40 import org.objectweb.util.explorer.core.naming.lib.DefaultEntry; 41 42 47 public class InterfaceContext 48 implements Context 49 { 50 51 54 public Entry[] getEntries(Interface itf) { 55 List l = new Vector (); 56 Component ci = itf.getFcItfOwner(); 57 Interface bindInterface = null; 58 try { 59 BindingController bc = FcExplorer.getBindingController(ci); 60 bindInterface = (Interface)bc.lookupFc(itf.getFcItfName()); 61 } catch(Exception e) { } 62 if(bindInterface!=null) 63 l.add(new DefaultEntry(FcExplorer.getPrefixedName(bindInterface), bindInterface)); 64 return (Entry[])l.toArray(new Entry[0]); 65 } 66 67 70 public Entry[] getEntries(Object object) { 71 InterfaceWrapper interfaceWrapper = (InterfaceWrapper)object; 72 return getEntries(interfaceWrapper.getItf()); 73 } 74 75 } 76 | Popular Tags |