001// Copyright 2005 The Apache Software Foundation 002// 003// Licensed under the Apache License, Version 2.0 (the "License"); 004// you may not use this file except in compliance with the License. 005// You may obtain a copy of the License at 006// 007// http://www.apache.org/licenses/LICENSE-2.0 008// 009// Unless required by applicable law or agreed to in writing, software 010// distributed under the License is distributed on an "AS IS" BASIS, 011// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 012// See the License for the specific language governing permissions and 013// limitations under the License. 014 015package org.apache.hivemind.management; 016 017import java.util.Hashtable; 018 019import javax.management.ObjectName; 020 021import org.apache.hivemind.internal.ServicePoint; 022import org.apache.hivemind.management.impl.ObjectNameBuilderImpl; 023 024/** 025 * Service for naming JMX MBeans Each service that is exported as MBean must have a unique 026 * ObjectName This service guarantees that the ObjectNames are built in a consistent manner The 027 * concrete naming scheme depends on the implementation of this interface. Default implementation is 028 * {@link ObjectNameBuilderImpl} 029 * 030 * @author Achim Huegen 031 * @since 1.1 032 */ 033public interface ObjectNameBuilder 034{ 035 /** 036 * Creates an ObjectName from list of keys and values and prepends the domain. Maintains the 037 * order of the keys and this distinguishes the method from the ObjectName constructor that 038 * accepts an hashtable of keys and values. The order influences the visualization in JConsole. 039 * Example: Hivemind:key1=value1,key2=value2 040 * 041 * @see ObjectName#getInstance(String, Hashtable) 042 */ 043 public ObjectName createObjectName(String[] keys, String[] values); 044 045 public ObjectName createObjectName(String moduleId, String id, String type); 046 047 public ObjectName createObjectName(String qualifiedId, String type); 048 049 public ObjectName createServiceObjectName(ServicePoint servicePoint); 050 051 public ObjectName createServiceDecoratorName(ServicePoint servicePoint, String decoratorType); 052 053}