KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > management > MBeanRegistration


1 /*
2  * @(#)MBeanRegistration.java 4.17 04/02/11
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.management;
9
10
11 /**
12  * Can be implemented by an MBean in order to
13  * carry out operations before and after being registered or unregistered from
14  * the MBean server.
15  *
16  * @since 1.5
17  */

18 public interface MBeanRegistration {
19
20
21     /**
22      * Allows the MBean to perform any operations it needs before
23      * being registered in the MBean server. If the name of the MBean
24      * is not specified, the MBean can provide a name for its
25      * registration. If any exception is raised, the MBean will not be
26      * registered in the MBean server.
27      *
28      * @param server The MBean server in which the MBean will be registered.
29      *
30      * @param name The object name of the MBean. This name is null if
31      * the name parameter to one of the <code>createMBean</code> or
32      * <code>registerMBean</code> methods in the {@link MBeanServer}
33      * interface is null. In that case, this method must return a
34      * non-null ObjectName for the new MBean.
35      *
36      * @return The name under which the MBean is to be registered.
37      * This value must not be null. If the <code>name</code>
38      * parameter is not null, it will usually but not necessarily be
39      * the returned value.
40      *
41      * @exception java.lang.Exception This exception will be caught by
42      * the MBean server and re-thrown as an {@link
43      * MBeanRegistrationException}.
44      */

45     public ObjectName JavaDoc preRegister(MBeanServer JavaDoc server,
46                   ObjectName JavaDoc name) throws java.lang.Exception JavaDoc;
47
48     /**
49      * Allows the MBean to perform any operations needed after having been
50      * registered in the MBean server or after the registration has failed.
51      *
52      * @param registrationDone Indicates whether or not the MBean has
53      * been successfully registered in the MBean server. The value
54      * false means that the registration phase has failed.
55      */

56     public void postRegister(Boolean JavaDoc registrationDone);
57
58     /**
59      * Allows the MBean to perform any operations it needs before
60      * being unregistered by the MBean server.
61      *
62      * @exception java.lang.Exception This exception will be caught by
63      * the MBean server and re-thrown as an {@link
64      * MBeanRegistrationException}.
65      */

66     public void preDeregister() throws java.lang.Exception JavaDoc ;
67
68     /**
69      * Allows the MBean to perform any operations needed after having been
70      * unregistered in the MBean server.
71      */

72     public void postDeregister();
73
74  }
75
Popular Tags