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;
18:
19: import javax.management.ObjectName;
20:
21: /**
22: * Interface that defines the set of MBean export operations that are intended to be
23: * accessed by application developers during application runtime.
24: *
25: * <p>This interface should be used to export application resources to JMX using Spring's
26: * management interface generation capabilties and, optionally, it's {@link ObjectName}
27: * generation capabilities.
28: *
29: * @author Rob Harrop
30: * @since 2.0
31: * @see MBeanExporter
32: */
33: public interface MBeanExportOperations {
34:
35: /**
36: * Register the supplied resource with JMX. If the resource is not a valid MBean already,
37: * Spring will generate a management interface for it. The exact interface generated will
38: * depend on the implementation and its configuration. This call also generates an
39: * {@link ObjectName} for the managed resource and returns this to the caller.
40: * @param managedResource the resource to expose via JMX
41: * @return the {@link ObjectName} under which the resource was exposed
42: * @throws MBeanExportException if Spring is unable to generate an {@link ObjectName}
43: * or register the MBean
44: */
45: ObjectName registerManagedResource(Object managedResource)
46: throws MBeanExportException;
47:
48: /**
49: * Register the supplied resource with JMX. If the resource is not a valid MBean already,
50: * Spring will generate a management interface for it. The exact interface generated will
51: * depend on the implementation and its configuration.
52: * @param managedResource the resource to expose via JMX
53: * @param objectName the {@link ObjectName} under which to expose the resource
54: * @throws MBeanExportException if Spring is unable to register the MBean
55: */
56: void registerManagedResource(Object managedResource,
57: ObjectName objectName) throws MBeanExportException;
58:
59: }
|