KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > continuent > sequoia > controller > jmx > MBeanServerBuilder


1 /**
2  * Sequoia: Database clustering technology.
3  * Copyright (C) 2002-2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Contact: sequoia@continuent.org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * 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, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  * Initial developer(s): Marc Wick.
20  * Contributor(s): ______________________.
21  */

22
23 package org.continuent.sequoia.controller.jmx;
24
25 import javax.management.MBeanServer JavaDoc;
26 import javax.management.MBeanServerDelegate JavaDoc;
27
28 /**
29  * This class is a custom implementation of MBeanServerBuilder, it builds a
30  * MBeanServer decorated with an AuthenticatingMBeanServer.
31  *
32  * @author <a HREF="mailto:marc.wick@monte-bre.ch">Marc Wick </a>
33  * @version 1.0
34  */

35 public class MBeanServerBuilder extends ChainedMBeanServerBuilder
36 {
37   /**
38    * Creates a new <code>MBeanServerBuilder.java</code> object
39    */

40   public MBeanServerBuilder()
41   {
42     super(new javax.management.MBeanServerBuilder JavaDoc());
43   }
44
45   /**
46    * @see javax.management.MBeanServerBuilder#newMBeanServer(java.lang.String,
47    * javax.management.MBeanServer, javax.management.MBeanServerDelegate)
48    */

49   public MBeanServer JavaDoc newMBeanServer(String JavaDoc defaultDomain, MBeanServer JavaDoc outer,
50       MBeanServerDelegate JavaDoc delegate)
51   {
52     AuthenticatingMBeanServer extern = new AuthenticatingMBeanServer();
53     MBeanServer JavaDoc nested = getMBeanServerBuilder().newMBeanServer(defaultDomain,
54         outer == null ? extern : outer, delegate);
55     extern.setMBeanServer(nested);
56     return extern;
57   }
58 }
59
Popular Tags