public com.ebmwebsourcing.easyviper.core.api.engine.Execution.State getState() { com.ebmwebsourcing.easyviper.core.api.engine.Execution.State ret = service.getState(); return ret; }
public com.ebmwebsourcing.easyviper.core.api.engine.Execution.State getState() { 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."); } com.ebmwebsourcing.easyviper.core.api.engine.Execution.State ret = impl.getState(); return ret; }
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 com.ebmwebsourcing.easyviper.core.api.engine.Execution.State getState() { java.util.List<org.ow2.frascati.tinfi.api.IntentHandler> handlers = intentHandlersMap.get(METHODS[1]); try { if( handlers.size() == 0 ) { com.ebmwebsourcing.easyviper.core.api.engine.Execution.State ret = impl.getState(); 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[1]); com.ebmwebsourcing.easyviper.core.api.engine.Execution.State ret = (com.ebmwebsourcing.easyviper.core.api.engine.Execution.State) ijp.proceed(); return ret; } } catch( Throwable t ) { if( t instanceof RuntimeException ) { throw (RuntimeException) t; } throw new org.ow2.frascati.tinfi.TinfiRuntimeException(t); } }
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; }
&& (process.getParentExecution().getState() == Execution.State.ENDED)) { this.log.finest("reinit and restart an older instance: " + process.getName()); process.end(true);
&& (process.getParentExecution().getState() == Execution.State.ENDED)) { this.log.finest("reinit and restart an older instance: " + process.getName()); process.end(true);
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; }
@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(); } }
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; }
try { if( handlers.size() == 0 ) { com.ebmwebsourcing.easyviper.core.api.engine.Execution.State ret = impl.getState(); return ret;
+ process.getName() + " because it is not ended: state = " + process.getParentExecution().getState() + "\n";
@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); } }