Examples of HttpService


Examples of com.almende.eve.transport.http.HttpService

 
  public AgentFactory () {
    agents = new AgentCache();

    // ensure there is always an HttpService for outgoing calls
    addTransportService(new HttpService());
  }
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.HttpService

                ContextXmlParser parser = new ContextXmlParser(defaultContextXml);
                domainCRS = parser.getClearReferencesStatic();
            }

            List<Boolean> csrs = new ArrayList<Boolean>();
            HttpService httpService = serverConfig.getHttpService();
            DeployCommandParameters params = dc.getCommandParameters(DeployCommandParameters.class);
            String vsIDs = params.virtualservers;
            List<String> vsList = StringUtils.parseStringList(vsIDs, " ,");
            if (httpService != null && vsList != null && !vsList.isEmpty()) {
                for (VirtualServer vsBean : httpService.getVirtualServer()) {
                    if (vsList.contains(vsBean.getId())) {
                        Boolean csr = null;
                        Property prop = vsBean.getProperty("contextXmlDefault");
                        if (prop != null) {
                            File contextXml = new File(serverEnvironment.getInstanceRoot(),
View Full Code Here

Examples of iqq.im.service.HttpService

  }

  /** {@inheritDoc} */
  @Override
  public QQHttpRequest onBuildRequest() throws QQException, JSONException {
    HttpService httpService = (HttpService) getContext().getSerivce(QQService.Type.HTTP);
    QQSession session = getContext().getSession();
    Random rand = new Random();
    if(session.getClientId() == 0){
      session.setClientId(rand.nextInt()); //random??
    }
   
    JSONObject json = new JSONObject();
    json.put("status", status.getValue());
    json.put("ptwebqq", httpService.getCookie("ptwebqq",  QQConstants.URL_CHANNEL_LOGIN).getValue());
    json.put("passwd_sig", "");
    json.put("clientid", session.getClientId());
    json.put("psessionid", session.getSessionId());
   
    QQHttpRequest req = createHttpRequest("POST", QQConstants.URL_CHANNEL_LOGIN);
View Full Code Here

Examples of org.apache.commons.httpclient.server.HttpService

    }

    // ----------------------------------------------------------- Test Methods
    public void testHeaders() throws Exception {
        final String body = "XXX\r\nYYY\r\nZZZ";
        this.server.setHttpService(new HttpService() {
            public boolean process(SimpleRequest request,
                    SimpleResponse response) throws IOException {
                response.setStatusLine(request.getRequestLine().getHttpVersion(), 200);
                response.addHeader(new Header("Connection", "close"));
                response.addHeader(new Header("Content-Length", Integer.toString(body.length())));
View Full Code Here

Examples of org.apache.commons.httpclient.server.HttpService

     * Tests that having a duplicate content length causes no problems.
     */   
    public void testDuplicateContentLength() throws Exception {
       
        final String body = "XXX\r\nYYY\r\nZZZ";
        this.server.setHttpService(new HttpService() {
            public boolean process(SimpleRequest request,
                    SimpleResponse response) throws IOException {
                response.setStatusLine(request.getRequestLine().getHttpVersion(), 200);
                response.addHeader(new Header("Content-Length", Integer.toString(body.length())));
                response.addHeader(new Header("Content-Length", Integer.toString(body.length())));
View Full Code Here

Examples of org.apache.commons.httpclient.server.HttpService

        assertNotNull( "Response body is null.", method.getResponseBodyAsStream() );
    }

    public void testDuplicateConnection() throws Exception {
       
        this.server.setHttpService(new HttpService() {
            public boolean process(SimpleRequest request,
                    SimpleResponse response) throws IOException {
                response.setStatusLine(request.getRequestLine().getHttpVersion(), 200);
                response.addHeader(new Header("Connection", "close"));
                response.addHeader(new Header("Connection", "close"));
                return true;
            }
        });

        GetMethod method = new GetMethod("/");
        client.executeMethod(method);
        method.getResponseBodyAsString();
       
        assertFalse(connectionManager.getConection().isOpen());

        this.server.setHttpService(new HttpService() {
            public boolean process(SimpleRequest request,
                    SimpleResponse response) throws IOException {
                response.setStatusLine(HttpVersion.HTTP_1_0, 200);
                response.addHeader(new Header("Connection", "keep-alive"));
                response.addHeader(new Header("Connection", "keep-alive"));
View Full Code Here

Examples of org.apache.commons.httpclient.server.HttpService

       
        assertFalse(connectionManager.getConection().isOpen());
    }

    public void testInvalidContentLength1() throws Exception {
        this.server.setHttpService(new HttpService() {
            public boolean process(SimpleRequest request,
                    SimpleResponse response) throws IOException {
                response.setStatusLine(request.getRequestLine().getHttpVersion(), 200);
                response.addHeader(new Header("Content-Length", "5"));
                response.addHeader(new Header("Content-Length", "stuff"));
View Full Code Here

Examples of org.apache.commons.httpclient.server.HttpService

        client.executeMethod(method);
        assertEquals(5, method.getResponseContentLength());
    }

    public void testInvalidContentLength2() throws Exception {
        this.server.setHttpService(new HttpService() {
            public boolean process(SimpleRequest request,
                    SimpleResponse response) throws IOException {
                response.setStatusLine(request.getRequestLine().getHttpVersion(), 200);
                response.addHeader(new Header("Content-Length", "stuff"));
                response.addHeader(new Header("Content-Length", "5"));
View Full Code Here

Examples of org.apache.commons.httpclient.server.HttpService

       
        assertFalse(connectionManager.getConection().isOpen());
    }

    public void testNullHeaders() throws Exception {
        this.server.setHttpService(new HttpService() {
            public boolean process(SimpleRequest request,
                    SimpleResponse response) throws IOException {
                response.setStatusLine(request.getRequestLine().getHttpVersion(), 200);
                response.addHeader(new Header("Connection", "close"));
                response.setBodyString("XXX\r\nYYY\r\nZZZ");
View Full Code Here

Examples of org.apache.http.protocol.HttpService

            DefaultHttpServerConnection conn =
                new DefaultHttpServerConnection();
            conn.bind(socket, serverParams);

            // Set up the HTTP service
            HttpService httpService = new HttpService(
                httpProcessor,
                reuseStrategy,
                new DefaultHttpResponseFactory());
            httpService.setParams(serverParams);
            httpService.setHandlerResolver(handlerRegistry);

            // Start worker thread
            Thread t = new Thread(new Worker(httpService, conn));
            workerThreads.add(t);
            t.setDaemon(true);
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.