Tue, 06 Mar 2012 16:09:35 -0800
7150322: Stop using drop source bundles in jaxws
Reviewed-by: darcy, ohrstrom
ohair@286 | 1 | /* |
ohair@286 | 2 | * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
ohair@286 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
ohair@286 | 4 | * |
ohair@286 | 5 | * This code is free software; you can redistribute it and/or modify it |
ohair@286 | 6 | * under the terms of the GNU General Public License version 2 only, as |
ohair@286 | 7 | * published by the Free Software Foundation. Oracle designates this |
ohair@286 | 8 | * particular file as subject to the "Classpath" exception as provided |
ohair@286 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
ohair@286 | 10 | * |
ohair@286 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
ohair@286 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
ohair@286 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
ohair@286 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
ohair@286 | 15 | * accompanied this code). |
ohair@286 | 16 | * |
ohair@286 | 17 | * You should have received a copy of the GNU General Public License version |
ohair@286 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
ohair@286 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
ohair@286 | 20 | * |
ohair@286 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@286 | 22 | * or visit www.oracle.com if you need additional information or have any |
ohair@286 | 23 | * questions. |
ohair@286 | 24 | */ |
ohair@286 | 25 | |
ohair@286 | 26 | package com.sun.xml.internal.ws.server; |
ohair@286 | 27 | |
ohair@286 | 28 | import com.sun.istack.internal.NotNull; |
ohair@286 | 29 | import com.sun.istack.internal.Nullable; |
ohair@286 | 30 | import com.sun.xml.internal.ws.api.SOAPVersion; |
ohair@286 | 31 | import com.sun.xml.internal.ws.api.BindingID; |
ohair@286 | 32 | import com.sun.xml.internal.ws.api.WSFeatureList; |
ohair@286 | 33 | import com.sun.xml.internal.ws.api.WSBinding; |
ohair@286 | 34 | import com.sun.xml.internal.ws.api.EndpointAddress; |
ohair@286 | 35 | import com.sun.xml.internal.ws.api.addressing.AddressingVersion; |
ohair@286 | 36 | import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; |
ohair@286 | 37 | import com.sun.xml.internal.ws.api.message.Message; |
ohair@286 | 38 | import com.sun.xml.internal.ws.api.message.Packet; |
ohair@286 | 39 | import com.sun.xml.internal.ws.api.model.SEIModel; |
ohair@286 | 40 | import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; |
ohair@286 | 41 | import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType; |
ohair@286 | 42 | import com.sun.xml.internal.ws.api.model.wsdl.WSDLService; |
ohair@286 | 43 | import com.sun.xml.internal.ws.api.pipe.Codec; |
ohair@286 | 44 | import com.sun.xml.internal.ws.api.pipe.Engine; |
ohair@286 | 45 | import com.sun.xml.internal.ws.api.pipe.Fiber; |
ohair@286 | 46 | import com.sun.xml.internal.ws.api.pipe.FiberContextSwitchInterceptor; |
ohair@286 | 47 | import com.sun.xml.internal.ws.api.pipe.ServerPipeAssemblerContext; |
ohair@286 | 48 | import com.sun.xml.internal.ws.api.pipe.ServerTubeAssemblerContext; |
ohair@286 | 49 | import com.sun.xml.internal.ws.api.pipe.Tube; |
ohair@286 | 50 | import com.sun.xml.internal.ws.api.pipe.TubeCloner; |
ohair@286 | 51 | import com.sun.xml.internal.ws.api.pipe.TubelineAssembler; |
ohair@286 | 52 | import com.sun.xml.internal.ws.api.pipe.TubelineAssemblerFactory; |
ohair@286 | 53 | import com.sun.xml.internal.ws.api.server.*; |
ohair@286 | 54 | import com.sun.xml.internal.ws.fault.SOAPFaultBuilder; |
ohair@286 | 55 | import com.sun.xml.internal.ws.model.wsdl.WSDLProperties; |
ohair@286 | 56 | import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl; |
ohair@286 | 57 | import com.sun.xml.internal.ws.resources.HandlerMessages; |
ohair@286 | 58 | import com.sun.xml.internal.ws.transport.http.HttpAdapter; |
ohair@286 | 59 | import com.sun.xml.internal.ws.util.RuntimeVersion; |
ohair@286 | 60 | import com.sun.org.glassfish.external.amx.AMXGlassfish; |
ohair@286 | 61 | import com.sun.org.glassfish.gmbal.AMXMetadata; |
ohair@286 | 62 | import com.sun.org.glassfish.gmbal.Description; |
ohair@286 | 63 | import com.sun.org.glassfish.gmbal.InheritedAttribute; |
ohair@286 | 64 | import com.sun.org.glassfish.gmbal.InheritedAttributes; |
ohair@286 | 65 | import com.sun.org.glassfish.gmbal.ManagedAttribute; |
ohair@286 | 66 | import com.sun.org.glassfish.gmbal.ManagedData; |
ohair@286 | 67 | import com.sun.org.glassfish.gmbal.ManagedObject; |
ohair@286 | 68 | import com.sun.org.glassfish.gmbal.ManagedObjectManager; |
ohair@286 | 69 | import com.sun.org.glassfish.gmbal.ManagedObjectManagerFactory; |
ohair@286 | 70 | import java.net.URL; |
ohair@286 | 71 | import javax.management.ObjectName; |
ohair@286 | 72 | |
ohair@286 | 73 | |
ohair@286 | 74 | import javax.annotation.PreDestroy; |
ohair@286 | 75 | import javax.xml.namespace.QName; |
ohair@286 | 76 | import javax.xml.ws.EndpointReference; |
ohair@286 | 77 | import javax.xml.ws.WebServiceException; |
ohair@286 | 78 | import javax.xml.ws.handler.Handler; |
ohair@286 | 79 | import javax.xml.stream.XMLStreamException; |
ohair@286 | 80 | import javax.management.InstanceAlreadyExistsException; |
ohair@286 | 81 | import java.lang.reflect.Method; |
ohair@286 | 82 | import java.util.*; |
ohair@286 | 83 | import java.util.concurrent.Executor; |
ohair@286 | 84 | import java.util.logging.Level; |
ohair@286 | 85 | import java.util.logging.Logger; |
ohair@286 | 86 | |
ohair@286 | 87 | /** |
ohair@286 | 88 | * @author Harold Carr |
ohair@286 | 89 | */ |
ohair@286 | 90 | @ManagedObject |
ohair@286 | 91 | @Description("Metro Web Service endpoint") |
ohair@286 | 92 | @AMXMetadata(type="WSEndpoint") |
ohair@286 | 93 | public final class MonitorRootService extends MonitorBase { |
ohair@286 | 94 | |
ohair@286 | 95 | private final WSEndpoint endpoint; |
ohair@286 | 96 | |
ohair@286 | 97 | MonitorRootService(final WSEndpoint endpoint) { |
ohair@286 | 98 | this.endpoint = endpoint; |
ohair@286 | 99 | } |
ohair@286 | 100 | |
ohair@286 | 101 | // |
ohair@286 | 102 | // Items from WSEndpoint |
ohair@286 | 103 | // |
ohair@286 | 104 | |
ohair@286 | 105 | @ManagedAttribute |
ohair@286 | 106 | @Description("Policy associated with Endpoint") |
ohair@286 | 107 | public String policy() { |
ohair@286 | 108 | return endpoint.getPolicyMap() != null ? |
ohair@286 | 109 | endpoint.getPolicyMap().toString() : null; |
ohair@286 | 110 | } |
ohair@286 | 111 | |
ohair@286 | 112 | @ManagedAttribute |
ohair@286 | 113 | @Description("Container") |
ohair@286 | 114 | public @NotNull Container container() { |
ohair@286 | 115 | return endpoint.getContainer(); |
ohair@286 | 116 | } |
ohair@286 | 117 | |
ohair@286 | 118 | |
ohair@286 | 119 | @ManagedAttribute |
ohair@286 | 120 | @Description("Port name") |
ohair@286 | 121 | public @NotNull QName portName() { |
ohair@286 | 122 | return endpoint.getPortName(); |
ohair@286 | 123 | } |
ohair@286 | 124 | |
ohair@286 | 125 | @ManagedAttribute |
ohair@286 | 126 | @Description("Service name") |
ohair@286 | 127 | public @NotNull QName serviceName() { |
ohair@286 | 128 | return endpoint.getServiceName(); |
ohair@286 | 129 | } |
ohair@286 | 130 | |
ohair@286 | 131 | // |
ohair@286 | 132 | // Items from assembler context |
ohair@286 | 133 | // |
ohair@286 | 134 | /* NOTE: These are not ready when the AMX Validator runs so NPE. |
ohair@286 | 135 | @ManagedAttribute |
ohair@286 | 136 | @Description("The last tube in the dispatch chain") |
ohair@286 | 137 | public @NotNull Tube terminalTube() { |
ohair@286 | 138 | return endpoint.getAssemblerContext().getTerminalTube(); |
ohair@286 | 139 | } |
ohair@286 | 140 | |
ohair@286 | 141 | @ManagedAttribute |
ohair@286 | 142 | @Description("True if tubeline is known to be used for serving synchronous transport") |
ohair@286 | 143 | public boolean synchronous() { |
ohair@286 | 144 | return endpoint.getAssemblerContext().isSynchronous(); |
ohair@286 | 145 | } |
ohair@286 | 146 | |
ohair@286 | 147 | @ManagedAttribute |
ohair@286 | 148 | @Description("") |
ohair@286 | 149 | public String codecMimeType() { |
ohair@286 | 150 | return endpoint.getAssemblerContext().getCodec().getMimeType(); |
ohair@286 | 151 | } |
ohair@286 | 152 | */ |
ohair@286 | 153 | // |
ohair@286 | 154 | // Items from WSBinding |
ohair@286 | 155 | // |
ohair@286 | 156 | |
ohair@286 | 157 | @ManagedAttribute |
ohair@286 | 158 | @Description("Binding SOAP Version") |
ohair@286 | 159 | public String soapVersionHttpBindingId() { |
ohair@286 | 160 | return endpoint.getBinding().getSOAPVersion().httpBindingId; |
ohair@286 | 161 | } |
ohair@286 | 162 | |
ohair@286 | 163 | @ManagedAttribute |
ohair@286 | 164 | @Description("Binding Addressing Version") |
ohair@286 | 165 | public AddressingVersion addressingVersion() { |
ohair@286 | 166 | return endpoint.getBinding().getAddressingVersion(); |
ohair@286 | 167 | } |
ohair@286 | 168 | |
ohair@286 | 169 | @ManagedAttribute |
ohair@286 | 170 | @Description("Binding Identifier") |
ohair@286 | 171 | public @NotNull BindingID bindingID() { |
ohair@286 | 172 | return endpoint.getBinding().getBindingId(); |
ohair@286 | 173 | } |
ohair@286 | 174 | |
ohair@286 | 175 | @ManagedAttribute |
ohair@286 | 176 | @Description("Binding features") |
ohair@286 | 177 | public @NotNull WSFeatureList features() { |
ohair@286 | 178 | return endpoint.getBinding().getFeatures(); |
ohair@286 | 179 | } |
ohair@286 | 180 | |
ohair@286 | 181 | // |
ohair@286 | 182 | // Items from WSDLPort |
ohair@286 | 183 | // |
ohair@286 | 184 | |
ohair@286 | 185 | @ManagedAttribute |
ohair@286 | 186 | @Description("WSDLPort bound port type") |
ohair@286 | 187 | public QName wsdlPortTypeName() { |
ohair@286 | 188 | return endpoint.getPort() != null ? |
ohair@286 | 189 | endpoint.getPort().getBinding().getPortTypeName() : null; |
ohair@286 | 190 | } |
ohair@286 | 191 | |
ohair@286 | 192 | @ManagedAttribute |
ohair@286 | 193 | @Description("Endpoint address") |
ohair@286 | 194 | public EndpointAddress wsdlEndpointAddress() { |
ohair@286 | 195 | return endpoint.getPort() != null ? |
ohair@286 | 196 | endpoint.getPort().getAddress() : null; |
ohair@286 | 197 | } |
ohair@286 | 198 | |
ohair@286 | 199 | // |
ohair@286 | 200 | // Items from ServiceDefinition |
ohair@286 | 201 | // |
ohair@286 | 202 | |
ohair@286 | 203 | @ManagedAttribute |
ohair@286 | 204 | @Description("Documents referenced") |
ohair@286 | 205 | public Set<String> serviceDefinitionImports() { |
ohair@286 | 206 | return endpoint.getServiceDefinition() != null ? |
ohair@286 | 207 | endpoint.getServiceDefinition().getPrimary().getImports() : null; |
ohair@286 | 208 | } |
ohair@286 | 209 | |
ohair@286 | 210 | @ManagedAttribute |
ohair@286 | 211 | @Description("System ID where document is taken from") |
ohair@286 | 212 | public URL serviceDefinitionURL() { |
ohair@286 | 213 | return endpoint.getServiceDefinition() != null ? |
ohair@286 | 214 | endpoint.getServiceDefinition().getPrimary().getURL() : null; |
ohair@286 | 215 | } |
ohair@286 | 216 | |
ohair@286 | 217 | // |
ohair@286 | 218 | // Items from SEIModel |
ohair@286 | 219 | // |
ohair@286 | 220 | |
ohair@286 | 221 | @ManagedAttribute |
ohair@286 | 222 | @Description("SEI model WSDL location") |
ohair@286 | 223 | public String seiModelWSDLLocation() { |
ohair@286 | 224 | return endpoint.getSEIModel() != null ? |
ohair@286 | 225 | endpoint.getSEIModel().getWSDLLocation() : null; |
ohair@286 | 226 | } |
ohair@286 | 227 | |
ohair@286 | 228 | // |
ohair@286 | 229 | // Items from RuntimeVersion |
ohair@286 | 230 | // |
ohair@286 | 231 | |
ohair@286 | 232 | @ManagedAttribute |
ohair@286 | 233 | @Description("JAX-WS runtime version") |
ohair@286 | 234 | public String jaxwsRuntimeVersion() { |
ohair@286 | 235 | return RuntimeVersion.VERSION.toString(); |
ohair@286 | 236 | } |
ohair@286 | 237 | |
ohair@286 | 238 | // |
ohair@286 | 239 | // Items from HttpAdapter |
ohair@286 | 240 | // |
ohair@286 | 241 | |
ohair@286 | 242 | @ManagedAttribute |
ohair@286 | 243 | @Description("If true: show what goes across HTTP transport") |
ohair@286 | 244 | public boolean dumpHTTPMessages() { return HttpAdapter.dump; } |
ohair@286 | 245 | |
ohair@286 | 246 | |
ohair@286 | 247 | @ManagedAttribute |
ohair@286 | 248 | @Description("Show what goes across HTTP transport") |
ohair@286 | 249 | public void dumpHTTPMessages(final boolean x) { HttpAdapter.dump = x; } |
ohair@286 | 250 | |
ohair@286 | 251 | } |
ohair@286 | 252 | |
ohair@286 | 253 | // End of file. |