aoqi@0: /* aoqi@0: * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. Oracle designates this aoqi@0: * particular file as subject to the "Classpath" exception as provided aoqi@0: * by Oracle in the LICENSE file that accompanied this code. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: */ aoqi@0: aoqi@0: package com.sun.xml.internal.ws.server; aoqi@0: aoqi@0: import com.sun.istack.internal.NotNull; aoqi@0: import com.sun.xml.internal.ws.api.BindingID; aoqi@0: import com.sun.xml.internal.ws.api.WSFeatureList; aoqi@0: import com.sun.xml.internal.ws.api.EndpointAddress; aoqi@0: import com.sun.xml.internal.ws.api.addressing.AddressingVersion; aoqi@0: import com.sun.xml.internal.ws.api.server.*; aoqi@0: import com.sun.xml.internal.ws.transport.http.HttpAdapter; aoqi@0: import com.sun.xml.internal.ws.util.RuntimeVersion; aoqi@0: import com.sun.org.glassfish.gmbal.AMXMetadata; aoqi@0: import com.sun.org.glassfish.gmbal.Description; aoqi@0: import com.sun.org.glassfish.gmbal.ManagedAttribute; aoqi@0: import com.sun.org.glassfish.gmbal.ManagedObject; aoqi@0: import java.net.URL; aoqi@0: import javax.xml.namespace.QName; aoqi@0: import java.util.*; aoqi@0: aoqi@0: /** aoqi@0: * @author Harold Carr aoqi@0: */ aoqi@0: @ManagedObject aoqi@0: @Description("Metro Web Service endpoint") aoqi@0: @AMXMetadata(type="WSEndpoint") aoqi@0: public final class MonitorRootService extends MonitorBase { aoqi@0: aoqi@0: private final WSEndpoint endpoint; aoqi@0: aoqi@0: MonitorRootService(final WSEndpoint endpoint) { aoqi@0: this.endpoint = endpoint; aoqi@0: } aoqi@0: aoqi@0: // aoqi@0: // Items from WSEndpoint aoqi@0: // aoqi@0: aoqi@0: @ManagedAttribute aoqi@0: @Description("Policy associated with Endpoint") aoqi@0: public String policy() { aoqi@0: return endpoint.getPolicyMap() != null ? aoqi@0: endpoint.getPolicyMap().toString() : null; aoqi@0: } aoqi@0: aoqi@0: @ManagedAttribute aoqi@0: @Description("Container") aoqi@0: public @NotNull Container container() { aoqi@0: return endpoint.getContainer(); aoqi@0: } aoqi@0: aoqi@0: aoqi@0: @ManagedAttribute aoqi@0: @Description("Port name") aoqi@0: public @NotNull QName portName() { aoqi@0: return endpoint.getPortName(); aoqi@0: } aoqi@0: aoqi@0: @ManagedAttribute aoqi@0: @Description("Service name") aoqi@0: public @NotNull QName serviceName() { aoqi@0: return endpoint.getServiceName(); aoqi@0: } aoqi@0: aoqi@0: // aoqi@0: // Items from WSBinding aoqi@0: // aoqi@0: aoqi@0: @ManagedAttribute aoqi@0: @Description("Binding SOAP Version") aoqi@0: public String soapVersionHttpBindingId() { aoqi@0: return endpoint.getBinding().getSOAPVersion().httpBindingId; aoqi@0: } aoqi@0: aoqi@0: @ManagedAttribute aoqi@0: @Description("Binding Addressing Version") aoqi@0: public AddressingVersion addressingVersion() { aoqi@0: return endpoint.getBinding().getAddressingVersion(); aoqi@0: } aoqi@0: aoqi@0: @ManagedAttribute aoqi@0: @Description("Binding Identifier") aoqi@0: public @NotNull BindingID bindingID() { aoqi@0: return endpoint.getBinding().getBindingId(); aoqi@0: } aoqi@0: aoqi@0: @ManagedAttribute aoqi@0: @Description("Binding features") aoqi@0: public @NotNull WSFeatureList features() { aoqi@0: return endpoint.getBinding().getFeatures(); aoqi@0: } aoqi@0: aoqi@0: // aoqi@0: // Items from WSDLPort aoqi@0: // aoqi@0: aoqi@0: @ManagedAttribute aoqi@0: @Description("WSDLPort bound port type") aoqi@0: public QName wsdlPortTypeName() { aoqi@0: return endpoint.getPort() != null ? aoqi@0: endpoint.getPort().getBinding().getPortTypeName() : null; aoqi@0: } aoqi@0: aoqi@0: @ManagedAttribute aoqi@0: @Description("Endpoint address") aoqi@0: public EndpointAddress wsdlEndpointAddress() { aoqi@0: return endpoint.getPort() != null ? aoqi@0: endpoint.getPort().getAddress() : null; aoqi@0: } aoqi@0: aoqi@0: // aoqi@0: // Items from ServiceDefinition aoqi@0: // aoqi@0: aoqi@0: @ManagedAttribute aoqi@0: @Description("Documents referenced") aoqi@0: public Set serviceDefinitionImports() { aoqi@0: return endpoint.getServiceDefinition() != null ? aoqi@0: endpoint.getServiceDefinition().getPrimary().getImports() : null; aoqi@0: } aoqi@0: aoqi@0: @ManagedAttribute aoqi@0: @Description("System ID where document is taken from") aoqi@0: public URL serviceDefinitionURL() { aoqi@0: return endpoint.getServiceDefinition() != null ? aoqi@0: endpoint.getServiceDefinition().getPrimary().getURL() : null; aoqi@0: } aoqi@0: aoqi@0: // aoqi@0: // Items from SEIModel aoqi@0: // aoqi@0: aoqi@0: @ManagedAttribute aoqi@0: @Description("SEI model WSDL location") aoqi@0: public String seiModelWSDLLocation() { aoqi@0: return endpoint.getSEIModel() != null ? aoqi@0: endpoint.getSEIModel().getWSDLLocation() : null; aoqi@0: } aoqi@0: aoqi@0: // aoqi@0: // Items from RuntimeVersion aoqi@0: // aoqi@0: aoqi@0: @ManagedAttribute aoqi@0: @Description("JAX-WS runtime version") aoqi@0: public String jaxwsRuntimeVersion() { aoqi@0: return RuntimeVersion.VERSION.toString(); aoqi@0: } aoqi@0: aoqi@0: // aoqi@0: // Items from HttpAdapter aoqi@0: // aoqi@0: aoqi@0: @ManagedAttribute aoqi@0: @Description("If true: show what goes across HTTP transport") aoqi@0: public boolean dumpHTTPMessages() { return HttpAdapter.dump; } aoqi@0: aoqi@0: aoqi@0: @ManagedAttribute aoqi@0: @Description("Show what goes across HTTP transport") aoqi@0: public void dumpHTTPMessages(final boolean x) { HttpAdapter.setDump(x); } aoqi@0: aoqi@0: } aoqi@0: aoqi@0: // End of file.