/** * @see org.objectweb.fractal.julia.control.lifecycle.ContainerLifeCycleMixin#setFcContentState(boolean) */ private void setFcContentState$0(final boolean started) throws IllegalLifeCycleException { Object content; try { content = weaveableOptC.getFcInterface("/content"); } catch (NullPointerException e) { return ; } catch (NoSuchInterfaceException e) { return ; } if (content == (this)) { if ((this) instanceof ContentLifeCycleController) { if (started) { ((ContentLifeCycleController)(this)).startFcContent(); } else { ((ContentLifeCycleController)(this)).stopFcContent(); } } } else if (content instanceof LifeCycleController) { if (started) { ((LifeCycleController)(content)).startFc(); } else { ((LifeCycleController)(content)).stopFc(); } } }
/** * A utility function to stop the given fractal component. * * @param component * the fractal component to stop * * @return true if the component was found and stopped, false otherwise * @throws NoSuchInterfaceException * : impossible to stop the component * @throws IllegalLifeCycleException * : impossible to stop the component */ public static final boolean stopComponent(final Component component) throws NoSuchInterfaceException, IllegalLifeCycleException { boolean result = false; LifeCycleController lifeCycleController = Fractal.getLifeCycleController(component); if (LifeCycleController.STARTED.equals(lifeCycleController.getFcState())) { lifeCycleController.stopFc(); result = true; } return result; }
/** * A utility function to start the given fractal component. * * @param component * the fractal component * * @return true if the component was found and stopped, false otherwise * @throws NoSuchInterfaceException * : impossible to stop the component * @throws IllegalLifeCycleException * : impossible to stop the component */ public static final boolean startComponent(final Component component) throws NoSuchInterfaceException, IllegalLifeCycleException { boolean result = false; LifeCycleController lifeCycleController = Fractal.getLifeCycleController(component); if (lifeCycleController != null && LifeCycleController.STOPPED.equals(lifeCycleController.getFcState())) { lifeCycleController.startFc(); result = true; } return result; }
public boolean isStarted(final Component comp) { boolean res = false; if (comp != null) { try { final LifeCycleController lifeCycleController = Fractal .getLifeCycleController(comp); if (lifeCycleController.getFcState() == LifeCycleController.STARTED) { res = true; } } catch (final NoSuchInterfaceException e) { // do nothing, return null res = false; } } return res; }
private void startPlugin(final Component plugin) throws NoSuchInterfaceException, IllegalLifeCycleException { final LifeCycleController lc = Fractal.getLifeCycleController(plugin); lc.startFc(); }
/** * Stop the specified component. Defined to mimic SCADomain.close(). */ public static void close( Component c ) throws IllegalLifeCycleException, NoSuchInterfaceException { Fractal.getLifeCycleController(c).stopFc(); } }
public void setFcContent( Object content ) throws IllegalLifeCycleException, ContentInstantiationException { /* * Lifecycle check. */ String state = _this_weaveableOptLC.getFcState(); if( ! state.equals(LifeCycleController.STOPPED) ) { String msg = "Component should be stopped"; throw new IllegalLifeCycleException(msg); } _super_setFcContent(content); }
/** * A utility function to start the given fractal component. * * @param component * the fractal component * * @return true if the component was found and stopped, false otherwise * @throws NoSuchInterfaceException : * impossible to stop the component * @throws IllegalLifeCycleException : * impossible to stop the component */ public boolean startComponent(final Component component) throws NoSuchInterfaceException, IllegalLifeCycleException { boolean result = false; LifeCycleController lifeCycleController = Fractal .getLifeCycleController(component); if (lifeCycleController != null) { if (lifeCycleController.getFcState().equals( LifeCycleController.STOPPED)) { lifeCycleController.startFc(); result = true; } } return result; }
/** * Return an instance of the component described by the specified ADL. */ public static Component getComponent( String adl ) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalLifeCycleException, NoSuchInterfaceException, java.lang.InstantiationException { Class<?> cl = Class.forName(adl); Object o = cl.newInstance(); if( !(o instanceof Factory) ) { String msg = "The specified descriptor is not a component factory: "+adl; throw new IllegalArgumentException(msg); } Factory factory = (Factory) o; Component c = factory.newFcInstance(); Fractal.getLifeCycleController(c).startFc(); return c; }
protected void reset(T resource) { Component component = ((Interface) resource).getFcItfOwner(); try { GCM.getLifeCycleController(component).stopFc(); ((CommonAttributeController) GCM.getAttributeController(component)).resetAttributes(); } catch (NoSuchInterfaceException e) { throw new IllegalStateException(e); } catch (IllegalLifeCycleException e) { throw new IllegalStateException(e); } }
/** * @see org.objectweb.fractal.julia.control.lifecycle.ContainerLifeCycleMixin#setFcContentState(boolean) */ private void setFcContentState$0(final boolean started) throws org.objectweb.fractal.api.control.IllegalLifeCycleException { java.lang.Object content; try { content = weaveableOptC.getFcInterface("/content"); } catch (java.lang.NullPointerException e) { return; } catch (org.objectweb.fractal.api.NoSuchInterfaceException e) { return; } if (content == (this)) { if ((this) instanceof org.objectweb.fractal.julia.control.lifecycle.ContentLifeCycleController) { if (started) { ((org.objectweb.fractal.julia.control.lifecycle.ContentLifeCycleController) (this)).startFcContent(); }else { ((org.objectweb.fractal.julia.control.lifecycle.ContentLifeCycleController) (this)).stopFcContent(); } } }else if (content instanceof org.objectweb.fractal.api.control.LifeCycleController) { if (started) { ((org.objectweb.fractal.api.control.LifeCycleController) (content)).startFc(); }else { ((org.objectweb.fractal.api.control.LifeCycleController) (content)).stopFc(); } } }
/** * A utility function to stop the given fractal component. * * @param component * the fractal component to stop * * @return true if the component was found and stopped, false otherwise * @throws NoSuchInterfaceException : * impossible to stop the component * @throws IllegalLifeCycleException : * impossible to stop the component */ public boolean stopComponent(final Component component) throws NoSuchInterfaceException, IllegalLifeCycleException { boolean result = false; LifeCycleController lifeCycleController = Fractal .getLifeCycleController(component); if (lifeCycleController.getFcState() .equals(LifeCycleController.STARTED)) { lifeCycleController.stopFc(); result = true; } return result; }
private void checkFcStopped() throws IllegalLifeCycleException { if( _this_weaveableOptLC != null ) { String state = _this_weaveableOptLC.getFcState(); if( ! LifeCycleController.STOPPED.equals(state) ) { String msg = "Component " + _this_weaveableOptNC.getFcName() + " is not stopped"; throw new IllegalLifeCycleException(msg); } } }
if (lifeCycleController.getFcState().equals( LifeCycleController.STOPPED)) { lifeCycleController.startFc();
/** * Create a new FraScati Domain component */ public SCADomain() { try { Class<?> cl = Class.forName(DOMAIN_DEFINITION); Object o = cl.newInstance(); scaDomain = ((Factory) o).newFcInstance(); Fractal.getLifeCycleController(scaDomain).startFc(); } catch (Exception e) { throw new FactoryException("Failed while creating SCADomain instance",e); } }
/** * @see org.objectweb.fractal.julia.control.lifecycle.ContainerLifeCycleMixin#setFcContentState(boolean) */ public void setFcContentState(final boolean started) throws org.objectweb.fractal.api.control.IllegalLifeCycleException { java.lang.Object content; try { content = weaveableOptC.getFcInterface("/content"); } catch (java.lang.NullPointerException e) { return; } catch (org.objectweb.fractal.api.NoSuchInterfaceException e) { return; } if (content == (this)) { if ((this) instanceof org.objectweb.fractal.julia.control.lifecycle.ContentLifeCycleController) { if (started) { ((org.objectweb.fractal.julia.control.lifecycle.ContentLifeCycleController) (this)).startFcContent(); }else { ((org.objectweb.fractal.julia.control.lifecycle.ContentLifeCycleController) (this)).stopFcContent(); } } }else if (content instanceof org.objectweb.fractal.api.control.LifeCycleController) { if (started) { ((org.objectweb.fractal.api.control.LifeCycleController) (content)).startFc(); }else { ((org.objectweb.fractal.api.control.LifeCycleController) (content)).stopFc(); } } }
/** * Stop the component and then calls the overriden method. */ public void undeploy() throws UndeploymentException { if (_this_weaveableOptLC != null) { if (LifeCycleController.STARTED.equals(_this_weaveableOptLC .getFcState())) { try { _this_weaveableOptLC.stopFc(); } catch (IllegalLifeCycleException e) { throw new ChainedUndeploymentException(e, _this_weaveableC, e.getMessage()); } } } _super_undeploy(); }
/** * @see org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin#unbindFc(java.lang.String) */ public void unbindFc(final java.lang.String clientItfName) throws org.objectweb.fractal.api.NoSuchInterfaceException, org.objectweb.fractal.api.control.IllegalBindingException, org.objectweb.fractal.api.control.IllegalLifeCycleException { if ((weaveableOptLC) != null) { java.lang.String state = weaveableOptLC.getFcState(); if (!(org.objectweb.fractal.api.control.LifeCycleController.STOPPED.equals(state))) { throw new org.objectweb.fractal.julia.control.lifecycle.ChainedIllegalLifeCycleException(null, weaveableOptC, "The component is not stopped"); } } unbindFc$0(clientItfName); }
final boolean stopped = LifeCycleController.STOPPED.equals(lifeCycleController.getFcState()); if (stopped) { lifeCycleController.startFc();
org.objectweb.fractal.adl.xml.XMLNodeFactoryImpl P3 = new org.objectweb.fractal.adl.xml.XMLNodeFactoryImpl(); if (P3 instanceof org.objectweb.fractal.api.control.LifeCycleController) { ((org.objectweb.fractal.api.control.LifeCycleController)P3).startFc(); ((org.objectweb.fractal.api.control.LifeCycleController)P4).startFc(); P2.bindFc("node-factory", P3); if (P0 instanceof org.objectweb.fractal.api.control.LifeCycleController) { ((org.objectweb.fractal.api.control.LifeCycleController)P0).startFc(); ((org.objectweb.fractal.api.control.LifeCycleController)P1).startFc(); ((org.objectweb.fractal.api.control.LifeCycleController)P2).startFc();