/** * Callback to handle canceled context change request from the CCOW context manager. */ @Override public void ccowCanceled(CCOWContextManager sender) { commitContexts(false, false); }
/** * Callback to handle canceled context change request from the CCOW context manager. */ @Override public void ccowCanceled(CCOWContextManager sender) { commitContexts(false, false); }
/** * Callback to handle committed context change request from the CCOW context manager. */ @Override public void ccowCommitted(CCOWContextManager sender) { commitContexts(true, false); }
/** * Callback to handle committed context change request from the CCOW context manager. */ @Override public void ccowCommitted(CCOWContextManager sender) { commitContexts(true, false); }
/** * @see org.carewebframework.api.context.IContextManager#reset */ @Override public boolean reset(boolean silent) { pendingStack.clear(); commitStack.clear(); boolean result = true; for (IManagedContext managedContext : managedContexts) { result &= resetItem(managedContext, silent); if (!silent && !result) { break; } } boolean commit = silent || result; commitContexts(commit, commit); return result; }
/** * @see org.carewebframework.api.context.IContextManager#reset */ @Override public void reset(boolean silent, ISurveyCallback callback) { pendingStack.clear(); commitStack.clear(); SurveyResponse response = new SurveyResponse(); Iterator<IManagedContext<?>> iter = managedContexts.iterator(); reset(silent, iter, response, __ -> { boolean commit = silent || !response.rejected(); commitContexts(commit, commit); execCallback(callback, response); }); }
commitContexts(accept, accept);
/** * Updates managed contexts based on the marshaledContext. * * @param marshaledContext The marshaled context to process. * @param commit If true the pending contexts are committed. * @param callback Callback to report subscriber responses. */ /*package*/void setMarshaledContext(ContextItems marshaledContext, boolean commit, ISurveyCallback callback) { ISurveyResponse response = new SurveyResponse(); Iterator<IManagedContext<?>> iter = managedContexts.iterator(); setMarshaledContext(marshaledContext, iter, response, __ -> { if (commit) { commitContexts(!response.rejected(), false); } }); }
/** * Updates managed contexts based on the marshaledContext. * * @param marshaledContext The marshaled context to process. * @param commit If true the pending contexts are committed. * @return Reason if context change rejected. */ /*package*/String setMarshaledContext(ContextItems marshaledContext, boolean commit) { StringBuilder reason = new StringBuilder(); for (IManagedContext managedContext : managedContexts) { try { if (managedContext.setContextItems(marshaledContext)) { localChangeBegin(managedContext); appendResponse(reason, localChangeEnd(managedContext, true, true)); } } catch (Exception e) { log.error("Error processing marshaled context change.", e); appendResponse(reason, e.toString()); } } if (commit) { commitContexts(reason.length() == 0, false); } return reason.toString(); }