1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/server/MonitorRootService.java Tue Mar 06 16:09:35 2012 -0800 1.3 @@ -0,0 +1,253 @@ 1.4 +/* 1.5 + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. Oracle designates this 1.11 + * particular file as subject to the "Classpath" exception as provided 1.12 + * by Oracle in the LICENSE file that accompanied this code. 1.13 + * 1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 + * version 2 for more details (a copy is included in the LICENSE file that 1.18 + * accompanied this code). 1.19 + * 1.20 + * You should have received a copy of the GNU General Public License version 1.21 + * 2 along with this work; if not, write to the Free Software Foundation, 1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 + * 1.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.25 + * or visit www.oracle.com if you need additional information or have any 1.26 + * questions. 1.27 + */ 1.28 + 1.29 +package com.sun.xml.internal.ws.server; 1.30 + 1.31 +import com.sun.istack.internal.NotNull; 1.32 +import com.sun.istack.internal.Nullable; 1.33 +import com.sun.xml.internal.ws.api.SOAPVersion; 1.34 +import com.sun.xml.internal.ws.api.BindingID; 1.35 +import com.sun.xml.internal.ws.api.WSFeatureList; 1.36 +import com.sun.xml.internal.ws.api.WSBinding; 1.37 +import com.sun.xml.internal.ws.api.EndpointAddress; 1.38 +import com.sun.xml.internal.ws.api.addressing.AddressingVersion; 1.39 +import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; 1.40 +import com.sun.xml.internal.ws.api.message.Message; 1.41 +import com.sun.xml.internal.ws.api.message.Packet; 1.42 +import com.sun.xml.internal.ws.api.model.SEIModel; 1.43 +import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; 1.44 +import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType; 1.45 +import com.sun.xml.internal.ws.api.model.wsdl.WSDLService; 1.46 +import com.sun.xml.internal.ws.api.pipe.Codec; 1.47 +import com.sun.xml.internal.ws.api.pipe.Engine; 1.48 +import com.sun.xml.internal.ws.api.pipe.Fiber; 1.49 +import com.sun.xml.internal.ws.api.pipe.FiberContextSwitchInterceptor; 1.50 +import com.sun.xml.internal.ws.api.pipe.ServerPipeAssemblerContext; 1.51 +import com.sun.xml.internal.ws.api.pipe.ServerTubeAssemblerContext; 1.52 +import com.sun.xml.internal.ws.api.pipe.Tube; 1.53 +import com.sun.xml.internal.ws.api.pipe.TubeCloner; 1.54 +import com.sun.xml.internal.ws.api.pipe.TubelineAssembler; 1.55 +import com.sun.xml.internal.ws.api.pipe.TubelineAssemblerFactory; 1.56 +import com.sun.xml.internal.ws.api.server.*; 1.57 +import com.sun.xml.internal.ws.fault.SOAPFaultBuilder; 1.58 +import com.sun.xml.internal.ws.model.wsdl.WSDLProperties; 1.59 +import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl; 1.60 +import com.sun.xml.internal.ws.resources.HandlerMessages; 1.61 +import com.sun.xml.internal.ws.transport.http.HttpAdapter; 1.62 +import com.sun.xml.internal.ws.util.RuntimeVersion; 1.63 +import com.sun.org.glassfish.external.amx.AMXGlassfish; 1.64 +import com.sun.org.glassfish.gmbal.AMXMetadata; 1.65 +import com.sun.org.glassfish.gmbal.Description; 1.66 +import com.sun.org.glassfish.gmbal.InheritedAttribute; 1.67 +import com.sun.org.glassfish.gmbal.InheritedAttributes; 1.68 +import com.sun.org.glassfish.gmbal.ManagedAttribute; 1.69 +import com.sun.org.glassfish.gmbal.ManagedData; 1.70 +import com.sun.org.glassfish.gmbal.ManagedObject; 1.71 +import com.sun.org.glassfish.gmbal.ManagedObjectManager; 1.72 +import com.sun.org.glassfish.gmbal.ManagedObjectManagerFactory; 1.73 +import java.net.URL; 1.74 +import javax.management.ObjectName; 1.75 + 1.76 + 1.77 +import javax.annotation.PreDestroy; 1.78 +import javax.xml.namespace.QName; 1.79 +import javax.xml.ws.EndpointReference; 1.80 +import javax.xml.ws.WebServiceException; 1.81 +import javax.xml.ws.handler.Handler; 1.82 +import javax.xml.stream.XMLStreamException; 1.83 +import javax.management.InstanceAlreadyExistsException; 1.84 +import java.lang.reflect.Method; 1.85 +import java.util.*; 1.86 +import java.util.concurrent.Executor; 1.87 +import java.util.logging.Level; 1.88 +import java.util.logging.Logger; 1.89 + 1.90 +/** 1.91 + * @author Harold Carr 1.92 + */ 1.93 +@ManagedObject 1.94 +@Description("Metro Web Service endpoint") 1.95 +@AMXMetadata(type="WSEndpoint") 1.96 +public final class MonitorRootService extends MonitorBase { 1.97 + 1.98 + private final WSEndpoint endpoint; 1.99 + 1.100 + MonitorRootService(final WSEndpoint endpoint) { 1.101 + this.endpoint = endpoint; 1.102 + } 1.103 + 1.104 + // 1.105 + // Items from WSEndpoint 1.106 + // 1.107 + 1.108 + @ManagedAttribute 1.109 + @Description("Policy associated with Endpoint") 1.110 + public String policy() { 1.111 + return endpoint.getPolicyMap() != null ? 1.112 + endpoint.getPolicyMap().toString() : null; 1.113 + } 1.114 + 1.115 + @ManagedAttribute 1.116 + @Description("Container") 1.117 + public @NotNull Container container() { 1.118 + return endpoint.getContainer(); 1.119 + } 1.120 + 1.121 + 1.122 + @ManagedAttribute 1.123 + @Description("Port name") 1.124 + public @NotNull QName portName() { 1.125 + return endpoint.getPortName(); 1.126 + } 1.127 + 1.128 + @ManagedAttribute 1.129 + @Description("Service name") 1.130 + public @NotNull QName serviceName() { 1.131 + return endpoint.getServiceName(); 1.132 + } 1.133 + 1.134 + // 1.135 + // Items from assembler context 1.136 + // 1.137 + /* NOTE: These are not ready when the AMX Validator runs so NPE. 1.138 + @ManagedAttribute 1.139 + @Description("The last tube in the dispatch chain") 1.140 + public @NotNull Tube terminalTube() { 1.141 + return endpoint.getAssemblerContext().getTerminalTube(); 1.142 + } 1.143 + 1.144 + @ManagedAttribute 1.145 + @Description("True if tubeline is known to be used for serving synchronous transport") 1.146 + public boolean synchronous() { 1.147 + return endpoint.getAssemblerContext().isSynchronous(); 1.148 + } 1.149 + 1.150 + @ManagedAttribute 1.151 + @Description("") 1.152 + public String codecMimeType() { 1.153 + return endpoint.getAssemblerContext().getCodec().getMimeType(); 1.154 + } 1.155 + */ 1.156 + // 1.157 + // Items from WSBinding 1.158 + // 1.159 + 1.160 + @ManagedAttribute 1.161 + @Description("Binding SOAP Version") 1.162 + public String soapVersionHttpBindingId() { 1.163 + return endpoint.getBinding().getSOAPVersion().httpBindingId; 1.164 + } 1.165 + 1.166 + @ManagedAttribute 1.167 + @Description("Binding Addressing Version") 1.168 + public AddressingVersion addressingVersion() { 1.169 + return endpoint.getBinding().getAddressingVersion(); 1.170 + } 1.171 + 1.172 + @ManagedAttribute 1.173 + @Description("Binding Identifier") 1.174 + public @NotNull BindingID bindingID() { 1.175 + return endpoint.getBinding().getBindingId(); 1.176 + } 1.177 + 1.178 + @ManagedAttribute 1.179 + @Description("Binding features") 1.180 + public @NotNull WSFeatureList features() { 1.181 + return endpoint.getBinding().getFeatures(); 1.182 + } 1.183 + 1.184 + // 1.185 + // Items from WSDLPort 1.186 + // 1.187 + 1.188 + @ManagedAttribute 1.189 + @Description("WSDLPort bound port type") 1.190 + public QName wsdlPortTypeName() { 1.191 + return endpoint.getPort() != null ? 1.192 + endpoint.getPort().getBinding().getPortTypeName() : null; 1.193 + } 1.194 + 1.195 + @ManagedAttribute 1.196 + @Description("Endpoint address") 1.197 + public EndpointAddress wsdlEndpointAddress() { 1.198 + return endpoint.getPort() != null ? 1.199 + endpoint.getPort().getAddress() : null; 1.200 + } 1.201 + 1.202 + // 1.203 + // Items from ServiceDefinition 1.204 + // 1.205 + 1.206 + @ManagedAttribute 1.207 + @Description("Documents referenced") 1.208 + public Set<String> serviceDefinitionImports() { 1.209 + return endpoint.getServiceDefinition() != null ? 1.210 + endpoint.getServiceDefinition().getPrimary().getImports() : null; 1.211 + } 1.212 + 1.213 + @ManagedAttribute 1.214 + @Description("System ID where document is taken from") 1.215 + public URL serviceDefinitionURL() { 1.216 + return endpoint.getServiceDefinition() != null ? 1.217 + endpoint.getServiceDefinition().getPrimary().getURL() : null; 1.218 + } 1.219 + 1.220 + // 1.221 + // Items from SEIModel 1.222 + // 1.223 + 1.224 + @ManagedAttribute 1.225 + @Description("SEI model WSDL location") 1.226 + public String seiModelWSDLLocation() { 1.227 + return endpoint.getSEIModel() != null ? 1.228 + endpoint.getSEIModel().getWSDLLocation() : null; 1.229 + } 1.230 + 1.231 + // 1.232 + // Items from RuntimeVersion 1.233 + // 1.234 + 1.235 + @ManagedAttribute 1.236 + @Description("JAX-WS runtime version") 1.237 + public String jaxwsRuntimeVersion() { 1.238 + return RuntimeVersion.VERSION.toString(); 1.239 + } 1.240 + 1.241 + // 1.242 + // Items from HttpAdapter 1.243 + // 1.244 + 1.245 + @ManagedAttribute 1.246 + @Description("If true: show what goes across HTTP transport") 1.247 + public boolean dumpHTTPMessages() { return HttpAdapter.dump; } 1.248 + 1.249 + 1.250 + @ManagedAttribute 1.251 + @Description("Show what goes across HTTP transport") 1.252 + public void dumpHTTPMessages(final boolean x) { HttpAdapter.dump = x; } 1.253 + 1.254 +} 1.255 + 1.256 +// End of file.