/** * @see org.carewebframework.api.context.IManagedContext#surveySubscribers(boolean) */ @Override public String surveySubscribers(boolean silent) { StringBuilder result = new StringBuilder(); for (IContextEvent event : getIterable(true)) { try { ContextManager.appendResponse(result, event.pending(silent)); } catch (Throwable e) { log.error("Error during surveysubscribers.", e); ContextManager.appendResponse(result, e.toString()); } surveyed.add(event); // Add to list of surveyed subscribers. if (!silent && result.length() > 0) { break; } } return result.toString(); }
/** * 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(); }