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