1 28 29 package org.objectweb.fractal.explorer.context; 30 31 import org.objectweb.fractal.api.Component; 32 import org.objectweb.fractal.api.NoSuchInterfaceException; 33 import org.objectweb.fractal.api.control.ContentController; 34 import org.objectweb.fractal.explorer.FcExplorer; 35 import org.objectweb.util.explorer.api.Entry; 36 import org.objectweb.util.explorer.core.common.api.ContextContainer; 37 import org.objectweb.util.explorer.core.naming.lib.DefaultEntry; 38 39 40 45 public class ComponentContextForAdvanced 46 extends ComponentContextForService 47 { 48 54 60 66 72 76 public Entry[] getEntries(Object object) { 77 Component ci = (Component)object; 78 Entry[] entries = super.getEntries(object); 79 try { 80 ContentController cc = FcExplorer.getContentController(ci); 81 ContextContainer container = new InternalComponentContainer(); 82 Component[] components = cc.getFcSubComponents(); 83 for (int i=0 ; i<components.length ; i++) { 84 container.addEntry(FcExplorer.getName(components[i]), 85 components[i]); 86 } 87 88 Entry[] values = new Entry[entries.length + 1]; 89 values[0] = new DefaultEntry("components", container); 90 System.arraycopy(entries,0,values,1,entries.length); 91 return values; 92 } catch (NoSuchInterfaceException e) { 93 return entries; 94 } 95 } 96 } 97 | Popular Tags |