Examples of HttpContext


Examples of org.apache.http.protocol.HttpContext

        super();
    }

    public void connected(final NHttpClientConnection conn, final Object attachment) {
        HttpExchange httpexchange = new HttpExchange();
        HttpContext context = conn.getContext();
        context.setAttribute(HTTP_EXCHANGE, httpexchange);
        requestReady(conn);
    }
View Full Code Here

Examples of org.apache.http.protocol.HttpContext

        }
        if (handler == null) {
            return;
        }
        try {
            HttpContext context = handler.getContext();
            HttpRequest request = handler.generateRequest();
            httpexchange.setRequest(request);

            conn.submitRequest(request);
View Full Code Here

Examples of org.apache.http.protocol.HttpContext

        try {
            if (httpexchange.getRequestState() == MessageState.ACK_EXPECTED) {
                conn.suspendOutput();
                return;
            }
            HttpContext context = handler.getContext();
            handler.produceContent(encoder, conn);
            httpexchange.setRequestState(MessageState.BODY_STREAM);
            if (encoder.isCompleted()) {
                handler.requestCompleted(context);
                httpexchange.setRequestState(MessageState.COMPLETED);
View Full Code Here

Examples of org.apache.slide.projector.HttpContext

    private final static String allowedChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
   
    public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      ApplicationManager.getInstance();
      boolean sessionCreated = request.getSession(false) == null;
      Context context = new HttpContext(request, response);
        logger.log(Level.FINE, "Request uri=" + request.getRequestURI());
        logger.log(Level.FINE, "Context path=" + request.getContextPath());
        logger.log(Level.FINE, "Servlet path=" + request.getServletPath());
        URI uri = new URIValue(request.getRequestURI().substring(request.getContextPath().length()+request.getServletPath().length()+1));
        try {
            Result result;
            Processor processor;
            try {
                logger.log(Level.FINE, "Processing started with URI=" + uri);
                Map requestParameters = request.getParameterMap();
                if ( requestParameters.containsKey(Constants.PROCESS_ID_PARAMETER) ) {
                  context.setProcessId(requestParameters.get(Constants.PROCESS_ID_PARAMETER).toString());
                } else {
                    StringBuffer processIdBuffer = new StringBuffer(Constants.PROCESS_ID_LENGTH);
                  for ( int i = 0; i < Constants.PROCESS_ID_LENGTH; i++) {
                      processIdBuffer.append(allowedChars.charAt(random.nextInt(allowedChars.length())));
                  }
                  context.setProcessId(processIdBuffer.toString());
                }
                processor = ProcessorManager.getInstance().getProcessor(uri);
                Scheduler.getInstance();
                Scheduler.setContext(context);
              if ( sessionCreated ) {
                // new session
                    Scheduler.getInstance().launchSessionJobs(context);
              }
                Scheduler.getInstance().launchRequestJobs(context);
                if ( ProcessorManager.getInstance().getProcessorDescriptor(uri).isBookmark() ) {
                    context.setBookmark(uri);
                }
                ParameterDescriptor[] parameterDescriptors = processor.getParameterDescriptors();
                result = ProcessorManager.process(processor, new HashMap(requestParameters), context);
            } catch ( Exception exception ) {
                logger.log(Level.SEVERE, "Exception while processing processor with URI="+uri+"", exception);
View Full Code Here

Examples of org.apache.tuscany.sca.binding.http.provider.HTTPContext

            throw new ServiceRuntimeException(e);
        }
    }

    private Message invokeRequest(Message msg) throws IOException {
        HTTPContext context = msg.getBindingContext();
        HttpServletRequest servletRequest = context.getRequest();
        if ("GET".equals(servletRequest.getMethod())) {
            msg.setBody(getRequestFromQueryString(msg.getOperation(), servletRequest));
        } else {
            msg.setBody(getRequestFromPost(msg.getOperation(), servletRequest));
        }
View Full Code Here

Examples of org.apache.tuscany.sca.common.http.HTTPContext

    public void setNext(Invoker next) {
        this.next = next;
    }

    public Message invoke(Message msg) {
        HTTPContext bindingContext = (HTTPContext) msg.getBindingContext();
        if (bindingContext == null) {
            return getNext().invoke(msg);
        }


        if (binding.getRequestWireFormat() instanceof XMLWireFormat) {
            if( isPayloadSupported(bindingContext.getHttpRequest().getMethod()) && msg.getBody() != null) {
                msg = invokeRequest(bindingContext, msg);
            }
        }

        msg = getNext().invoke(msg);
View Full Code Here

Examples of org.browsermob.proxy.jetty.http.HttpContext

        streamManager = new StreamManager( 100 * BandwidthLimiter.OneMbps );

        server = new Server();
        HttpListener listener = new SocketListener(new InetAddrPort(getPort()));
        server.addListener(listener);
        HttpContext context = new HttpContext();
        context.setContextPath("/");
        server.addContext(context);

        handler = new BrowserMobProxyHandler();
        handler.setJettyServer(server);
        handler.setShutdownLock(new Object());
        client = new BrowserMobHttpClient(streamManager, requestCounter);
        client.prepareForBrowser();
        handler.setHttpClient(client);

        context.addHandler(handler);

        server.start();

        setPort(listener.getPort());
    }
View Full Code Here

Examples of org.exist.storage.serializers.Serializer.HttpContext

            SAXSerializer sax = null;
            final Serializer serializer = broker.getSerializer();
            serializer.reset();

            //setup the http context
            final HttpContext httpContext = serializer.new HttpContext();
            final HttpRequestWrapper reqw = new HttpRequestWrapper(request, formEncoding, containerEncoding);
            httpContext.setRequest(reqw);
            httpContext.setSession(reqw.getSession(false));
            serializer.setHttpContext(httpContext);


            // Serialize the document
            try {
View Full Code Here

Examples of org.glassfish.grizzly.http.HttpContext

       
        return flush(ctx);
    }
   
    private NextAction flush(final FilterChainContext ctx) {
        final HttpContext httpContext = HttpContext.get(ctx);
        assert httpContext != null;
        final OutputSink output = httpContext.getOutputSink();

        if (output.canWrite()) {  // if connection write queue is not overloaded
            return ctx.getStopAction();
        } else { // if connection write queue is overloaded
View Full Code Here

Examples of org.jboss.arquillian.container.spi.client.protocol.metadata.HTTPContext

    public ProtocolMetaData getProtocolMetaData(String deploymentName) {
        URI webURI = getWebUri();

        ProtocolMetaData metaData = new ProtocolMetaData();
        metaData.addContext(new JMXContext(getConnection()));
        HTTPContext context = new HTTPContext(webURI.getHost(), webURI.getPort());
        metaData.addContext(context);
        try {
            ModelNode deploymentNode = readResource(createDeploymentAddress(deploymentName));

            if (isWebArchive(deploymentName)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.