KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > mbeanserver > DynamicMBean2


1 /*
2  * @(#)DynamicMBean2.java 1.4 05/11/17
3  *
4  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.jmx.mbeanserver;
9
10 import javax.management.DynamicMBean JavaDoc;
11 import javax.management.MBeanServer JavaDoc;
12 import javax.management.ObjectName JavaDoc;
13
14 /**
15  * A dynamic MBean that wraps an underlying resource. A version of this
16  * interface might eventually appear in the public JMX API.
17  *
18  * @since 1.6
19  */

20 public interface DynamicMBean2 extends DynamicMBean JavaDoc {
21     /**
22      * The resource corresponding to this MBean. This is the object whose
23      * class name should be reflected by the MBean's
24      * getMBeanInfo().getClassName() for example. For a "plain"
25      * DynamicMBean it will be "this". For an MBean that wraps another
26      * object, like javax.management.StandardMBean, it will be the wrapped
27      * object.
28      */

29     public Object JavaDoc getResource();
30     
31     /**
32      * The name of this MBean's class, as used by permission checks.
33      * This is typically equal to getResource().getClass().getName().
34      * This method is typically faster, sometimes much faster,
35      * than getMBeanInfo().getClassName(), but should return the same
36      * result.
37      */

38     public String JavaDoc getClassName();
39     
40     /**
41      * Additional registration hook. This method is called after
42      * {@link javax.management.MBeanRegistration#preRegister preRegister}.
43      * Unlike that method, if it throws an exception and the MBean implements
44      * {@code MBeanRegistration}, then {@link
45      * javax.management.MBeanRegistration#postRegister postRegister(false)}
46      * will be called on the MBean. This is the behavior that the MBean
47      * expects for a problem that does not come from its own preRegister
48      * method.
49      */

50     public void preRegister2(MBeanServer JavaDoc mbs, ObjectName JavaDoc name)
51             throws Exception JavaDoc;
52     
53     /**
54      * Additional registration hook. This method is called if preRegister
55      * and preRegister2 succeed, but then the MBean cannot be registered
56      * (for example because there is already another MBean of the same name).
57      */

58     public void registerFailed();
59 }
60
Popular Tags