src/share/jaxws_classes/com/sun/xml/internal/ws/server/MonitorRootService.java

Thu, 31 Aug 2017 15:18:52 +0800

author
aoqi
date
Thu, 31 Aug 2017 15:18:52 +0800
changeset 637
9c07ef4934dd
parent 368
0989ad8c0860
parent 0
373ffda63c9a
permissions
-rw-r--r--

merge

     1 /*
     2  * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     8  * particular file as subject to the "Classpath" exception as provided
     9  * by Oracle in the LICENSE file that accompanied this code.
    10  *
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    14  * version 2 for more details (a copy is included in the LICENSE file that
    15  * accompanied this code).
    16  *
    17  * You should have received a copy of the GNU General Public License version
    18  * 2 along with this work; if not, write to the Free Software Foundation,
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    20  *
    21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    22  * or visit www.oracle.com if you need additional information or have any
    23  * questions.
    24  */
    26 package com.sun.xml.internal.ws.server;
    28 import com.sun.istack.internal.NotNull;
    29 import com.sun.xml.internal.ws.api.BindingID;
    30 import com.sun.xml.internal.ws.api.WSFeatureList;
    31 import com.sun.xml.internal.ws.api.EndpointAddress;
    32 import com.sun.xml.internal.ws.api.addressing.AddressingVersion;
    33 import com.sun.xml.internal.ws.api.server.*;
    34 import com.sun.xml.internal.ws.transport.http.HttpAdapter;
    35 import com.sun.xml.internal.ws.util.RuntimeVersion;
    36 import com.sun.org.glassfish.gmbal.AMXMetadata;
    37 import com.sun.org.glassfish.gmbal.Description;
    38 import com.sun.org.glassfish.gmbal.ManagedAttribute;
    39 import com.sun.org.glassfish.gmbal.ManagedObject;
    40 import java.net.URL;
    41 import javax.xml.namespace.QName;
    42 import java.util.*;
    44 /**
    45  * @author Harold Carr
    46  */
    47 @ManagedObject
    48 @Description("Metro Web Service endpoint")
    49 @AMXMetadata(type="WSEndpoint")
    50 public final class MonitorRootService extends MonitorBase {
    52     private final WSEndpoint endpoint;
    54     MonitorRootService(final WSEndpoint endpoint) {
    55         this.endpoint = endpoint;
    56     }
    58     //
    59     // Items from WSEndpoint
    60     //
    62     @ManagedAttribute
    63     @Description("Policy associated with Endpoint")
    64     public String policy() {
    65         return endpoint.getPolicyMap() != null ?
    66                endpoint.getPolicyMap().toString() : null;
    67     }
    69     @ManagedAttribute
    70     @Description("Container")
    71     public @NotNull Container container() {
    72         return endpoint.getContainer();
    73     }
    76     @ManagedAttribute
    77     @Description("Port name")
    78     public @NotNull QName portName() {
    79         return endpoint.getPortName();
    80     }
    82     @ManagedAttribute
    83     @Description("Service name")
    84     public @NotNull QName serviceName() {
    85         return endpoint.getServiceName();
    86     }
    88     //
    89     // Items from WSBinding
    90     //
    92     @ManagedAttribute
    93     @Description("Binding SOAP Version")
    94     public String soapVersionHttpBindingId() {
    95         return endpoint.getBinding().getSOAPVersion().httpBindingId;
    96     }
    98     @ManagedAttribute
    99     @Description("Binding Addressing Version")
   100     public AddressingVersion addressingVersion() {
   101         return endpoint.getBinding().getAddressingVersion();
   102     }
   104     @ManagedAttribute
   105     @Description("Binding Identifier")
   106     public @NotNull BindingID bindingID() {
   107         return endpoint.getBinding().getBindingId();
   108     }
   110     @ManagedAttribute
   111     @Description("Binding features")
   112     public @NotNull WSFeatureList features() {
   113         return endpoint.getBinding().getFeatures();
   114     }
   116     //
   117     // Items from WSDLPort
   118     //
   120     @ManagedAttribute
   121     @Description("WSDLPort bound port type")
   122     public QName wsdlPortTypeName() {
   123         return endpoint.getPort() != null ?
   124                endpoint.getPort().getBinding().getPortTypeName() : null;
   125     }
   127     @ManagedAttribute
   128     @Description("Endpoint address")
   129     public EndpointAddress wsdlEndpointAddress() {
   130         return endpoint.getPort() != null ?
   131                endpoint.getPort().getAddress() : null;
   132     }
   134     //
   135     // Items from ServiceDefinition
   136     //
   138     @ManagedAttribute
   139     @Description("Documents referenced")
   140     public Set<String> serviceDefinitionImports() {
   141         return endpoint.getServiceDefinition() != null ?
   142                endpoint.getServiceDefinition().getPrimary().getImports() : null;
   143     }
   145     @ManagedAttribute
   146     @Description("System ID where document is taken from")
   147     public URL serviceDefinitionURL() {
   148         return endpoint.getServiceDefinition() != null ?
   149                endpoint.getServiceDefinition().getPrimary().getURL() : null;
   150     }
   152     //
   153     // Items from SEIModel
   154     //
   156     @ManagedAttribute
   157     @Description("SEI model WSDL location")
   158     public String seiModelWSDLLocation() {
   159         return endpoint.getSEIModel() != null ?
   160                endpoint.getSEIModel().getWSDLLocation() : null;
   161     }
   163     //
   164     // Items from RuntimeVersion
   165     //
   167     @ManagedAttribute
   168     @Description("JAX-WS runtime version")
   169     public String jaxwsRuntimeVersion() {
   170         return RuntimeVersion.VERSION.toString();
   171     }
   173     //
   174     // Items from HttpAdapter
   175     //
   177     @ManagedAttribute
   178     @Description("If true: show what goes across HTTP transport")
   179     public boolean dumpHTTPMessages() { return HttpAdapter.dump; }
   182     @ManagedAttribute
   183     @Description("Show what goes across HTTP transport")
   184     public void dumpHTTPMessages(final boolean x) { HttpAdapter.setDump(x); }
   186 }
   188 // End of file.

mercurial