/** * Set the state of a component (i.e. update the component description). * Currently only switching between suspended/waiting is allowed. */ // hack??? public void setComponentState(IComponentIdentifier comp, String state) { assert IComponentDescription.STATE_SUSPENDED.equals(state) : "wrong state: "+comp+", "+state; CMSComponentDescription desc = null; desc = (CMSComponentDescription)getDescription(comp); desc.setState(state); notifyListenersChanged(comp, desc); }
/** * Set the state of a component (i.e. update the component description). * Currently only switching between suspended/waiting is allowed. */ // hack??? public void setComponentState(IComponentIdentifier comp, String state) { assert IComponentDescription.STATE_SUSPENDED.equals(state) : "wrong state: "+comp+", "+state; CMSComponentDescription desc = null; desc = (CMSComponentDescription)getDescription(comp); desc.setState(state); notifyListenersChanged(comp, desc); }
/** * Set the state of a component (i.e. update the component description). * Currently only switching between suspended/waiting is allowed. */ // hack??? public void setComponentState(IComponentIdentifier comp, String state) { assert IComponentDescription.STATE_SUSPENDED.equals(state) : "wrong state: "+comp+", "+state; CMSComponentDescription desc = null; desc = (CMSComponentDescription)getDescription(comp); desc.setState(state); notifyListenersChanged(comp, desc); }
/** * Set the state of a component (i.e. update the component description). * Currently only switching between suspended/waiting is allowed. */ // hack??? public void setComponentState(IComponentIdentifier comp, String state) { assert IComponentDescription.STATE_SUSPENDED.equals(state) : "wrong state: "+comp+", "+state; CMSComponentDescription desc = null; synchronized(adapters) { desc = (CMSComponentDescription)getDescription(comp); desc.setState(state); } notifyListenersChanged(comp, desc); }
/** * Exit the destroy method by setting description state and resetting maps. */ protected void exitDestroy(IComponentIdentifier cid, IComponentDescription desc, Exception ex, Map<String, Object> results) { // Thread.dumpStack(); Future<Map<String, Object>> ret; if(desc instanceof CMSComponentDescription) { ((CMSComponentDescription)desc).setState(IComponentDescription.STATE_TERMINATED); } ccs.remove(cid); ret = (Future<Map<String, Object>>)cfs.remove(cid); if(ret!=null) { if(ex!=null) { ret.setException(ex); } else { ret.setResult(results); } } }
/** * Exit the destroy method by setting description state and resetting maps. * @return True, when somebody was notified. */ protected void exitDestroy(IComponentIdentifier cid, IComponentDescription desc, Exception ex, Map<String, Object> results) { // Thread.dumpStack(); Future<Map<String, Object>> ret; ccs.remove(cid); ret = (Future<Map<String, Object>>)cfs.remove(cid); if(desc instanceof CMSComponentDescription) { ((CMSComponentDescription)desc).setState(IComponentDescription.STATE_TERMINATED); } if(ret!=null) { if(ex!=null) { ret.setExceptionIfUndone(ex); } else { ret.setResultIfUndone(results); } } }
/** * Exit the destroy method by setting description state and resetting maps. */ protected void exitDestroy(IComponentIdentifier cid, IComponentDescription desc, Exception ex, Map<String, Object> results) { // Thread.dumpStack(); Future<Map<String, Object>> ret; if(desc instanceof CMSComponentDescription) { ((CMSComponentDescription)desc).setState(IComponentDescription.STATE_TERMINATED); } ccs.remove(cid); ret = (Future<Map<String, Object>>)cfs.remove(cid); // System.out.println("Terminated component: "+cid.getName()); if(ret!=null) { if(ex!=null) { ret.setException(ex); } else { ret.setResult(results); } } }
/** * Exit the destroy method by setting description state and resetting maps. */ protected void exitDestroy(IComponentIdentifier cid, IComponentDescription desc, Exception ex, Map<String, Object> results) { // Thread.dumpStack(); Future<Map<String, Object>> ret; synchronized(adapters) { if(desc instanceof CMSComponentDescription) { ((CMSComponentDescription)desc).setState(IComponentDescription.STATE_TERMINATED); } ccs.remove(cid); ret = (Future<Map<String, Object>>)cfs.remove(cid); } if(ret!=null) { if(ex!=null) { ret.setException(ex); } else { ret.setResult(results); } } }
desc.setState(IComponentDescription.STATE_SUSPENDED); cancel(adapter).addResultListener(new DelegationResultListener<Void>(ret));
desc.setState(IComponentDescription.STATE_SUSPENDED); notifyListenersChanged(cid, desc);
desc.setState(IComponentDescription.STATE_SUSPENDED); cancel(adapter).addResultListener(createResultListener(new DelegationResultListener<Void>(ret)));
desc.setState(IComponentDescription.STATE_SUSPENDED); cancel(adapter).addResultListener(createResultListener(new DelegationResultListener<Void>(ret)));
/** * Create a new CESComponentDescription. */ public CMSComponentDescription(IComponentIdentifier cid, String type, Boolean master, Boolean daemon, Boolean autoshutdown, PublishEventLevel monitoring, Boolean synchronous, String modelname, String localtype, IResourceIdentifier rid, long creationtime, IComponentIdentifier creator, Cause cause) { // if(cid.getName().indexOf("Dyn")!=-1) // System.out.println("created desc: "+cid+" "+hashCode()); setName(cid); setType(type); // setParent(parent); setState(IComponentDescription.STATE_ACTIVE); // setProcessingState(IComponentDescription.PROCESSINGSTATE_IDLE); setMaster(master); setDaemon(daemon); setAutoShutdown(autoshutdown); setMonitoring(monitoring!=null? monitoring: PublishEventLevel.OFF); setSynchronous(synchronous); setModelName(modelname); setLocalType(localtype); setResourceIdentifier(rid); setCreationTime(creationtime); setCreator(creator); setCause(cause); }
/** * Create a new CMSComponentDescription. */ public CMSComponentDescription(IComponentIdentifier cid, String type, boolean master, boolean daemon, boolean autoshutdown, boolean synchronous, boolean persistable, PublishEventLevel monitoring, String modelname, String localtype, IResourceIdentifier rid, long creationtime, IComponentIdentifier creator, Cause cause, boolean systemcomponent) { // if(cid.getName().indexOf("Dyn")!=-1) // System.out.println("created desc: "+cid+" "+hashCode()); setName(cid); setType(type); // setParent(parent); setState(IComponentDescription.STATE_ACTIVE); // setProcessingState(IComponentDescription.PROCESSINGSTATE_IDLE); setMaster(master); setDaemon(daemon); setAutoShutdown(autoshutdown); setSynchronous(synchronous); setPersistable(persistable); setMonitoring(monitoring!=null? monitoring: PublishEventLevel.OFF); setModelName(modelname); setLocalType(localtype); setResourceIdentifier(rid); setCreationTime(creationtime); setCreator(creator); setCause(cause); setSystemComponent(systemcomponent); }