src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/PortableHttpHandler.java

changeset 368
0989ad8c0860
parent 286
f50545b5e2f1
child 637
9c07ef4934dd
     1.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/PortableHttpHandler.java	Thu Apr 04 19:05:24 2013 -0700
     1.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/server/PortableHttpHandler.java	Tue Apr 09 14:51:13 2013 +0100
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -35,6 +35,7 @@
    1.11  import javax.xml.ws.spi.http.HttpExchange;
    1.12  import java.io.IOException;
    1.13  import java.util.concurrent.Executor;
    1.14 +import java.util.logging.Level;
    1.15  import java.util.logging.Logger;
    1.16  
    1.17  /**
    1.18 @@ -66,9 +67,12 @@
    1.19      /**
    1.20       * Called by HttpServer when there is a matching request for the context
    1.21       */
    1.22 +    @Override
    1.23      public void handle(HttpExchange msg) {
    1.24          try {
    1.25 -            logger.fine("Received HTTP request:"+msg.getRequestURI());
    1.26 +            if (logger.isLoggable(Level.FINE)) {
    1.27 +                logger.log(Level.FINE, "Received HTTP request:{0}", msg.getRequestURI());
    1.28 +            }
    1.29              if (executor != null) {
    1.30                  // Use application's Executor to handle request. Application may
    1.31                  // have set an executor using Endpoint.setExecutor().
    1.32 @@ -76,16 +80,18 @@
    1.33              } else {
    1.34                  handleExchange(msg);
    1.35              }
    1.36 -        } catch(Throwable e) {
    1.37 +        } catch (Throwable e) {
    1.38              // Dont't propagate the exception otherwise it kills the httpserver
    1.39 -            e.printStackTrace();
    1.40 +            logger.log(Level.SEVERE, null, e);
    1.41          }
    1.42      }
    1.43  
    1.44      public void handleExchange(HttpExchange msg) throws IOException {
    1.45          WSHTTPConnection con = new PortableConnectionImpl(adapter,msg);
    1.46          try {
    1.47 -            logger.fine("Received HTTP request:"+msg.getRequestURI());
    1.48 +            if (logger.isLoggable(Level.FINE)) {
    1.49 +                logger.log(Level.FINE, "Received HTTP request:{0}", msg.getRequestURI());
    1.50 +            }
    1.51              String method = msg.getRequestMethod();
    1.52              if(method.equals(GET_METHOD) || method.equals(POST_METHOD) || method.equals(HEAD_METHOD)
    1.53              || method.equals(PUT_METHOD) || method.equals(DELETE_METHOD)) {
    1.54 @@ -109,6 +115,8 @@
    1.55              this.msg = msg;
    1.56          }
    1.57  
    1.58 +        @Override
    1.59 +        @SuppressWarnings("CallToThreadDumpStack")
    1.60          public void run() {
    1.61              try {
    1.62                  handleExchange(msg);

mercurial