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; }
if (getState().equals(State.ENDED)) return;
if (getState().equals(State.ENDED)) return;
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; }
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 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; }