MBeanRegistration.java revision 0
0N/A/*
0N/A * Copyright 1999-2004 Sun Microsystems, Inc. All Rights Reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation. Sun designates this
0N/A * particular file as subject to the "Classpath" exception as provided
0N/A * by Sun in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
0N/A * CA 95054 USA or visit www.sun.com if you need additional information or
0N/A * have any questions.
0N/A */
0N/A
0N/Apackage javax.management;
0N/A
0N/A
0N/A/**
0N/A * Can be implemented by an MBean in order to
0N/A * carry out operations before and after being registered or unregistered from
0N/A * the MBean server.
0N/A *
0N/A * @since 1.5
0N/A */
0N/Apublic interface MBeanRegistration {
0N/A
0N/A
0N/A /**
0N/A * Allows the MBean to perform any operations it needs before
0N/A * being registered in the MBean server. If the name of the MBean
0N/A * is not specified, the MBean can provide a name for its
0N/A * registration. If any exception is raised, the MBean will not be
0N/A * registered in the MBean server.
0N/A *
0N/A * @param server The MBean server in which the MBean will be registered.
0N/A *
0N/A * @param name The object name of the MBean. This name is null if
0N/A * the name parameter to one of the <code>createMBean</code> or
0N/A * <code>registerMBean</code> methods in the {@link MBeanServer}
0N/A * interface is null. In that case, this method must return a
0N/A * non-null ObjectName for the new MBean.
0N/A *
0N/A * @return The name under which the MBean is to be registered.
0N/A * This value must not be null. If the <code>name</code>
0N/A * parameter is not null, it will usually but not necessarily be
0N/A * the returned value.
0N/A *
0N/A * @exception java.lang.Exception This exception will be caught by
0N/A * the MBean server and re-thrown as an {@link
0N/A * MBeanRegistrationException}.
0N/A */
0N/A public ObjectName preRegister(MBeanServer server,
0N/A ObjectName name) throws java.lang.Exception;
0N/A
0N/A /**
0N/A * Allows the MBean to perform any operations needed after having been
0N/A * registered in the MBean server or after the registration has failed.
0N/A *
0N/A * @param registrationDone Indicates whether or not the MBean has
0N/A * been successfully registered in the MBean server. The value
0N/A * false means that the registration phase has failed.
0N/A */
0N/A public void postRegister(Boolean registrationDone);
0N/A
0N/A /**
0N/A * Allows the MBean to perform any operations it needs before
0N/A * being unregistered by the MBean server.
0N/A *
0N/A * @exception java.lang.Exception This exception will be caught by
0N/A * the MBean server and re-thrown as an {@link
0N/A * MBeanRegistrationException}.
0N/A */
0N/A public void preDeregister() throws java.lang.Exception ;
0N/A
0N/A /**
0N/A * Allows the MBean to perform any operations needed after having been
0N/A * unregistered in the MBean server.
0N/A */
0N/A public void postDeregister();
0N/A
0N/A }