Package org.glassfish.contextpropagation.bootstrap

Examples of org.glassfish.contextpropagation.bootstrap.ContextAccessController


        });
      }

      private void receive(InputStream in, OriginatorFinder origFinder) throws IOException {
        ContextBootstrap.debug(MessageID.PROPAGATION_STARTED, "Ingoing");
        ContextAccessController accessController = ContextBootstrap.getContextAccessController();
        wireAdapter.prepareToReadFrom(in);
        SimpleMap map = getMapAndCreateIfNeeded();
        map.prepareToPropagate();
        for (String key = wireAdapter.readKey(); key != null; key = wireAdapter.readKey()) {
          try {
            Entry entry = wireAdapter.readEntry();
            if (entry == null) {
              break;
            } else {
              entry.init(origFinder.isOriginator(key), accessController.isEveryoneAllowedToRead(key));
              map.put(key, entry);
            }
          } catch (ClassNotFoundException e) {
            ContextBootstrap.getLoggerAdapter().log(Level.ERROR, e,
                MessageID.ERROR_UNABLE_TO_INSTANTIATE_CONTEXT_FROM_THE_WIRE);
View Full Code Here


    };
  }

  @Override
  public ContextAccessController getContextAccessController() {
    return new ContextAccessController() {
      @Override
      public boolean isAccessAllowed(String key, AccessControlledMap.ContextAccessLevel type) {
        if (type == ContextAccessLevel.READ && isEveryoneAllowedToRead(key)) {
          return true; // First do a quick check for read access
        }
View Full Code Here

        });
      }

      private void receive(InputStream in, OriginatorFinder origFinder) throws IOException {
        ContextBootstrap.debug(MessageID.PROPAGATION_STARTED, "Ingoing");
        ContextAccessController accessController = ContextBootstrap.getContextAccessController();
        wireAdapter.prepareToReadFrom(in);
        SimpleMap map = getMapAndCreateIfNeeded();
        map.prepareToPropagate();
        for (String key = wireAdapter.readKey(); key != null; key = wireAdapter.readKey()) {
          try {
            Entry entry = wireAdapter.readEntry();
            if (entry == null) {
              break;
            } else {
              entry.init(origFinder.isOriginator(key), accessController.isEveryoneAllowedToRead(key));
              map.put(key, entry);
            }
          } catch (ClassNotFoundException e) {
            ContextBootstrap.getLoggerAdapter().log(Level.ERROR, e,
                MessageID.ERROR_UNABLE_TO_INSTANTIATE_CONTEXT_FROM_THE_WIRE);
View Full Code Here

TOP

Related Classes of org.glassfish.contextpropagation.bootstrap.ContextAccessController

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.