📄 monitorresources.java
字号:
/* * Copyright (c) 2001-2007 Sun Microsystems, Inc. All rights reserved. * * The Sun Project JXTA(TM) Software License * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The end-user documentation included with the redistribution, if any, must * include the following acknowledgment: "This product includes software * developed by Sun Microsystems, Inc. for JXTA(TM) technology." * Alternately, this acknowledgment may appear in the software itself, if * and wherever such third-party acknowledgments normally appear. * * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must * not be used to endorse or promote products derived from this software * without prior written permission. For written permission, please contact * Project JXTA at http://www.jxta.org. * * 5. Products derived from this software may not be called "JXTA", nor may * "JXTA" appear in their name, without prior written permission of Sun. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUN * MICROSYSTEMS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * JXTA is a registered trademark of Sun Microsystems, Inc. in the United * States and other countries. * * Please see the license information page at : * <http://www.jxta.org/project/www/license.html> for instructions on use of * the license in source files. * * ==================================================================== * * This software consists of voluntary contributions made by many individuals * on behalf of Project JXTA. For more information on Project JXTA, please see * http://www.jxta.org. * * This license is based on the BSD license adopted by the Apache Foundation. */package net.jxta.meter;import java.net.URI;import java.util.Enumeration;import java.util.Hashtable;import java.util.Map;import net.jxta.document.AdvertisementFactory;import net.jxta.document.Element;import net.jxta.document.MimeMediaType;import net.jxta.document.StructuredDocument;import net.jxta.document.StructuredDocumentFactory;import net.jxta.document.StructuredTextDocument;import net.jxta.document.TextElement;import net.jxta.exception.JxtaException;import net.jxta.id.ID;import net.jxta.platform.ModuleClassID;import net.jxta.platform.ModuleSpecID;import net.jxta.protocol.ModuleImplAdvertisement;import net.jxta.util.AdvertisementUtilities;import net.jxta.util.documentSerializable.DocumentSerializableUtilities;/** * Registration point for types of ServiceMonitors's Advertisements, ServiceMetrics and ServiceMonitorFilters * based upon the ModuleClassID for the ServiceMonitor **/public class MonitorResources { public static final String SERVICE_MONITOR_TAG = "serviceMonitor"; public static final String SERVICE_MONITOR_ADVERTISEMENT_TAG = ModuleImplAdvertisement.getAdvertisementType(); public static final String CLASS_ID_TAG = "moduleClassID"; public static final String SERVICE_TITLE_TAG = "serviceTitle"; public static final String SERVICE_MONITOR_IMPL_TAG = "serviceMonitorImpl"; public static final String METRIC_CLASS_TAG = "serviceMetric"; public static final String FILTER_CLASS_TAG = "serviceMonitorFilter"; private static Map<ModuleClassID,ServiceResource> registeredMonitorResources = new Hashtable<ModuleClassID,ServiceResource>(); /** * Prefix string for all of the Well Known IDs declared in this interface. **/ private static final String WK_ID_PREFIX = ID.URIEncodingName + ":" + ID.URNNamespace + ":uuid-DeadBeefDeafBabaFeedBabe"; /** * Well known classes for the basic service Monitors. * To keep their string representation shorter, we put our small spec * or role pseudo unique ID at the front of the second UUID string. * Base classes do not need an explicit second UUID string because it is * all 0. * The type is always the last two characters, nomatter the total length. */ /** * Well known module class identifier: monitor service */ public static final ModuleClassID monitorServiceClassID = (ModuleClassID) ID.create(URI.create(WK_ID_PREFIX + "0000011F05")); /** * Well known module class identifier: resolver service */ public static final ModuleClassID resolverServiceMonitorClassID = (ModuleClassID) ID.create(URI.create(WK_ID_PREFIX + "0000010205")); /** * Well known module class identifier: discovery service */ public static final ModuleClassID discoveryServiceMonitorClassID = (ModuleClassID) ID.create(URI.create(WK_ID_PREFIX + "0000010305")); /** * Well known module class identifier: pipe service */ public static final ModuleClassID pipeServiceMonitorClassID = (ModuleClassID) ID.create(URI.create(WK_ID_PREFIX + "0000010405")); /** * Well known module class identifier: membership service */ public static final ModuleClassID membershipServiceMonitorClassID = (ModuleClassID) ID.create(URI.create(WK_ID_PREFIX + "0000010505")); /** * Well known module class identifier: rendezvous service */ public static final ModuleClassID rendezvousServiceMonitorClassID = (ModuleClassID) ID.create(URI.create(WK_ID_PREFIX + "0000010605")); /** * Well known module class identifier: peerinfo service */ public static final ModuleClassID peerinfoServiceMonitorClassID = (ModuleClassID) ID.create(URI.create(WK_ID_PREFIX + "0000010705")); /** * Well known module class identifier: endpoint service */ public static final ModuleClassID endpointServiceMonitorClassID = (ModuleClassID) ID.create(URI.create(WK_ID_PREFIX + "0000010805")); /* * FIXME: EndpointProtocols should probably all be of the same class * and of different specs and roles... But we'll take a shortcut for now. */ /** * Well known module class identifier: transport protocol */ public static final ModuleClassID transportServiceMonitorClassID = (ModuleClassID) ID.create(URI.create(WK_ID_PREFIX + "0000010905")); /** * Well known module class identifier: router protocol */ public static final ModuleClassID routerServiceMonitorClassID = (ModuleClassID) ID.create(URI.create(WK_ID_PREFIX + "0000010B05")); /** * Well known module class identifier: tlsProtocol */ public static final ModuleClassID tlsProtoServiceMonitorClassID = (ModuleClassID) ID.create(URI.create(WK_ID_PREFIX + "00000105")); /** * Well known module class identifier: ProxyService */ public static final ModuleClassID proxyServiceMonitorClassID = (ModuleClassID) ID.create(URI.create(WK_ID_PREFIX + "0000010E05")); /** * Well known module class identifier: RelayProtocol */ public static final ModuleClassID relayServiceMonitorClassID = (ModuleClassID) ID.create(URI.create(WK_ID_PREFIX + "0000010F05")); /** * Well known service specification identifier: the standard monitor */ public static final ModuleSpecID refMonitorServiceSpecID = (ModuleSpecID) ID.create(URI.create(WK_ID_PREFIX + "0000011F0106")); /** * Well known service specification identifier: the standard resolver */ public static final ModuleSpecID refResolverServiceMonitorSpecID = (ModuleSpecID) ID.create(URI.create(WK_ID_PREFIX + "000001020106")); /** * Well known service specification identifier: the standard discovery */ public static final ModuleSpecID refDiscoveryServiceMonitorSpecID = (ModuleSpecID) ID.create(URI.create(WK_ID_PREFIX + "000001030106")); /** * Well known service specification identifier: the standard pipe */ public static final ModuleSpecID refPipeServiceMonitorSpecID = (ModuleSpecID) ID.create(URI.create(WK_ID_PREFIX + "000001040106")); /** * Well known service specification identifier: the standard membership */ public static final ModuleSpecID refMembershipServiceMonitorSpecID = (ModuleSpecID) ID.create(URI.create(WK_ID_PREFIX + "000001050106")); /** * Well known service specification identifier: the standard rendezvous */ public static final ModuleSpecID refRendezvousServiceMonitorSpecID = (ModuleSpecID) ID.create(URI.create(WK_ID_PREFIX + "000001060106")); /** * Well known service specification identifier: the standard peerinfo */ public static final ModuleSpecID refPeerinfoServiceMonitorSpecID = (ModuleSpecID) ID.create(URI.create(WK_ID_PREFIX + "000001070106")); /** * Well known service specification identifier: the standard endpoint */ public static final ModuleSpecID refEndpointServiceMonitorSpecID = (ModuleSpecID) ID.create(URI.create(WK_ID_PREFIX + "000001080106")); /** * Well known endpoint protocol specification identifier: the standard * transport Service Monitor */ public static final ModuleSpecID refTransportServiceMonitorSpecID = (ModuleSpecID) ID.create(URI.create(WK_ID_PREFIX + "000001090106")); /** * Well known endpoint protocol specification identifier: the standard * router */ public static final ModuleSpecID refRouterServiceMonitorSpecID = (ModuleSpecID) ID.create(URI.create(WK_ID_PREFIX + "0000010B0106")); /** * Well known endpoint protocol specification identifier: the standard * tls endpoint protocol */ public static final ModuleSpecID refTlsServiceMonitorSpecID = (ModuleSpecID) ID.create(URI.create(WK_ID_PREFIX + "0000010D0106")); /** * Well known application: the Proxy */ public static final ModuleSpecID refProxyServiceMonitorSpecID = (ModuleSpecID) ID.create(URI.create(WK_ID_PREFIX + "0000010E0106")); /** * Well known endpoint protocol specification identifier: the standard * relay endpoint protocol */ public static final ModuleSpecID refRelayServiceMonitorSpecID = (ModuleSpecID) ID.create(URI.create(WK_ID_PREFIX + "0000010F0106"));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -