|
1 /* |
|
2 * Copyright (c) 1997, 2010, 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 */ |
|
25 |
|
26 package com.sun.xml.internal.ws.server; |
|
27 |
|
28 import com.sun.istack.internal.NotNull; |
|
29 import com.sun.istack.internal.Nullable; |
|
30 import com.sun.xml.internal.ws.api.SOAPVersion; |
|
31 import com.sun.xml.internal.ws.api.BindingID; |
|
32 import com.sun.xml.internal.ws.api.WSFeatureList; |
|
33 import com.sun.xml.internal.ws.api.WSBinding; |
|
34 import com.sun.xml.internal.ws.api.EndpointAddress; |
|
35 import com.sun.xml.internal.ws.api.addressing.AddressingVersion; |
|
36 import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; |
|
37 import com.sun.xml.internal.ws.api.message.Message; |
|
38 import com.sun.xml.internal.ws.api.message.Packet; |
|
39 import com.sun.xml.internal.ws.api.model.SEIModel; |
|
40 import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; |
|
41 import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundPortType; |
|
42 import com.sun.xml.internal.ws.api.model.wsdl.WSDLService; |
|
43 import com.sun.xml.internal.ws.api.pipe.Codec; |
|
44 import com.sun.xml.internal.ws.api.pipe.Engine; |
|
45 import com.sun.xml.internal.ws.api.pipe.Fiber; |
|
46 import com.sun.xml.internal.ws.api.pipe.FiberContextSwitchInterceptor; |
|
47 import com.sun.xml.internal.ws.api.pipe.ServerPipeAssemblerContext; |
|
48 import com.sun.xml.internal.ws.api.pipe.ServerTubeAssemblerContext; |
|
49 import com.sun.xml.internal.ws.api.pipe.Tube; |
|
50 import com.sun.xml.internal.ws.api.pipe.TubeCloner; |
|
51 import com.sun.xml.internal.ws.api.pipe.TubelineAssembler; |
|
52 import com.sun.xml.internal.ws.api.pipe.TubelineAssemblerFactory; |
|
53 import com.sun.xml.internal.ws.api.server.*; |
|
54 import com.sun.xml.internal.ws.fault.SOAPFaultBuilder; |
|
55 import com.sun.xml.internal.ws.model.wsdl.WSDLProperties; |
|
56 import com.sun.xml.internal.ws.model.wsdl.WSDLPortImpl; |
|
57 import com.sun.xml.internal.ws.resources.HandlerMessages; |
|
58 import com.sun.xml.internal.ws.transport.http.HttpAdapter; |
|
59 import com.sun.xml.internal.ws.util.RuntimeVersion; |
|
60 import com.sun.org.glassfish.external.amx.AMXGlassfish; |
|
61 import com.sun.org.glassfish.gmbal.AMXMetadata; |
|
62 import com.sun.org.glassfish.gmbal.Description; |
|
63 import com.sun.org.glassfish.gmbal.InheritedAttribute; |
|
64 import com.sun.org.glassfish.gmbal.InheritedAttributes; |
|
65 import com.sun.org.glassfish.gmbal.ManagedAttribute; |
|
66 import com.sun.org.glassfish.gmbal.ManagedData; |
|
67 import com.sun.org.glassfish.gmbal.ManagedObject; |
|
68 import com.sun.org.glassfish.gmbal.ManagedObjectManager; |
|
69 import com.sun.org.glassfish.gmbal.ManagedObjectManagerFactory; |
|
70 import java.net.URL; |
|
71 import javax.management.ObjectName; |
|
72 |
|
73 |
|
74 import javax.annotation.PreDestroy; |
|
75 import javax.xml.namespace.QName; |
|
76 import javax.xml.ws.EndpointReference; |
|
77 import javax.xml.ws.WebServiceException; |
|
78 import javax.xml.ws.handler.Handler; |
|
79 import javax.xml.stream.XMLStreamException; |
|
80 import javax.management.InstanceAlreadyExistsException; |
|
81 import java.lang.reflect.Method; |
|
82 import java.util.*; |
|
83 import java.util.concurrent.Executor; |
|
84 import java.util.logging.Level; |
|
85 import java.util.logging.Logger; |
|
86 |
|
87 /** |
|
88 * @author Harold Carr |
|
89 */ |
|
90 @ManagedObject |
|
91 @Description("Metro Web Service endpoint") |
|
92 @AMXMetadata(type="WSEndpoint") |
|
93 public final class MonitorRootService extends MonitorBase { |
|
94 |
|
95 private final WSEndpoint endpoint; |
|
96 |
|
97 MonitorRootService(final WSEndpoint endpoint) { |
|
98 this.endpoint = endpoint; |
|
99 } |
|
100 |
|
101 // |
|
102 // Items from WSEndpoint |
|
103 // |
|
104 |
|
105 @ManagedAttribute |
|
106 @Description("Policy associated with Endpoint") |
|
107 public String policy() { |
|
108 return endpoint.getPolicyMap() != null ? |
|
109 endpoint.getPolicyMap().toString() : null; |
|
110 } |
|
111 |
|
112 @ManagedAttribute |
|
113 @Description("Container") |
|
114 public @NotNull Container container() { |
|
115 return endpoint.getContainer(); |
|
116 } |
|
117 |
|
118 |
|
119 @ManagedAttribute |
|
120 @Description("Port name") |
|
121 public @NotNull QName portName() { |
|
122 return endpoint.getPortName(); |
|
123 } |
|
124 |
|
125 @ManagedAttribute |
|
126 @Description("Service name") |
|
127 public @NotNull QName serviceName() { |
|
128 return endpoint.getServiceName(); |
|
129 } |
|
130 |
|
131 // |
|
132 // Items from assembler context |
|
133 // |
|
134 /* NOTE: These are not ready when the AMX Validator runs so NPE. |
|
135 @ManagedAttribute |
|
136 @Description("The last tube in the dispatch chain") |
|
137 public @NotNull Tube terminalTube() { |
|
138 return endpoint.getAssemblerContext().getTerminalTube(); |
|
139 } |
|
140 |
|
141 @ManagedAttribute |
|
142 @Description("True if tubeline is known to be used for serving synchronous transport") |
|
143 public boolean synchronous() { |
|
144 return endpoint.getAssemblerContext().isSynchronous(); |
|
145 } |
|
146 |
|
147 @ManagedAttribute |
|
148 @Description("") |
|
149 public String codecMimeType() { |
|
150 return endpoint.getAssemblerContext().getCodec().getMimeType(); |
|
151 } |
|
152 */ |
|
153 // |
|
154 // Items from WSBinding |
|
155 // |
|
156 |
|
157 @ManagedAttribute |
|
158 @Description("Binding SOAP Version") |
|
159 public String soapVersionHttpBindingId() { |
|
160 return endpoint.getBinding().getSOAPVersion().httpBindingId; |
|
161 } |
|
162 |
|
163 @ManagedAttribute |
|
164 @Description("Binding Addressing Version") |
|
165 public AddressingVersion addressingVersion() { |
|
166 return endpoint.getBinding().getAddressingVersion(); |
|
167 } |
|
168 |
|
169 @ManagedAttribute |
|
170 @Description("Binding Identifier") |
|
171 public @NotNull BindingID bindingID() { |
|
172 return endpoint.getBinding().getBindingId(); |
|
173 } |
|
174 |
|
175 @ManagedAttribute |
|
176 @Description("Binding features") |
|
177 public @NotNull WSFeatureList features() { |
|
178 return endpoint.getBinding().getFeatures(); |
|
179 } |
|
180 |
|
181 // |
|
182 // Items from WSDLPort |
|
183 // |
|
184 |
|
185 @ManagedAttribute |
|
186 @Description("WSDLPort bound port type") |
|
187 public QName wsdlPortTypeName() { |
|
188 return endpoint.getPort() != null ? |
|
189 endpoint.getPort().getBinding().getPortTypeName() : null; |
|
190 } |
|
191 |
|
192 @ManagedAttribute |
|
193 @Description("Endpoint address") |
|
194 public EndpointAddress wsdlEndpointAddress() { |
|
195 return endpoint.getPort() != null ? |
|
196 endpoint.getPort().getAddress() : null; |
|
197 } |
|
198 |
|
199 // |
|
200 // Items from ServiceDefinition |
|
201 // |
|
202 |
|
203 @ManagedAttribute |
|
204 @Description("Documents referenced") |
|
205 public Set<String> serviceDefinitionImports() { |
|
206 return endpoint.getServiceDefinition() != null ? |
|
207 endpoint.getServiceDefinition().getPrimary().getImports() : null; |
|
208 } |
|
209 |
|
210 @ManagedAttribute |
|
211 @Description("System ID where document is taken from") |
|
212 public URL serviceDefinitionURL() { |
|
213 return endpoint.getServiceDefinition() != null ? |
|
214 endpoint.getServiceDefinition().getPrimary().getURL() : null; |
|
215 } |
|
216 |
|
217 // |
|
218 // Items from SEIModel |
|
219 // |
|
220 |
|
221 @ManagedAttribute |
|
222 @Description("SEI model WSDL location") |
|
223 public String seiModelWSDLLocation() { |
|
224 return endpoint.getSEIModel() != null ? |
|
225 endpoint.getSEIModel().getWSDLLocation() : null; |
|
226 } |
|
227 |
|
228 // |
|
229 // Items from RuntimeVersion |
|
230 // |
|
231 |
|
232 @ManagedAttribute |
|
233 @Description("JAX-WS runtime version") |
|
234 public String jaxwsRuntimeVersion() { |
|
235 return RuntimeVersion.VERSION.toString(); |
|
236 } |
|
237 |
|
238 // |
|
239 // Items from HttpAdapter |
|
240 // |
|
241 |
|
242 @ManagedAttribute |
|
243 @Description("If true: show what goes across HTTP transport") |
|
244 public boolean dumpHTTPMessages() { return HttpAdapter.dump; } |
|
245 |
|
246 |
|
247 @ManagedAttribute |
|
248 @Description("Show what goes across HTTP transport") |
|
249 public void dumpHTTPMessages(final boolean x) { HttpAdapter.dump = x; } |
|
250 |
|
251 } |
|
252 |
|
253 // End of file. |