Examples of HttpHandler


Examples of client.net.sf.saxon.ce.client.HTTPHandler

            if (asyncSourceURI != null) {
              final String URI = asyncSourceURI;
              final Node transformTarget = target;

              logger.log(Level.FINE, "Aynchronous GET for: " + asyncSourceURI);
              final HTTPHandler hr = new HTTPHandler();

             hr.doGet(asyncSourceURI, new RequestCallback() {
              
               public void onError(Request request, Throwable exception) {
                 //hr.setErrorMessage(exception.getMessage());
                 String msg = "HTTP Error " + exception.getMessage() + " for URI " + URI;
                 handleException (new RuntimeException(msg), "onError");
               }
 
               public void onResponseReceived(Request request, Response response) {
                 int statusCode = response.getStatusCode();
                   if (statusCode == 200) {
                     Logger.getLogger("ResponseReceived").fine("GET Ok for: " + URI);
                     Node responseNode;
                     try {
                     responseNode = (Node)XMLDOM.parseXML(response.getText());
                     } catch(Exception e) {
                      handleException (new RuntimeException(e.getMessage()), "onResponseReceived");
                      return;
                     }
                     DocumentInfo responseDoc = config.wrapXMLDocument(responseNode, URI);
                     // now document is here, we can transform it
                     Node result = invokeTransform(responseDoc, transformTarget);
                     hr.setResultNode(result); // TODO: This isn't used yet
                       // handle OK response from the server
                   } else if (statusCode < 400) {
                     // transient
                   } else {
                     String msg = "HTTP Error " + statusCode + " " + response.getStatusText() + " for URI " + URI;
View Full Code Here

Examples of com.alibaba.dubbo.remoting.http.HttpHandler

      DispatcherServlet.INSTANCE = this;
    }

    protected void service(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
        HttpHandler handler = handlers.get(request.getLocalPort());
        if( handler == null ) {// service not found.
            response.sendError(HttpServletResponse.SC_NOT_FOUND, "Service not found.");
        } else {
            handler.handle(request, response);
        }
    }
View Full Code Here

Examples of com.firefly.server.http.HttpHandler

        .getInstance().init(context);

    config.setEncoding(context.getEncoding());

    Server server = new TcpServer(new HttpDecoder(config),
        new HttpEncoder(), new HttpHandler(controller, config));
    server.start(config.getHost(), config.getPort());
    long end = System.currentTimeMillis();
    log.info("firefly startup in {} ms", (end - start));
  }
View Full Code Here

Examples of com.sun.net.httpserver.HttpHandler

        logger.error("jobManager:" + jobManager + ", config:" + jobManager.getConfig());
      HttpServer httpServer = HttpServer.create(
          new InetSocketAddress(jobManager.getConfig().getHttpPort()), 0);
      httpServer.createContext(
          jobManager.getConfig().getHttpContext(),
          new HttpHandler() {
            private AtomicInteger checkCnt=new AtomicInteger(0);
            private AtomicInteger configCnt=new AtomicInteger(0);
            @Override
            public void handle(final HttpExchange arg0)throws IOException {
                try{
View Full Code Here

Examples of com.sun.net.httpserver.HttpHandler

  public static void init() throws IOException {
    // create a new server listening at port 8080
    server = HttpServer.create(new InetSocketAddress(uri.getPort()), 0);

    // create a handler wrapping the JAX-RS application
    HttpHandler handler = RuntimeDelegate.getInstance().createEndpoint(new ApplicationConfig15(), HttpHandler.class);

    // map JAX-RS handler to the server root
    server.createContext(uri.getPath(), handler);

    // start the server
View Full Code Here

Examples of com.sun.net.httpserver.HttpHandler

  public static void init() throws IOException {
    // create a new server listening at port 8080
    server = HttpServer.create(new InetSocketAddress(uri.getPort()), 0);

    // create a handler wrapping the JAX-RS application
    HttpHandler handler = RuntimeDelegate.getInstance().createEndpoint(new ApplicationConfig18(), HttpHandler.class);

    // map JAX-RS handler to the server root
    server.createContext(uri.getPath(), handler);

    // start the server
View Full Code Here

Examples of getFilePkg.net.applicationprotocol.http.HTTPHandler

      ConnectionItem nextConnection=new ConnectionItem(filename,
          startByte,endByte);
      ApplicationProtocol appProto=null;
      switch(downloadManager.protocol){
      case Protocol.HTTP:{
        appProto=new HTTPHandler();
        break;
      }
      }
      nextConnection.setConnectionStatus(DownloadStatus.Downloading);
      //nextConnection.connectionThread=this;
      downloadManager.connectionList.add(nextConnection);
      storeObject();
      appProto.connect(downloadManager.host);
      appProto.get(downloadManager.url, filename,startByte,endByte);
      nextConnection.setConnectionStatus(DownloadStatus.Downloaded);
      break;
    }
    case Task.Resume:{
      ApplicationProtocol appProto=null;
      switch(downloadManager.protocol){
      case Protocol.HTTP:{
        appProto=new HTTPHandler();
        break;
      }
      }
      if(connectionItem.getConnectionStatus()==DownloadStatus.Downloading){
        //downloadManager.connectionList.add(connectionItem);
View Full Code Here

Examples of io.undertow.server.HttpHandler

                    boolean defaultServletMatch = targetServletMatch.defaultServlet;
                    if (defaultServletMatch && extensionServlets.containsKey(entry.getKey())) {
                        defaultServletMatch = false;
                        pathServlet = extensionServlets.get(entry.getKey());
                    }
                    HttpHandler handler = pathServlet;
                    if (!entry.getValue().isEmpty()) {
                        handler = new FilterHandler(entry.getValue(), deploymentInfo.isAllowNonStandardWrappers(), handler);
                    }
                    builder.addExtensionMatch(prefix, entry.getKey(), servletChain(handler, pathServlet.getManagedServlet(), pathMatch, deploymentInfo, defaultServletMatch));
                }
View Full Code Here

Examples of io.undertow.server.HttpHandler

        }
        list.add(value);
    }

    private static ServletChain servletChain(HttpHandler next, final ManagedServlet managedServlet, final String servletPath, final DeploymentInfo deploymentInfo, boolean defaultServlet) {
        HttpHandler servletHandler = new ServletSecurityRoleHandler(next, deploymentInfo.getAuthorizationManager());
        servletHandler = wrapHandlers(servletHandler, managedServlet.getServletInfo().getHandlerChainWrappers());
        return new ServletChain(servletHandler, managedServlet, servletPath, defaultServlet);
    }
View Full Code Here

Examples of io.undertow.server.HttpHandler

        servletHandler = wrapHandlers(servletHandler, managedServlet.getServletInfo().getHandlerChainWrappers());
        return new ServletChain(servletHandler, managedServlet, servletPath, defaultServlet);
    }

    private static HttpHandler wrapHandlers(final HttpHandler wrapee, final List<HandlerWrapper> wrappers) {
        HttpHandler current = wrapee;
        for (HandlerWrapper wrapper : wrappers) {
            current = wrapper.wrap(current);
        }
        return current;
    }
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.