public org.objectweb.fractal.api.Component getComponent() { org.objectweb.fractal.api.Component ret = service.getComponent(); return ret; }
public org.objectweb.fractal.api.Component getComponent() { 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.getComponent(); return ret; }
public com.ebmwebsourcing.easyviper.core.api.engine.Process getProcess() throws CoreException { com.ebmwebsourcing.easyviper.core.api.engine.Process res = null; Scope current = this; Scope topScope = this; while (current != null) { current = this.getParentScope(current); if (current != null) { topScope = current; } } try { res = (com.ebmwebsourcing.easyviper.core.api.engine.Process) topScope.getComponent().getFcInterface("service"); } catch (final NoSuchInterfaceException e) { //do nothing } return res; }
public com.ebmwebsourcing.easyviper.core.api.engine.Process getProcess() throws CoreException { com.ebmwebsourcing.easyviper.core.api.engine.Process res = null; Scope current = this; Scope topScope = this; while (current != null) { current = this.getParentScope(current); if (current != null) { topScope = current; } } try { res = (com.ebmwebsourcing.easyviper.core.api.engine.Process) topScope.getComponent().getFcInterface("process"); } catch (final NoSuchInterfaceException e) { // do nothing } return res; }
private Scope getParentScope(Scope child) throws CoreException { Scope parent = null; try { if (!(child instanceof com.ebmwebsourcing.easyviper.core.api.engine.Process)) { final Component parentComp = FractalHelper.getFractalHelper() .getParent(child.getComponent()); if (parentComp != null) { parent = (Scope) parentComp.getFcInterface("scope"); } } } catch (final NoSuchInterfaceException e) { // do nothing } return parent; }
private Scope getParentScope(Scope child) throws CoreException { Scope parent = null; try { if (!(child instanceof com.ebmwebsourcing.easyviper.core.api.engine.Process)) { final Component parentComp = SCAHelper.getSCAHelper() .getParent(child.getComponent()); if (parentComp != null) { parent = (Scope) parentComp.getFcInterface("service"); } } } catch (final NoSuchInterfaceException e) { // do nothing } catch (final SCAException e) { // do nothing } return parent; }
public int getStatus(final TreeView treeView) { final Scope scope = (Scope) treeView.getSelectedObject(); try { if (FractalHelper.getFractalHelper() .isStarted(scope.getComponent())) { return MenuItem.ENABLED_STATUS; } } catch (final CoreException e) { e.printStackTrace(); return MenuItem.NOT_VISIBLE_STATUS; } return MenuItem.NOT_VISIBLE_STATUS; } }
public int getStatus(final TreeView treeView) { final Scope scope = (Scope) treeView.getSelectedObject(); try { if (FractalHelper.getFractalHelper() .isStarted(scope.getComponent())) { return MenuItem.ENABLED_STATUS; } } catch (final CoreException e) { e.printStackTrace(); return MenuItem.NOT_VISIBLE_STATUS; } return MenuItem.NOT_VISIBLE_STATUS; } }
.getComponentByInterface(scope.getComponent(), (org.objectweb.fractal.api.Interface) alarm, "service");
public void execute() throws CoreException { /* * Start behaviours components */ for(NonFunctionnalBehaviour behaviour : this.nonfunctionalbehaviours.values()){ // execute the behaviour of the node if (behaviour != null) { // start the behaviour final Component activityComp = FractalHelper .getFractalHelper() .getComponentByInterface( this.execution.getParentScope().getComponent(), (org.objectweb.fractal.api.Interface) behaviour, "service"); if ((activityComp != null) && (!FractalHelper.getFractalHelper().isStarted( activityComp))) { FractalHelper.getFractalHelper().startComponent( activityComp); } /* * Run behaviour */ execBehaviours.submit(behaviour); }//endif }//endfor }
@Override protected void executeOnInactive() throws CoreException { this.state = State.ACTIVITY_STARTED; alreadyNotified = false; if(triggeringNodes==null || triggeringNodes.isEmpty()) { this.state = State.ACTIVITY_ENDED; return; } try{ SCAHelper.getSCAHelper().startComponentAndSubComponents(getNode().getExecution().getParentScope().getComponent()); } catch(SCAException e) { throw new CoreException(e); } List<Node> nodes = new ArrayList<Node>(); for(Node child : getNode().getChildNodes()) { for(Node triggeringNode : triggeringNodes) { if(triggeringNode.getName().equals(child.getName())) { nodes.add(child); break; } } } getNode().getExecution().setNextExecutableElements(this, nodes); }
public void setBehavioursState(Scope scope, Behaviour.State state) throws CoreException { try { List<Component> components = SCAHelper.getSCAHelper().getComponents(scope.getComponent()); for(Component component: components) { if(SCAHelper.getSCAHelper().isStarted(component)) { try { Behaviour behaviour = (Behaviour) component.getFcInterface("service"); behaviour.setState(state); } catch (NoSuchInterfaceException e) { // do nothing } catch (ClassCastException e) { // do nothing } } } } catch (final SCAException e) { throw new CoreException(e); } }
/** * @throws CoreException * @see Execution#createChildExecution(String) */ public Execution createChildExecution(final String name) throws CoreException { // create child execution final Execution childExecution = this.getParentScope().createExecution( this.getName() + "_child_" + this.childExecutions.size()); final Component exeChildComp = FractalHelper.getFractalHelper() .getComponentByInterface(this.getParentScope().getComponent(), (org.objectweb.fractal.api.Interface) childExecution, "service"); FractalHelper.getFractalHelper().startComponent(exeChildComp); childExecution.setStepByStep(this.stepByStep); childExecution.setSpeedTime(this.speedTime); this.log.finest("creating " + childExecution.getName()); // add it to this execution this.addExecution(childExecution); return childExecution; }
/** * @throws CoreException * @see Execution#createChildExecution(String) */ public Execution createChildExecution() throws CoreException { // create child execution final Execution childExecution = this.getParentScope().createExecution( this.getName() + "_child_" + this.childExecutions.size()); try { final Component exeChildComp = SCAHelper.getSCAHelper() .getComponentByInterface(this.getParentScope().getComponent(), (org.objectweb.fractal.api.Interface) childExecution, "service"); SCAHelper.getSCAHelper().startComponent(exeChildComp); childExecution.setStepByStep(this.stepByStep); childExecution.setSpeedTime(this.speedTime); this.log.finest("creating " + childExecution.getName()); // add it to this execution this.addExecution(childExecution); } catch(SCAException e) { throw new CoreException(e); } return childExecution; }
public void removeChildExecution(final Execution execution) throws CoreException { if (execution != null) { Component exeComp; try { exeComp = FractalHelper.getFractalHelper() .getComponentByInterface( this.getParentScope().getComponent(), (org.objectweb.fractal.api.Interface) execution.getComponent().getFcInterface("service"), "service"); if (exeComp != null) { FractalHelper.getFractalHelper().deleteComponent(exeComp); } } catch (NoSuchInterfaceException e) { throw new CoreException(e); } } }
private void cleanBehaviours(Scope scope) throws CoreException { // find behaviour try { List<Component> components = FractalHelper.getFractalHelper().getComponents(scope.getComponent()); for(Component component: components) { if(FractalHelper.getFractalHelper().isStarted(component)) { try { FunctionnalBehaviour behaviour = (FunctionnalBehaviour) component.getFcInterface("service"); behaviour.setState(FunctionnalBehaviour.State.ACTIVITY_ENDED); if(behaviour instanceof ReceiverBehaviour) { ((ReceiverBehaviour)behaviour).setMessage(null); } } catch (NoSuchInterfaceException e) { // do nothing } catch (ClassCastException e) { // do nothing } } } } catch (CoreException e) { throw new CoreException(e); } }
public void removeChildExecution(final Execution execution) throws CoreException { if (execution != null) { Component exeComp; try { exeComp = SCAHelper.getSCAHelper() .getComponentByInterface( this.getParentScope().getComponent(), (org.objectweb.fractal.api.Interface) execution.getComponent().getFcInterface("service"), "service"); if (exeComp != null) { SCAHelper.getSCAHelper().deleteComponent(exeComp); } } catch (NoSuchInterfaceException e) { throw new CoreException(e); } catch (SCAException e) { throw new CoreException(e); } } }
Component comp = SCAHelper.getSCAHelper().getFirstComponentByName(scopetemp.getComponent(), "exec_in_" + scopetemp.getName());
@Override protected void executeOnStarted() throws CoreException { try{ Scope scope = (Scope) this.getNode().getComponent().getFcInterface("service"); Component execComp = SCAHelper.getSCAHelper().getFirstComponentByName(scope.getComponent(), "exec_in_" + scope.getName()); if (!SCAHelper.getSCAHelper().isStarted(execComp)) { SCAHelper.getSCAHelper().startComponent(execComp); } Execution exec = (Execution) execComp.getFcInterface("service"); if(exec.getState()!=Execution.State.ENDED) return; this.state = State.ACTIVITY_ENDED; scope.end(false); this.log.finest("end scope behaviour on node: " + this.node.getName()); } catch (NoSuchInterfaceException e) { throw new CoreException(e); } catch (SCAException e) { throw new CoreException(e); } }
.getComponentByInterface(scope.getComponent(), (Interface) forkNode.getBehaviour(), "service"); if (!FractalHelper.getFractalHelper().isStarted(componentBehaviour)) {