Package org.glassfish.contextpropagation

Examples of org.glassfish.contextpropagation.ContextViewFactory


    public <T extends ViewCapable> T createViewCapable(String prefix) throws InsufficientCredentialException {
      return (T) createViewCapable(prefix, true);
    }

    public <T extends ViewCapable> T createViewCapable(String prefix, boolean isOriginator) throws InsufficientCredentialException {
      ContextViewFactory factory = (ContextViewFactory) getFactory(prefix);
      if (factory == null) {
        throw new IllegalStateException("Unable to create ViewCapable object for prefix, " + prefix);
      } else {
        ViewImpl view = new ViewImpl(prefix);
        Entry entry = Entry.createViewEntryInstance(DUMMY_VALUE , EnumSet.of(PropagationMode.LOCAL),
            view).init(isOriginator, ContextBootstrap.getContextAccessController().isEveryoneAllowedToRead(prefix));
        mapFinder.getMapAndCreateIfNeeded().put(prefix,  entry);
        entry.value = factory.createInstance(view);
        entry.propagationModes = factory.getPropagationModes();
        return (T) entry.getValue();
      }
    }
View Full Code Here


    public <T extends ViewCapable> T createViewCapable(String prefix) throws InsufficientCredentialException {
      return (T) createViewCapable(prefix, true);
    }

    public <T extends ViewCapable> T createViewCapable(String prefix, boolean isOriginator) throws InsufficientCredentialException {
      ContextViewFactory factory = (ContextViewFactory) getFactory(prefix);
      if (factory == null) {
        throw new IllegalStateException("Unable to create ViewCapable object for prefix, " + prefix);
      } else {
        ViewImpl view = new ViewImpl(prefix);
        Entry entry = Entry.createViewEntryInstance(DUMMY_VALUE , EnumSet.of(PropagationMode.LOCAL),
            view).init(isOriginator, ContextBootstrap.getContextAccessController().isEveryoneAllowedToRead(prefix));
        mapFinder.getMapAndCreateIfNeeded().put(prefix,  entry);
        entry.value = factory.createInstance(view);
        entry.propagationModes = factory.getPropagationModes();
        return (T) entry.getValue();
      }
    }
View Full Code Here

TOP

Related Classes of org.glassfish.contextpropagation.ContextViewFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.