Tabnine Logo
org.carewebframework.api.context
Code IndexAdd Tabnine to your IDE (free)

How to use org.carewebframework.api.context

Best Java code snippets using org.carewebframework.api.context (Showing top 20 results out of 315)

origin: org.carewebframework/org.carewebframework.api.core

/**
 * Returns the user in the current context.
 * 
 * @return User in current context.
 */
public static IUser getActiveUser() {
  return getUserContext().getContextObject(false);
}

origin: org.carewebframework/org.carewebframework.api.core

/**
 * Compares by priority, with higher priorities collating first.
 */
@Override
public int compareTo(IManagedContext<DomainClass> o) {
  int pri1 = o.getPriority();
  int pri2 = getPriority();
  return this == o ? 0 : pri1 < pri2 ? -1 : 1;
}

origin: org.carewebframework/org.carewebframework.api.core

@Override
public void defer() {
  if (silent) {
    throw new ContextException("May not defer a response in silent mode");
  }
  
  updateState(ResponseState.DEFERRED);
}

origin: org.carewebframework/org.carewebframework.api.core

/**
 * @see org.carewebframework.api.context.IManagedContext#getContextItems(boolean)
 */
@Override
public ContextItems getContextItems(boolean pending) {
  contextItems.clear();
  DomainClass domainObject = getContextObject(pending);
  return domainObject == null ? contextItems : toCCOWContext(domainObject);
}

origin: org.carewebframework/org.carewebframework.api.core

/**
 * Returns the marshaled context representing the state of all shared contexts.
 *
 * @return A ContextItems object representing the current state of all shared contexts.
 */
public ContextItems getMarshaledContext() {
  ContextItems marshaledContext = new ContextItems();
  for (IManagedContext<?> managedContext : managedContexts) {
    marshaledContext.addItems(managedContext.getContextItems(false));
  }
  return marshaledContext;
}
origin: org.carewebframework/org.carewebframework.api

/**
 * Enables or disables CCOW support.
 * 
 * @param ccowEnabled True enables CCOW support if it is available.
 */
public void setCCOWEnabled(boolean ccowEnabled) {
  this.ccowEnabled = ccowEnabled;
  
  if (!ccowEnabled && ccowContextManager != null) {
    ccowContextManager.suspend();
    ccowContextManager = null;
  }
  
  updateCCOWStatus();
}

origin: org.carewebframework/org.carewebframework.plugin.userheader

@Override
public void onUnload() {
  UserContext.getUserContext().removeListener(userChangeListener);
}

origin: org.carewebframework/org.carewebframework.api.core

private void initItem(Iterator<IManagedContext<?>> iter, SurveyResponse response, ISurveyCallback callback) {
  if (iter.hasNext()) {
    IManagedContext<?> managedContext = iter.next();
    initItem(managedContext, aresponse -> {
      response.merge(aresponse);
      initItem(iter, response, callback);
    });
  } else if (callback != null) {
    callback.response(response);
  }
}
origin: org.carewebframework/org.carewebframework.api.core

/**
 * @see org.carewebframework.api.context.IManagedContext#init()
 */
@Override
public void init() {
  reset();
}

origin: org.carewebframework/org.carewebframework.api.core

/**
 * Register an object as a subscriber if it implements the callback interface.
 *
 * @see org.carewebframework.api.IRegisterEvent#registerObject(Object)
 * @param object Object to register.
 */
@Override
public void registerObject(Object object) {
  if (object instanceof IContextEvent) {
    addSubscriber((IContextEvent) object);
  }
}

origin: org.carewebframework/org.carewebframework.api.core

/**
 * Remove an object as a subscriber if it implements the callback interface.
 *
 * @see org.carewebframework.api.IRegisterEvent#unregisterObject(Object)
 * @param object Object to unregister.
 */
@Override
public void unregisterObject(Object object) {
  if (object instanceof IContextEvent) {
    removeSubscriber((IContextEvent) object);
  }
}

origin: org.carewebframework/org.carewebframework.api.core

@Override
public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException {
  if (bean instanceof ISerializer) {
    unregister((ISerializer<?>) bean);
  }
}
origin: org.carewebframework/org.carewebframework.api.core

/**
 * Callback to handle canceled context change request from the CCOW context manager.
 */
@Override
public void ccowCanceled(CCOWContextManager sender) {
  commitContexts(false, false);
}
origin: org.carewebframework/org.carewebframework.api

/**
 * Performs a case-insensitive lookup of the item name + suffix in the index.
 * 
 * @param itemName Item name
 * @param suffix Item suffix
 * @param autoAdd If true and item name not in index, add it.
 * @return Item name with suffix as stored internally
 */
private String lookupItemName(String itemName, String suffix, boolean autoAdd) {
  return lookupItemName(itemName + "." + suffix, autoAdd);
}

origin: org.carewebframework/org.carewebframework.api.core

private void execCallback(ISurveyCallback callback, ISurveyResponse response) {
  if (callback != null) {
    callback.response(response);
  }
}
origin: org.carewebframework/org.carewebframework.api

/**
 * Returns the user in the current context.
 * 
 * @return User in current context.
 */
public static IUser getActiveUser() {
  return getUserContext().getContextObject(false);
}

origin: org.carewebframework/org.carewebframework.api

/**
 * @see org.carewebframework.api.context.IManagedContext#getContextItems(boolean)
 */
@Override
public ContextItems getContextItems(boolean pending) {
  contextItems.clear();
  DomainClass domainObject = getContextObject(pending);
  return domainObject == null ? contextItems : toCCOWContext(domainObject);
}

origin: org.carewebframework/org.carewebframework.api

/**
 * Returns the marshaled context representing the state of all shared contexts.
 * 
 * @return A ContextItems object representing the current state of all shared contexts.
 */
public ContextItems getMarshaledContext() {
  ContextItems marshaledContext = new ContextItems();
  
  for (IManagedContext managedContext : managedContexts) {
    marshaledContext.addItems(managedContext.getContextItems(false));
  }
  
  return marshaledContext;
}

origin: org.carewebframework/org.carewebframework.api

/**
 * Compares by priority, with higher priorities collating first.
 */
@Override
public int compareTo(IManagedContext o) {
  int pri1 = o.getPriority();
  int pri2 = getPriority();
  return this == o ? 0 : pri1 < pri2 ? -1 : 1;
}

origin: org.carewebframework/org.carewebframework.api.core

/**
 * Enables or disables CCOW support.
 *
 * @param ccowEnabled True enables CCOW support if it is available.
 */
public void setCCOWEnabled(boolean ccowEnabled) {
  this.ccowEnabled = ccowEnabled;
  if (!ccowEnabled && ccowContextManager != null) {
    ccowContextManager.suspend();
    ccowContextManager = null;
  }
  updateCCOWStatus();
}
org.carewebframework.api.context

Most used classes

  • UserContext
    Wrapper for shared user context.
  • ContextManager
    Manages context objects and mediates context change requests on their behalf. Context objects are sp
  • ISurveyResponse
    Tracks survey responses from context change subscribers.
  • IContextManager
    Interface for access to public context manager services.
  • ISharedContext
    Every managed context must implement this interface to permit access to the wrapped domain object.
  • ContextMarshaller,
  • ManagedContext,
  • CCOWContextManager,
  • ContextException,
  • ContextManager$CCOWStatus,
  • ContextSerializerRegistry,
  • IContextEvent,
  • IManagedContext,
  • MarshalException,
  • IContextSerializer,
  • ISerializer,
  • ISurveyResponse$ISurveyCallback,
  • SurveyResponse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now