01: /*
02: * Copyright 2002-2005 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.springframework.jmx.export.naming;
18:
19: import javax.management.MalformedObjectNameException;
20: import javax.management.ObjectName;
21:
22: /**
23: * Strategy interface that encapsulates the creation of <code>ObjectName</code> instances.
24: *
25: * <p>Used by the <code>MBeanExporter</code> to obtain <code>ObjectName</code>s
26: * when registering beans.
27: *
28: * @author Rob Harrop
29: * @since 1.2
30: * @see org.springframework.jmx.export.MBeanExporter
31: * @see javax.management.ObjectName
32: */
33: public interface ObjectNamingStrategy {
34:
35: /**
36: * Obtain an <code>ObjectName</code> for the supplied bean.
37: * @param managedBean the bean that will be exposed under the
38: * returned <code>ObjectName</code>
39: * @param beanKey the key associated with this bean in the beans map
40: * passed to the <code>MBeanExporter</code>
41: * @return the <code>ObjectName</code> instance
42: * @throws MalformedObjectNameException if the resulting <code>ObjectName</code> is invalid
43: */
44: ObjectName getObjectName(Object managedBean, String beanKey)
45: throws MalformedObjectNameException;
46:
47: }
|