public boolean isValid() { return state.containsObject(rparam); }
public boolean isValid() { return state.containsObject(rparamset); }
public boolean isValid() { return state.containsObject(ragent); }
/** * Create a unique id. * @param state The state. * @param type The object type. * @return The new id. */ public Object createId(IOAVState state, OAVObjectType type) { long start = nextid; Object ret = iscontentid? new OAVContentId(nextid++): new OAVObjectId(nextid++); if(state.containsObject(ret)) System.out.println("Warning, id overflow."); while(state.containsObject(ret) && nextid!=start) ret = new OAVObjectId(nextid++); if(state.containsObject(ret)) throw new RuntimeException("No free id available."); return ret; }
/** * Create a unique id. * @param state The state. * @param type The object type. * @return The new id. */ public Object createId(IOAVState state, OAVObjectType type) { long start = nextid; Object ret = iscontentid? new OAVContentId(nextid++): new OAVObjectId(nextid++); if(state.containsObject(ret)) System.out.println("Warning, id overflow."); while(state.containsObject(ret) && nextid!=start) ret = new OAVObjectId(nextid++); if(state.containsObject(ret)) throw new RuntimeException("No free id available."); return ret; }
OAVInternalObjectId ret = new OAVInternalObjectId(type, id++, queue); if(state.containsObject(ret)) System.out.println("Warning, id overflow."); while(state.containsObject(ret) && id!=start) if(state.containsObject(ret)) throw new RuntimeException("No free id available.");
OAVInternalObjectId ret = new OAVInternalObjectId(type, id++, queue); if(state.containsObject(ret)) System.out.println("Warning, id overflow."); while(state.containsObject(ret) && id!=start) if(state.containsObject(ret)) throw new RuntimeException("No free id available.");
/** * Test if the action is valid. */ public boolean isValid() { return state.containsObject(rplan) && timer.equals(state.getAttributeValue(rplan, OAVBDIRuntimeModel.plan_has_timer)) && super.isValid(); }
Object ret = iscontentid? new OAVContentId(state, type, id++): new OAVObjectId(state, type, id++); if(state.containsObject(ret)) System.out.println("Warning, id overflow."); while(state.containsObject(ret) && id!=start) if(state.containsObject(ret)) throw new RuntimeException("No free id available.");
Object ret = iscontentid? new OAVContentId(type, id++): new OAVObjectId(type, id++); if(state.containsObject(ret)) System.out.println("Warning, id overflow."); while(state.containsObject(ret) && id!=start) if(state.containsObject(ret)) throw new RuntimeException("No free id available.");
Object ret = iscontentid? new OAVContentId(state, type, id++): new OAVObjectId(state, type, id++); if(state.containsObject(ret)) System.out.println("Warning, id overflow."); while(state.containsObject(ret) && id!=start) if(state.containsObject(ret)) throw new RuntimeException("No free id available.");
Object ret = iscontentid? new OAVContentId(type, id++): new OAVObjectId(type, id++); if(state.containsObject(ret)) System.out.println("Warning, id overflow."); while(state.containsObject(ret) && id!=start) if(state.containsObject(ret)) throw new RuntimeException("No free id available.");
if(substates[i].containsObject(object))
if(substates[i].containsObject(object))
/** * Get the tag name for an object. */ public QName getTagName(Object object, IContext context) { QName ret; IOAVState state = (IOAVState)context; if(state.containsObject(object)) { String typename = state.getType(object).getName(); ret = new QName(typename); } else { String clazzname = SReflect.getClassName(object.getClass()); Namespace ns; int idx = clazzname.lastIndexOf("."); String pck = SXML.PROTOCOL_TYPEINFO+clazzname.substring(0, idx); String tag = clazzname.substring(idx+1); AWriteContext wc = (AWriteContext)context; ns = wc.getNamespace(pck); ret = new QName(ns.getURI(), tag, ns.getPrefix()); } return ret; }
/** * Get the tag name for an object. */ public QName getTagName(Object object, IContext context) { QName ret; IOAVState state = (IOAVState)context; if(state.containsObject(object)) { String typename = state.getType(object).getName(); ret = new QName(typename); } else { String clazzname = SReflect.getClassName(object.getClass()); Namespace ns; int idx = clazzname.lastIndexOf("."); String pck = SXML.PROTOCOL_TYPEINFO+clazzname.substring(0, idx); String tag = clazzname.substring(idx+1); AWriteContext wc = (AWriteContext)context; ns = wc.getNamespace(pck); ret = new QName(ns.getURI(), tag, ns.getPrefix()); } return ret; }
public void execute(IOAVState state, IVariableAssignments assignments) { Object ea = assignments.getVariableValue("?ea"); Object rpe = assignments.getVariableValue("?rpe"); // System.out.println("External access notified: "+ea+" "+rpe); if(state.containsObject(ea)) { state.setAttributeValue(ea, OAVBDIRuntimeModel.externalaccess_has_dispatchedelement, rpe); WakeupAction wakeup = (WakeupAction)state.getAttributeValue(ea, OAVBDIRuntimeModel.externalaccess_has_wakeupaction); // Cleanup ITimer timer = (ITimer)state.getAttributeValue(ea, OAVBDIRuntimeModel.externalaccess_has_timer); if(timer!=null) { timer.cancel(); state.setAttributeValue(ea, OAVBDIRuntimeModel.externalaccess_has_timer, null); } state.setAttributeValue(ea, OAVBDIRuntimeModel.externalaccess_has_waitabstraction, null); // Notify external thread. wakeup.setTimeout(false); wakeup.run(); } } };
public void run() { if(state.containsObject(ragent)) { if(getState().getAttributeValue(ragent, OAVBDIRuntimeModel.agent_has_state)==null) { // Hack!!! During init phase execute directly as rule engine isn't running. try { // ((IComponentStep)step).execute(getInternalAccess()) // .addResultListener(new DelegationResultListener(ret)); IFuture res = ((IComponentStep)step).execute(getInternalAccess(scope)); FutureFunctionality.connectDelegationFuture(ret, res); } catch(Exception e) { ret.setException(e); } } else { getState().addAttributeValue(ragent, OAVBDIRuntimeModel.agent_has_actions, new Object[]{step, ret, scope!=null ? scope : ragent}); } } else { ret.setException(new ComponentTerminatedException(getAgentAdapter().getComponentIdentifier())); } } });