Configure the pipeline for a cleartext useing Prior-Knowledge method to start http2.
12846
private void configureClearTextWithPriorKnowledge(SocketChannel ch) {
        ch.pipeline().addLast(connectionHandler,
            new PrefaceFrameWrittenEventHandler(),
            new UserEventLogger());
        configureEndOfPipeline(ch.pipeline());
    }
619439
protected function prepareProcessContext()
    {
        $this->context = app($this->processContextClass, [ $this->data, $this->settings ]);

        $this->context->command = $this->command;
    }
903135
def setUp(self):
        '''
        '''
        toplist = filter(lambda wsa: wsa.ADDRESS==self.wsAddressURI, WSA_LIST)
        epr = 'EndpointReferenceType'
        for WSA in toplist+WSA_LIST:
            if (self.wsAddressURI is not None and self.wsAddressURI != WSA.ADDRESS) or \
                _has_type_definition(WSA.ADDRESS, epr) is True:
                break
        else:
            raise EvaluateException,\
                'enabling wsAddressing requires the inclusion of that namespace'

        self.wsAddressURI = WSA.ADDRESS
        self.anonymousURI = WSA.ANONYMOUS
        self._replyTo = WSA.ANONYMOUS
1355132
def prepare_onetime_pipeline():
    """"""
    runner = ForemastRunner()
    runner.write_configs()
    runner.create_pipeline(onetime=os.getenv('ENV'))
    runner.cleanup()
1350647
def start(self):
        """"""
        self.clear()
        self.setDefaultPolicy()
        self.acceptIcmp()
        self.acceptInput('lo')
696362
private void configureSsl(SocketChannel ch) {
        ch.pipeline().addLast(sslCtx.newHandler(ch.alloc()), new Http2OrHttpHandler());
    }
1121441
def restore(self):
        """"""
        current, self.nlp.pipeline = self.nlp.pipeline, self.original_pipeline
        unexpected = [name for name, pipe in current if not self.nlp.has_pipe(name)]
        if unexpected:
            # Don't change the pipeline if we're raising an error.
            self.nlp.pipeline = current
            raise ValueError(Errors.E008.format(names=unexpected))
        self[:] = []
348529
def run(configobj=None):
    
    acscteforwardmodel(configobj['input'],
                       exec_path=configobj['exec_path'],
                       time_stamps=configobj['time_stamps'],
                       verbose=configobj['verbose'],
                       quiet=configobj['quiet'],
                       single_core=configobj['single_core']
                       )
1366074
function injectBefore(replServer, method, beforeFn) {
  var _orig = replServer[method];
  replServer[method] = function() {
    var args = Array.prototype.slice.call(arguments);
    var callback = args.pop();
    beforeFn.apply(null, args.concat(function(err, res) {
      if (err || res) {
        callback(err, res);
      } else {
        _orig.apply(replServer, args.concat(callback));
      }
    }));
  };
  return replServer;
}
376671
private void configureH2cPipeline(ChannelPipeline pipeline) {
        // Add handler to handle http2 requests without an upgrade
        pipeline.addLast(new Http2WithPriorKnowledgeHandler(
                interfaceId, serverName, serverConnectorFuture, this));
        // Add http2 upgrade decoder and upgrade handler
        final HttpServerCodec sourceCodec = new HttpServerCodec(reqSizeValidationConfig.getMaxUriLength(),
                                                                reqSizeValidationConfig.getMaxHeaderSize(),
                                                                reqSizeValidationConfig.getMaxChunkSize());

        final HttpServerUpgradeHandler.UpgradeCodecFactory upgradeCodecFactory = protocol -> {
            if (AsciiString.contentEquals(Http2CodecUtil.HTTP_UPGRADE_PROTOCOL_NAME, protocol)) {
                return new Http2ServerUpgradeCodec(
                        Constants.HTTP2_SOURCE_CONNECTION_HANDLER,
                        new Http2SourceConnectionHandlerBuilder(
                                interfaceId, serverConnectorFuture, serverName, this).build());
            } else {
                return null;
            }
        };
        pipeline.addLast(Constants.HTTP_SERVER_CODEC, sourceCodec);
        pipeline.addLast(Constants.HTTP_COMPRESSOR, new CustomHttpContentCompressor());
        if (httpTraceLogEnabled) {
            pipeline.addLast(HTTP_TRACE_LOG_HANDLER,
                             new HttpTraceLoggingHandler(TRACE_LOG_DOWNSTREAM));
        }
        if (httpAccessLogEnabled) {
            pipeline.addLast(HTTP_ACCESS_LOG_HANDLER, new HttpAccessLoggingHandler(ACCESS_LOG));
        }
        pipeline.addLast(Constants.HTTP2_UPGRADE_HANDLER,
                         new HttpServerUpgradeHandler(sourceCodec, upgradeCodecFactory, Integer.MAX_VALUE));
        /* Max size of the upgrade request is limited to 2GB. Need to see whether there is a better approach to handle
           large upgrade requests. Requests will be propagated to next handlers if no upgrade has been attempted */
        pipeline.addLast(Constants.HTTP2_TO_HTTP_FALLBACK_HANDLER,
                         new Http2ToHttpFallbackHandler(this));
    }
643794
def setup(self, proxystr='', prompting=True):
        
        self.prompting = prompting
        proxy = self.get_proxy(proxystr)
        if proxy:
            proxy_support = urllib2.ProxyHandler({"http": proxy, "ftp": proxy})
            opener = urllib2.build_opener(proxy_support, urllib2.CacheFTPHandler)
            urllib2.install_opener(opener)
1217146
def setup_authentication_methods(authn_config, template_env):
    """"""
    routing = {}
    ac = AuthnBroker()
    for authn_method in authn_config:
        cls = make_cls_from_name(authn_method["class"])
        instance = cls(template_env=template_env, **authn_method["kwargs"])
        ac.add(authn_method["acr"], instance)
        routing[instance.url_endpoint] = VerifierMiddleware(instance)

    return ac, routing
1047688
public static function startup()
    {
        global $PPHP;

        trigger('language', self::$_req['lang']);

        if (isset(self::$_PATH[1]) && listeners('route/' . self::$_PATH[0] . '+' . self::$_PATH[1])) {
            self::$_base = array_shift(self::$_PATH) . '+' . array_shift(self::$_PATH);
        } elseif (isset(self::$_PATH[0])) {
            if (listeners('route/' . self::$_PATH[0])) {
                self::$_base = array_shift(self::$_PATH);
            } else {
                trigger('http_status', 404);
            };
        } elseif (listeners('route/main')) {
            self::$_base = 'main';
        } else {
            trigger('http_status', 404);
        };
        self::$_req['path_args'] = self::$_PATH;
    }
962421
public void configureHttpPipeline(ChannelPipeline pipeline, TargetHandler targetHandler) {
        pipeline.addLast(Constants.HTTP_CLIENT_CODEC, new HttpClientCodec());
        addCommonHandlers(pipeline);
        pipeline.addLast(Constants.BACK_PRESSURE_HANDLER, new BackPressureHandler());
        pipeline.addLast(Constants.TARGET_HANDLER, targetHandler);
    }
470247
protected function beforeSendingThroughPipeline()
    {
        $this->dispatcher->fire('antares.started: client');
        $this->dispatcher->fire('antares.ready: client');
        $this->dispatcher->fire(new ClientStarted());
        $this->dispatcher->fire(new ClientReady());
    }
975520
private void doConfigure() {
        Undertow.Builder builder = Undertow.builder();

        // if no configuration method change root handler, simple path->HttpHandler will be used
        // where each HttpHandler is created in separate org.ops4j.pax.web.service.undertow.internal.Context
        HttpHandler rootHandler = path;

        URL undertowResource = detectUndertowConfiguration();
        ConfigSource source = ConfigSource.kind(undertowResource);

        switch (source) {
            case XML:
                LOG.info("Using \"" + undertowResource + "\" to configure Undertow");
                rootHandler = configureUndertow(configuration, builder, rootHandler, undertowResource);
                break;
            case PROPERTIES:
                LOG.info("Using \"" + undertowResource + "\" to read additional configuration for Undertow");
                configureIdentityManager(undertowResource);
                // do not break - go to standard PID configuration
            case PID:
                LOG.info("Using \"org.ops4j.pax.url.web\" PID to configure Undertow");
                rootHandler = configureUndertow(configuration, builder, rootHandler);
                break;
        }

        for (Context context : contextMap.values()) {
            try {
                context.setSessionPersistenceManager(sessionPersistenceManager);
                context.setDefaultSessionTimeoutInMinutes(defaultSessionTimeoutInMinutes);
                context.start();
            } catch (Exception e) {
                LOG.error("Could not start the servlet context for context path [" + context.getContextModel().getContextName() + "]", e);
            }
        }

        builder.setHandler(rootHandler);
        server = builder.build();
    }
852402
public static void propagateTracingContext(Span span, HttpHeaders headers) {
    Preconditions.checkArgument(span != null, "span should not be null.");
    Preconditions.checkArgument(headers != null, "headers should not be null.");
    if (propagationTextFormat != null && propagationTextFormatSetter != null) {
      if (!span.equals(BlankSpan.INSTANCE)) {
        propagationTextFormat.inject(span.getContext(), headers, propagationTextFormatSetter);
      }
    }
  }