public java.lang.String getName() { java.lang.String ret = service.getName(); return ret; }
public java.lang.String getName() { 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."); } java.lang.String ret = impl.getName(); return ret; }
public void removeChildExecutions() throws CoreException { Execution child = null; while ((this.childExecutions.values() != null) && (this.childExecutions.values().size() > 0)) { child = this.childExecutions.values().iterator().next(); log.finest("remove execution: " + child.getName()); this.removeChildExecution(child); } }
public void removeChildExecutions() throws CoreException { Execution child = null; // while ((this.childExecutions.values() != null) // && (this.childExecutions.values().size() > 0)) { // child = this.childExecutions.values().iterator().next(); while ((this.childExecutions != null) && (this.childExecutions.size() > 0)) { child = this.childExecutions.iterator().next(); log.finest("remove execution: " + child.getName()); this.removeChildExecution(child); } }
@Override public void run() { try { this.log.finest("run the child execution : " + this.childExecution.getName()); if (childExecution.isStepByStep()) { this.childExecution.runStepByStep(); } else { this.childExecution.run(); } } catch (final Exception e) { e.printStackTrace(); this.exception = e; } }
@Override public void run() { try { this.log.finest("run the child execution : " + this.childExecution.getName()); if (childExecution.isStepByStep()) { this.childExecution.runStepByStep(); } else { this.childExecution.run(); } } catch (final Exception e) { e.printStackTrace(); this.exception = e; } }
@Override public synchronized void onChildBehaviourNotification(Behaviour childBehaviour) throws CoreException { if(alreadyNotified) { return; } alreadyNotified = true; log.finest("Notification received from "+childBehaviour.getName()); //cancel all the other child executions String execName = childBehaviour.getNode().getExecution().getName(); for(Execution childExec : getNode().getExecution().getChildExecutions()) { if(!execName.equals(childExec.getName())) { log.finest(childExec.getName()+" has been cancelled"); childExec.setState(Execution.State.CANCELLED); getNode().getExecution().removeChildExecution(childExec); } } }
private Map<String, Execution> getSuspendedExecutions(Scope parentScope) { Map<String, Execution> res = new HashMap<String, Execution>(); try { log.finest("parentScope "+parentScope.getName()); if(parentScope != null) { List<ReceiverBehaviour> receiveBehaviours = parentScope.findBehaviours(ReceiverBehaviour.class); log.finest("Number of receiver behaviours: " + receiveBehaviours.size()); for(ReceiverBehaviour receiveBehaviour : receiveBehaviours) { log.finest("receiver behaviour: " + receiveBehaviour.getName()); if((receiveBehaviour.getNode().getExecution() != null)&&(receiveBehaviour.getNode().getExecution().getState().equals(Execution.State.SUSPENDED))) { if(!res.containsKey(receiveBehaviour.getNode().getExecution().getName())) { log.finest("execution \"" + receiveBehaviour.getNode().getExecution().getName() + "\" of receiver behaviour \"" + receiveBehaviour.getName() + "\" is concerned execution." ); res.put(receiveBehaviour.getNode().getExecution().getName(), receiveBehaviour.getNode().getExecution()); } } } } } catch (CoreException e) { // do nothing log.severe("Error in getSuspendedExecutions: " + e.getMessage()); } catch(NullPointerException ne){ log.severe("Error in getSuspendedExecutions (null pointer): " + ne.getMessage()); } return res; }
private Map<String, Execution> getSuspendedExecutions(Scope parentScope) { Map<String, Execution> res = new HashMap<String, Execution>(); try { log.finest("parentScope "+parentScope.getName()); if(parentScope != null) { List<ReceiverBehaviour> receiveBehaviours = parentScope.findBehaviours(ReceiverBehaviour.class); log.finest("Number of receiver behaviours: " + receiveBehaviours.size()); for(ReceiverBehaviour receiveBehaviour : receiveBehaviours) { log.finest("receiver behaviour: " + receiveBehaviour.getName()); if((receiveBehaviour.getNode().getExecution() != null)&&(receiveBehaviour.getNode().getExecution().getState().equals(Execution.State.SUSPENDED))) { if(!res.containsKey(receiveBehaviour.getNode().getExecution().getName())) { log.finest("execution \"" + receiveBehaviour.getNode().getExecution().getName() + "\" of receiver behaviour \"" + receiveBehaviour.getName() + "\" is concerned execution." ); res.put(receiveBehaviour.getNode().getExecution().getName(), receiveBehaviour.getNode().getExecution()); } } } } } catch (CoreException e) { // do nothing log.severe("Error in getSuspendedExecutions: " + e.getMessage()); } catch(NullPointerException ne){ log.severe("Error in getSuspendedExecutions (null pointer): " + ne.getMessage()); } return res; }
public java.lang.String getName() { java.util.List<org.ow2.frascati.tinfi.api.IntentHandler> handlers = intentHandlersMap.get(METHODS[27]); try { if( handlers.size() == 0 ) { java.lang.String ret = impl.getName(); return ret; } else { org.objectweb.fractal.api.Component comp = getFcComponent(); org.objectweb.fractal.api.Interface itf = getFcItf(); org.ow2.frascati.tinfi.IntentJoinPointImpl<com.ebmwebsourcing.easyviper.core.api.engine.Execution> ijp = new org.ow2.frascati.tinfi.IntentJoinPointImpl(); ijp.init(handlers,comp,itf,impl,METHODS[27]); java.lang.String ret = (java.lang.String) ijp.proceed(); return ret; } } catch( Throwable t ) { if( t instanceof RuntimeException ) { throw (RuntimeException) t; } throw new org.ow2.frascati.tinfi.TinfiRuntimeException(t); } }
private void restartExecutionAndParents(Execution execution, ExternalContext context) throws CoreException { Collection<String> threadNames = getAllActiveThreadNames(); Execution.State execState = Execution.State.SUSPENDED; while (execution != null) { // check if there is already a thread running this execution. // we know it because we created each execution thread using execution // hashCode. if (!threadNames.contains(String.valueOf(execution.hashCode())) && execState == Execution.State.SUSPENDED) { log.finest("Spawning (or respawning) thread for execution " + execution.getName()); ThreadRunProcess processThread = new ThreadRunProcess(execution, context);//validExecution.getParentScope().getProcess().getExternalContexts()); processThread.start(); execution = execution.getParentExecution(); if(execution!=null) { execState = execution.getState(); //we wait for the end of the execution only if it's not the main execution try { processThread.join(); } catch (InterruptedException e) { throw new CoreException(e); } } } else { execution = execution.getParentExecution(); if(execution!=null) execState = execution.getState(); } } }
public Map<String, Execution> getSuspendedExecutions() throws CoreException { Map<String, Execution> res = new HashMap<String,Execution>(); if (this.getParentExecution() != null && this.getParentExecution().getState().equals(Execution.State.SUSPENDED)) { res.putAll(getSuspendedExecutions(this.getParentExecution().getParentScope())); } else if (this.getParentExecution() == null) { final Execution main = this.createParentExecution(); final Component exec = FractalHelper.getFractalHelper() .getComponentByInterface(this.getComponent(), (Interface) main, "service"); FractalHelper.getFractalHelper().startComponent(exec); try { if(!res.containsKey(this.getParentExecution().getName())) { res.put(this.getParentExecution().getName(), this.getParentExecution()); } } catch (CoreException e) { // do nothing } } return res; }
this.log.finest("try to inject message in process " + process.getName() + " using execution " + exec.getName()); if (exec.getCurrentTarget() instanceof Node) { final Node node = (Node) exec.getCurrentTarget();
this.log.finest("try to inject message in process " + process.getName() + " using execution " + exec.getName()); if (exec.getCurrentTarget() instanceof Node) { final Node node = (Node) exec.getCurrentTarget();
public Map<String, Execution> getSuspendedExecutions() throws CoreException { Map<String, Execution> res = new HashMap<String,Execution>(); try { if (this.getParentExecution() != null && this.getParentExecution().getState().equals(Execution.State.SUSPENDED)) { res.putAll(getSuspendedExecutions(this.getParentExecution().getParentScope())); } else if (this.getParentExecution() == null) { final Execution main = this.createParentExecution(); final Component exec = SCAHelper.getSCAHelper() .getComponentByInterface(this.getComponent(), (Interface) main, "service"); SCAHelper.getSCAHelper().startComponent(exec); try { if(!res.containsKey(this.getParentExecution().getName())) { res.put(this.getParentExecution().getName(), this.getParentExecution()); } } catch (CoreException e) { // do nothing } } } catch(SCAException e) { throw new CoreException(e); } return res; }
@Override protected void executeOnInactive() throws CoreException { this.log.finest("start breakpoint behaviour on node: " + this.node.getName()); this.state = State.ACTIVITY_STARTED; DebugBehaviour debug = DebugUtil.findDebugBehaviour(this.getNode().getExecution().getParentScope().getProcess()); if (debug != null) { this.log.finest("is debug mode? " + debug.isActivate()); } else { this.log.finest("is debug mode? false - no debug behaviour found"); } if (debug != null && debug.isActivate()) { this.getNode().getExecution().setState( Execution.State.SUSPENDED); this.log.finest("breakpoint behaviour: suspend the execution " + this.getNode().getExecution().getName() + " => " + this.getNode().getExecution().getState()); this.getNode().selectDefaultNextTarget(); } }
/** * @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; }
log.finest("Spawning (or respawning) thread for execution " + execution.getName()); ThreadRunProcess processThread = new ThreadRunProcess(execution, context); processThread.start();
/** * @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; }