jdk/src/share/classes/javax/management/relation/MBeanServerNotificationFilter.java
author xdono
Mon, 15 Dec 2008 16:55:25 -0800
changeset 1639 a97859015238
parent 1510 e747d3193ef2
child 5506 202f599c92aa
permissions -rw-r--r--
6785258: Update copyright year Summary: Update copyright for files that have been modified starting July 2008 to Dec 2008 Reviewed-by: katleman, ohair, tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
1639
a97859015238 6785258: Update copyright year
xdono
parents: 1510
diff changeset
     2
 * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.management.relation;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import static com.sun.jmx.mbeanserver.Util.cast;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import static com.sun.jmx.defaults.JmxProperties.RELATION_LOGGER;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import com.sun.jmx.mbeanserver.GetPropertyAction;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.io.ObjectInputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.io.ObjectOutputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.io.ObjectStreamField;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.security.AccessController;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import java.util.List;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import java.util.Vector;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
import javax.management.MBeanServerNotification;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
import javax.management.Notification;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
import javax.management.NotificationFilterSupport;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
import javax.management.ObjectName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
import java.util.List;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
import java.util.logging.Level;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
import java.util.Vector;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * Filter for {@link MBeanServerNotification}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * This filter filters MBeanServerNotification notifications by
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * selecting the ObjectNames of interest and the operations (registration,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * unregistration, both) of interest (corresponding to notification
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * types).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * <p>The <b>serialVersionUID</b> of this class is <code>2605900539589789736L</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
@SuppressWarnings("serial")  // serialVersionUID must be constant
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
public class MBeanServerNotificationFilter extends NotificationFilterSupport {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    // Serialization compatibility stuff:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    // Two serial forms are supported in this class. The selected form depends
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    // on system property "jmx.serial.form":
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    //  - "1.0" for JMX 1.0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    //  - any other value for JMX 1.1 and higher
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    // Serial version for old serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    private static final long oldSerialVersionUID = 6001782699077323605L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    // Serial version for new serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    private static final long newSerialVersionUID = 2605900539589789736L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    // Serializable fields in old serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    private static final ObjectStreamField[] oldSerialPersistentFields =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
      new ObjectStreamField("mySelectObjNameList", Vector.class),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
      new ObjectStreamField("myDeselectObjNameList", Vector.class)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    // Serializable fields in new serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    private static final ObjectStreamField[] newSerialPersistentFields =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
      new ObjectStreamField("selectedNames", List.class),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
      new ObjectStreamField("deselectedNames", List.class)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    // Actual serial version and serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    private static final long serialVersionUID;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * @serialField selectedNames List List of {@link ObjectName}s of interest
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     *         <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     *         <li><code>null</code> means that all {@link ObjectName}s are implicitly selected
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     *         (check for explicit deselections)</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     *         <li>Empty vector means that no {@link ObjectName} is explicitly selected</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     *         </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * @serialField deselectedNames List List of {@link ObjectName}s with no interest
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     *         <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     *         <li><code>null</code> means that all {@link ObjectName}s are implicitly deselected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     *         (check for explicit selections))</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     *         <li>Empty vector means that no {@link ObjectName} is explicitly deselected</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     *         </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    private static final ObjectStreamField[] serialPersistentFields;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    private static boolean compat = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    static {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
            GetPropertyAction act = new GetPropertyAction("jmx.serial.form");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
            String form = AccessController.doPrivileged(act);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
            compat = (form != null && form.equals("1.0"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        } catch (Exception e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
            // OK : Too bad, no compat with 1.0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        if (compat) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            serialPersistentFields = oldSerialPersistentFields;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
            serialVersionUID = oldSerialVersionUID;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
            serialPersistentFields = newSerialPersistentFields;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
            serialVersionUID = newSerialVersionUID;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    // END Serialization compatibility stuff
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    // Private members
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * @serial List of {@link ObjectName}s of interest
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     *         <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     *         <li><code>null</code> means that all {@link ObjectName}s are implicitly selected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     *         (check for explicit deselections)</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     *         <li>Empty vector means that no {@link ObjectName} is explicitly selected</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     *         </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    private List<ObjectName> selectedNames = new Vector<ObjectName>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * @serial List of {@link ObjectName}s with no interest
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     *         <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     *         <li><code>null</code> means that all {@link ObjectName}s are implicitly deselected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     *         (check for explicit selections))</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     *         <li>Empty vector means that no {@link ObjectName} is explicitly deselected</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     *         </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    private List<ObjectName> deselectedNames = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    // Constructor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * Creates a filter selecting all MBeanServerNotification notifications for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * all ObjectNames.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    public MBeanServerNotificationFilter() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        super();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        RELATION_LOGGER.entering(MBeanServerNotificationFilter.class.getName(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
                "MBeanServerNotificationFilter");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        enableType(MBeanServerNotification.REGISTRATION_NOTIFICATION);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        enableType(MBeanServerNotification.UNREGISTRATION_NOTIFICATION);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        RELATION_LOGGER.exiting(MBeanServerNotificationFilter.class.getName(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
                "MBeanServerNotificationFilter");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    // Accessors
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * Disables any MBeanServerNotification (all ObjectNames are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * deselected).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
    public synchronized void disableAllObjectNames() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        RELATION_LOGGER.entering(MBeanServerNotificationFilter.class.getName(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
                "disableAllObjectNames");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
        selectedNames = new Vector<ObjectName>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        deselectedNames = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
        RELATION_LOGGER.exiting(MBeanServerNotificationFilter.class.getName(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
                "disableAllObjectNames");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
        return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * Disables MBeanServerNotifications concerning given ObjectName.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * @param objectName  ObjectName no longer of interest
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * @exception IllegalArgumentException  if the given ObjectName is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    public synchronized void disableObjectName(ObjectName objectName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        throws IllegalArgumentException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        if (objectName == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
            String excMsg = "Invalid parameter.";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
            throw new IllegalArgumentException(excMsg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        RELATION_LOGGER.entering(MBeanServerNotificationFilter.class.getName(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
                "disableObjectName", objectName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        // Removes from selected ObjectNames, if present
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
        if (selectedNames != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
            if (selectedNames.size() != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                selectedNames.remove(objectName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
        // Adds it in deselected ObjectNames
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        if (deselectedNames != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
            // If all are deselected, no need to do anything :)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
            if (!(deselectedNames.contains(objectName))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
                // ObjectName was not already deselected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
                deselectedNames.add(objectName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
        RELATION_LOGGER.exiting(MBeanServerNotificationFilter.class.getName(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
                "disableObjectName");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
        return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     * Enables all MBeanServerNotifications (all ObjectNames are selected).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
    public synchronized void enableAllObjectNames() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
        RELATION_LOGGER.entering(MBeanServerNotificationFilter.class.getName(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
                "enableAllObjectNames");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
        selectedNames = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        deselectedNames = new Vector<ObjectName>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        RELATION_LOGGER.exiting(MBeanServerNotificationFilter.class.getName(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
                "enableAllObjectNames");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
        return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * Enables MBeanServerNotifications concerning given ObjectName.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * @param objectName  ObjectName of interest
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * @exception IllegalArgumentException  if the given ObjectName is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
    public synchronized void enableObjectName(ObjectName objectName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
        throws IllegalArgumentException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
        if (objectName == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
            String excMsg = "Invalid parameter.";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
            throw new IllegalArgumentException(excMsg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
        RELATION_LOGGER.entering(MBeanServerNotificationFilter.class.getName(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
                "enableObjectName", objectName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
        // Removes from deselected ObjectNames, if present
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
        if (deselectedNames != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
            if (deselectedNames.size() != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
                deselectedNames.remove(objectName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
        // Adds it in selected ObjectNames
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
        if (selectedNames != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
            // If all are selected, no need to do anything :)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
            if (!(selectedNames.contains(objectName))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
                // ObjectName was not already selected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
                selectedNames.add(objectName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
        RELATION_LOGGER.exiting(MBeanServerNotificationFilter.class.getName(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
                "enableObjectName");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
        return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * Gets all the ObjectNames enabled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * @return Vector of ObjectNames:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     * <P>- null means all ObjectNames are implicitly selected, except the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * ObjectNames explicitly deselected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * <P>- empty means all ObjectNames are deselected, i.e. no ObjectName
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     * selected.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
    public synchronized Vector<ObjectName> getEnabledObjectNames() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
        if (selectedNames != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
            return new Vector<ObjectName>(selectedNames);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     * Gets all the ObjectNames disabled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     * @return Vector of ObjectNames:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     * <P>- null means all ObjectNames are implicitly deselected, except the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     * ObjectNames explicitly selected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     * <P>- empty means all ObjectNames are selected, i.e. no ObjectName
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     * deselected.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
    public synchronized Vector<ObjectName> getDisabledObjectNames() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
        if (deselectedNames != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
            return new Vector<ObjectName>(deselectedNames);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
    // NotificationFilter interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     * Invoked before sending the specified notification to the listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     * <P>If:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * <P>- the ObjectName of the concerned MBean is selected (explicitly OR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * (implicitly and not explicitly deselected))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * <P>AND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * <P>- the type of the operation (registration or unregistration) is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * selected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     * <P>then the notification is sent to the listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     * @param notif  The notification to be sent.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     * @return true if the notification has to be sent to the listener, false
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     * otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
    public synchronized boolean isNotificationEnabled(Notification notif)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
        throws IllegalArgumentException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
        if (notif == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
            String excMsg = "Invalid parameter.";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
            throw new IllegalArgumentException(excMsg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
        RELATION_LOGGER.entering(MBeanServerNotificationFilter.class.getName(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
                "isNotificationEnabled", notif);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
        // Checks the type first
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
        String ntfType = notif.getType();
1510
e747d3193ef2 6763639: Remove "rawtypes" warnings from JMX code
emcmanus
parents: 2
diff changeset
   357
        Vector<String> enabledTypes = getEnabledTypes();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
        if (!(enabledTypes.contains(ntfType))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
            RELATION_LOGGER.logp(Level.FINER,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
                    MBeanServerNotificationFilter.class.getName(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
                    "isNotificationEnabled",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
                    "Type not selected, exiting");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
            return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
        // We have a MBeanServerNotification: downcasts it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
        MBeanServerNotification mbsNtf = (MBeanServerNotification)notif;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
        // Checks the ObjectName
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
        ObjectName objName = mbsNtf.getMBeanName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
        // Is it selected?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
        boolean isSelectedFlg = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
        if (selectedNames != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
            // Not all are implicitly selected:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
            // checks for explicit selection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
            if (selectedNames.size() == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
                // All are explicitly not selected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
                RELATION_LOGGER.logp(Level.FINER,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
                        MBeanServerNotificationFilter.class.getName(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
                        "isNotificationEnabled",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
                        "No ObjectNames selected, exiting");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
                return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
            isSelectedFlg = selectedNames.contains(objName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
            if (!isSelectedFlg) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
                // Not in the explicit selected list
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
                RELATION_LOGGER.logp(Level.FINER,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
                        MBeanServerNotificationFilter.class.getName(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
                        "isNotificationEnabled",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
                        "ObjectName not in selected list, exiting");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
                return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
        if (!isSelectedFlg) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
            // Not explicitly selected: is it deselected?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
            if (deselectedNames == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
                // All are implicitly deselected and it is not explicitly
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
                // selected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
                RELATION_LOGGER.logp(Level.FINER,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
                        MBeanServerNotificationFilter.class.getName(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
                        "isNotificationEnabled",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
                        "ObjectName not selected, and all " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
                        "names deselected, exiting");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
                return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
            } else if (deselectedNames.contains(objName)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
                // Explicitly deselected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
                RELATION_LOGGER.logp(Level.FINER,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
                        MBeanServerNotificationFilter.class.getName(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
                        "isNotificationEnabled",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
                        "ObjectName explicitly not selected, exiting");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
                return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
        RELATION_LOGGER.logp(Level.FINER,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
                MBeanServerNotificationFilter.class.getName(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
                "isNotificationEnabled",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
                "ObjectName selected, exiting");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
        return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     * Deserializes an {@link MBeanServerNotificationFilter} from an {@link ObjectInputStream}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
    private void readObject(ObjectInputStream in)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
            throws IOException, ClassNotFoundException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
      if (compat)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
        // Read an object serialized in the old serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
        ObjectInputStream.GetField fields = in.readFields();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
        selectedNames = cast(fields.get("mySelectObjNameList", null));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
        if (fields.defaulted("mySelectObjNameList"))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
          throw new NullPointerException("mySelectObjNameList");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
        deselectedNames = cast(fields.get("myDeselectObjNameList", null));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
        if (fields.defaulted("myDeselectObjNameList"))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
          throw new NullPointerException("myDeselectObjNameList");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
      else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
        // Read an object serialized in the new serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
        in.defaultReadObject();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     * Serializes an {@link MBeanServerNotificationFilter} to an {@link ObjectOutputStream}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
    private void writeObject(ObjectOutputStream out)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
            throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
      if (compat)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
        // Serializes this instance in the old serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
        ObjectOutputStream.PutField fields = out.putFields();
1510
e747d3193ef2 6763639: Remove "rawtypes" warnings from JMX code
emcmanus
parents: 2
diff changeset
   467
        fields.put("mySelectObjNameList", selectedNames);
e747d3193ef2 6763639: Remove "rawtypes" warnings from JMX code
emcmanus
parents: 2
diff changeset
   468
        fields.put("myDeselectObjNameList", deselectedNames);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
        out.writeFields();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
      else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
        // Serializes this instance in the new serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
        out.defaultWriteObject();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
}