001/*
002 * Copyright 2002-2012 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.jmx.export.naming;
018
019import javax.management.MalformedObjectNameException;
020import javax.management.ObjectName;
021
022/**
023 * Interface that allows infrastructure components to provide their own
024 * {@code ObjectName}s to the {@code MBeanExporter}.
025 *
026 * <p><b>Note:</b> This interface is mainly intended for internal usage.
027 *
028 * @author Rob Harrop
029 * @since 1.2.2
030 * @see org.springframework.jmx.export.MBeanExporter
031 */
032public interface SelfNaming {
033
034        /**
035         * Return the {@code ObjectName} for the implementing object.
036         * @throws MalformedObjectNameException if thrown by the ObjectName constructor
037         * @see javax.management.ObjectName#ObjectName(String)
038         * @see javax.management.ObjectName#getInstance(String)
039         * @see org.springframework.jmx.support.ObjectNameManager#getInstance(String)
040         */
041        ObjectName getObjectName() throws MalformedObjectNameException;
042
043}