ManagedObjectRegistry.java
01 /*
02  *
03  * Licensed to the Apache Software Foundation (ASF) under one
04  * or more contributor license agreements.  See the NOTICE file
05  * distributed with this work for additional information
06  * regarding copyright ownership.  The ASF licenses this file
07  * to you under the Apache License, Version 2.0 (the
08  * "License"); you may not use this file except in compliance
09  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  */
21 package org.apache.qpid.server.management;
22 
23 import javax.management.JMException;
24 
25 import org.apache.commons.configuration.ConfigurationException;
26 
27 import java.rmi.RemoteException;
28 import java.io.IOException;
29 
30 /**
31  * Handles the registration (and unregistration and so on) of managed objects.
32  *
33  * Managed objects are responsible for exposting attributes, operations and notifications. They will expose
34  * these outside the JVM therefore it is important not to use implementation objects directly as managed objects.
35  * Instead, creating inner classes and exposing those is an effective way of exposing internal state in a
36  * controlled way.
37  *
38  * Although we do not explictly use them while targetting Java 5, the enhanced MXBean approach in Java 6 will
39  * be the obvious choice for managed objects.
40  *
41  */
42 public interface ManagedObjectRegistry
43 {
44     void start() throws IOException, ConfigurationException;
45 
46     void registerObject(ManagedObject managedObjectthrows JMException;
47 
48     void unregisterObject(ManagedObject managedObjectthrows JMException;
49 
50     void close() throws RemoteException;
51 }