public org.objectweb.fractal.api.Component[] getFcSubComponents() { if ( impl == null ) { throw new java.lang.NullPointerException("Trying to invoke a method on a client or server interface whose complementary interface is not bound."); } org.objectweb.fractal.api.Component[] ret = impl.getFcSubComponents(); return ret; }
public org.objectweb.fractal.api.Component[] getFcSubComponents() { if ( impl == null ) { throw new java.lang.NullPointerException("Trying to invoke a method on a client or server interface whose complementary interface is not bound."); } org.objectweb.fractal.api.Component[] ret = impl.getFcSubComponents(); return ret; }
public org.objectweb.fractal.api.Component[] getFcSubComponents() { if ( impl == null ) { throw new java.lang.NullPointerException("Trying to invoke a method on a client or server interface whose complementary interface is not bound."); } org.objectweb.fractal.api.Component[] ret = impl.getFcSubComponents(); return ret; }
public Component[] getApplications() { List<Component> applications = new ArrayList<Component>(); Component managedElements[] = _this_weaveableCC.getFcSubComponents(); for(Component managedElement : managedElements){ try { Component parents[] = Fractal.getSuperController(managedElement).getFcSuperComponents(); if(parents.length == 1) applications.add(managedElement); } catch (NoSuchInterfaceException ignored) { } } return applications.toArray(new Component[]{}); }
/** * A utility function allowing to get a component from any content * controller. * * @param parentContentController * parentContentController * @param name * component name * @return the component, null if not found */ public List<Component> getComponents(final Component parent) { final List<Component> res = new ArrayList<Component>(); try { final ContentController parentContentController = Fractal .getContentController(parent); // List content controller subcomponents for (final Component component : parentContentController .getFcSubComponents()) { res.add(component); } } catch (final NoSuchInterfaceException e1) { // do nothing, return null } return res; }
public static List<Component> getComponentListByPrefix( final ContentController parentContentController, final String prefix) { List<Component> components = new ArrayList<>(); // List content controller subcomponents for (Component component : parentContentController.getFcSubComponents()) { try { String componentName = Fractal.getNameController(component).getFcName(); if (componentName.startsWith(prefix)) { components.add(component); } } catch (NoSuchInterfaceException e) { // do nothing } } return components; }
public List<Component> getAllSubComponents(final Component parent) { final List<Component> res = new ArrayList<Component>(); try { final ContentController parentContentController = Fractal .getContentController(parent); // List content controller subcomponents for (final Component component : parentContentController .getFcSubComponents()) { res.add(component); res.addAll(getComponents(component)); } } catch (final NoSuchInterfaceException e1) { // do nothing, return null } return res; }
public static List<Component> getComponentListByPrefix( final ContentController parentContentController, final String prefix) { List<Component> components = new ArrayList<Component>(); // List content controller subcomponents for (Component component : parentContentController.getFcSubComponents()) { try { String componentName = Fractal.getNameController(component).getFcName(); if (componentName.startsWith(prefix)) { components.add(component); } } catch (NoSuchInterfaceException e) { // do nothing } } return components; }
public static Component getComponentByName(final ContentController parentContentController, final String name) { // List content controller subcomponents for (Component component : parentContentController.getFcSubComponents()) { try { String componentName = Fractal.getNameController(component).getFcName(); if (componentName.equals(name)) { return component; } } catch (NoSuchInterfaceException e) { // do nothing } } return null; }
public static <T> List<T> getAll(Class<T> clazz, final ContentController parentContentController, String serviceName) { List<T> result = new ArrayList<T>(); ContentController subContentController = null; for (Component component : parentContentController.getFcSubComponents()) { try { subContentController = Fractal.getContentController(component); if (subContentController.getFcSubComponents().length > 0) { result.addAll(getAll(clazz, subContentController, serviceName)); } } catch (NoSuchInterfaceException e1) { } try { Object o = component.getFcInterface(serviceName); if (o != null) { try { result.add(clazz.cast(o)); } catch (ClassCastException e) { } } } catch (NoSuchInterfaceException e) { } } return result; } }
public static Component getComponentByName(final ContentController parentContentController, final String name) { // List content controller subcomponents for (final Component component : parentContentController.getFcSubComponents()) { try { final String componentName = Fractal.getNameController(component).getFcName(); if (name.equals(componentName)) { return component; } } catch (final NoSuchInterfaceException e) { // do nothing } } return null; }
private Component searchSubCmp(String cmpname) { Component[] subcmp; String curName = null; subcmp = _this_weaveableCC.getFcSubComponents(); for (int i = 0; i < subcmp.length; i++) { try { curName = ((NameController) (subcmp[i] .getFcInterface("name-controller"))).getFcName(); if (cmpname.equals(curName)) return subcmp[i]; } catch (NoSuchInterfaceException e0) { // no name ctrler for this subcmp, ignore it } } return null; }
private void exposeSub(Component ids[], int crtDepth) throws JMException { if (_depth >= 0 && crtDepth > _depth) return; for (int i = 0; i < ids.length; i++) { // register subcomponents try { ContentController cCtrl = Fractal.getContentController(ids[i]); exposeSub(cCtrl.getFcSubComponents(), crtDepth + 1); } catch (NoSuchInterfaceException ignored) {} // register component infos String[] names = getFullFCName(ids[i]); for (int j = 0; j < names.length; j++) { exposeFCinfos(ids[i], "/" + names[j] + '@' + Integer.toHexString(ids[i].hashCode())); } } }
for (int i = parentContentController.getFcSubComponents().length; i != 0; i--) { Component component = parentContentController.getFcSubComponents()[i - 1]; if (subContentController.getFcSubComponents().length > 0) { stopComposite(component);
/** * @param c * @param subcmp * @return * @deprecated */ private static Component search(Component c, String subcmp) { try { ContentController cc = Fractal.getContentController(c); Component[] sub = cc.getFcSubComponents(); for (int i = 0; i < sub.length; i++) { try { if (Fractal.getNameController(sub[i]).getFcName().equals( subcmp)) return sub[i]; } catch (NoSuchInterfaceException e1) { // no name ctrler ignore it } } } catch (Exception e) { return null; } return null; }
/** * @param comp * @param name * @return * @deprecated */ private static Component subcomp(Component comp, String name) { try { ContentController cc = Fractal.getContentController(comp); for (Component sc : cc.getFcSubComponents()) { NameController nc = Fractal.getNameController(sc); if (name.equals(nc.getFcName())) { return sc; } } } catch (NoSuchInterfaceException e) { e.printStackTrace(); return null; } return null; }
/** * */ public void undeploy() throws UndeploymentException { Component[] subs = _this_weaveableCC.getFcSubComponents(); for(Component sub : subs){ try { UndeploymentController uc = (UndeploymentController) sub.getFcInterface("undeployment-controller"); uc.undeploy(); } catch (NoSuchInterfaceException e) { throw new ChainedUndeploymentException(e, _this_weaveableC, e.getMessage()); } } }
public org.objectweb.fractal.api.Component[] getFcSubComponents() { java.util.List<org.ow2.frascati.tinfi.api.IntentHandler> handlers = intentHandlersMap.get(METHODS[1]); try { if( handlers.size() == 0 ) { org.objectweb.fractal.api.Component[] ret = impl.getFcSubComponents(); return ret; } else { org.objectweb.fractal.api.Interface itf = getFcItf(); org.ow2.frascati.tinfi.IntentJoinPointImpl<org.objectweb.fractal.api.control.ContentController> ijp = new org.ow2.frascati.tinfi.IntentJoinPointImpl(); ijp.init(handlers,fcComp,itf,impl,METHODS[1]); org.objectweb.fractal.api.Component[] ret = (org.objectweb.fractal.api.Component[]) ijp.proceed(); return ret; } } catch( Throwable t ) { if( t instanceof RuntimeException ) { throw (RuntimeException) t; } throw new org.ow2.frascati.tinfi.TinfiRuntimeException(t); } }
/** * Log the component status (started or stopped) of a Fractal component. * * @param component */ public static void getComponentState(final Component component, final String space, final StringBuilder sb) { final LifeCycleController componentLC = getLifeCycleController(component); final NameController componentNC = getNameController(component); sb.append(space + "- " + componentNC.getFcName() + " is " + componentLC.getFcState() + System.lineSeparator()); ContentController componentCC = null; try { componentCC = Fractal.getContentController(component); } catch (final NoSuchInterfaceException e) { // No content controller (ie. no sub components) } if (componentCC != null) { final Component[] componentSubComponents = componentCC.getFcSubComponents(); for (final Component componentSubComponent : componentSubComponents) { getComponentState(componentSubComponent, space + "\t", sb); } } }
public org.objectweb.fractal.api.Component[] getFcSubComponents() { java.util.List<org.ow2.frascati.tinfi.api.IntentHandler> handlers = intentHandlersMap.get(METHODS[1]); try { if( handlers.size() == 0 ) { org.objectweb.fractal.api.Component[] ret = impl.getFcSubComponents(); return ret; } else { org.objectweb.fractal.api.Component comp = getFcComponent(); org.objectweb.fractal.api.Interface itf = getFcItf(); org.ow2.frascati.tinfi.IntentJoinPointImpl<org.objectweb.fractal.api.control.ContentController> ijp = new org.ow2.frascati.tinfi.IntentJoinPointImpl(); ijp.init(handlers,comp,itf,impl,METHODS[1]); org.objectweb.fractal.api.Component[] ret = (org.objectweb.fractal.api.Component[]) ijp.proceed(); return ret; } } catch( Throwable t ) { if( t instanceof RuntimeException ) { throw (RuntimeException) t; } throw new org.ow2.frascati.tinfi.TinfiRuntimeException(t); } }