src/java.management/share/classes/javax/management/relation/RelationTypeSupport.java
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 43235 jdk/src/java.management/share/classes/javax/management/relation/RelationTypeSupport.java@da1786d695b6
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
43235
da1786d695b6 8172971: java.management could use System.Logger
dfuchs
parents: 25859
diff changeset
     2
 * Copyright (c) 2000, 2017, Oracle and/or its affiliates. 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
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
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
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
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.defaults.JmxProperties.RELATION_LOGGER;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import static com.sun.jmx.mbeanserver.Util.cast;
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
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import java.security.AccessController;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import java.util.ArrayList;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
import java.util.HashMap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
import java.util.HashSet;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
import java.util.List;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
import java.util.Map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
import java.util.Set;
43235
da1786d695b6 8172971: java.management could use System.Logger
dfuchs
parents: 25859
diff changeset
    45
import java.lang.System.Logger.Level;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * A RelationTypeSupport object implements the RelationType interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * <P>It represents a relation type, providing role information for each role
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * expected to be supported in every relation of that type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * <P>A relation type includes a relation type name and a list of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * role infos (represented by RoleInfo objects).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * <P>A relation type has to be declared in the Relation Service:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * <P>- either using the createRelationType() method, where a RelationTypeSupport
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * object will be created and kept in the Relation Service
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * <P>- either using the addRelationType() method where the user has to create
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * an object implementing the RelationType interface, and this object will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * used as representing a relation type in the Relation Service.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * <p>The <b>serialVersionUID</b> of this class is <code>4611072955724144607L</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
@SuppressWarnings("serial")  // serialVersionUID not constant
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
public class RelationTypeSupport implements RelationType {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    // Serialization compatibility stuff:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    // Two serial forms are supported in this class. The selected form depends
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    // on system property "jmx.serial.form":
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    //  - "1.0" for JMX 1.0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    //  - any other value for JMX 1.1 and higher
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    // Serial version for old serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    private static final long oldSerialVersionUID = -8179019472410837190L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    // Serial version for new serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    private static final long newSerialVersionUID = 4611072955724144607L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    // Serializable fields in old serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    private static final ObjectStreamField[] oldSerialPersistentFields =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
      new ObjectStreamField("myTypeName", String.class),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
      new ObjectStreamField("myRoleName2InfoMap", HashMap.class),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
      new ObjectStreamField("myIsInRelServFlg", boolean.class)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    // Serializable fields in new serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    private static final ObjectStreamField[] newSerialPersistentFields =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
      new ObjectStreamField("typeName", String.class),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
      new ObjectStreamField("roleName2InfoMap", Map.class),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
      new ObjectStreamField("isInRelationService", boolean.class)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    // Actual serial version and serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    private static final long serialVersionUID;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * @serialField typeName String Relation type name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * @serialField roleName2InfoMap Map {@link Map} holding the mapping:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     *              &lt;role name ({@link String})&gt; -&gt; &lt;role info ({@link RoleInfo} object)&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * @serialField isInRelationService boolean Flag specifying whether the relation type has been declared in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     *              Relation Service (so can no longer be updated)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    private static final ObjectStreamField[] serialPersistentFields;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    private static boolean compat = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    static {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
            GetPropertyAction act = new GetPropertyAction("jmx.serial.form");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
            String form = AccessController.doPrivileged(act);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
            compat = (form != null && form.equals("1.0"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        } catch (Exception e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
            // OK : Too bad, no compat with 1.0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        if (compat) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            serialPersistentFields = oldSerialPersistentFields;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            serialVersionUID = oldSerialVersionUID;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
            serialPersistentFields = newSerialPersistentFields;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
            serialVersionUID = newSerialVersionUID;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    // END Serialization compatibility stuff
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    // Private members
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * @serial Relation type name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    private String typeName = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * @serial {@link Map} holding the mapping:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     *           &lt;role name ({@link String})&gt; -&gt; &lt;role info ({@link RoleInfo} object)&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    private Map<String,RoleInfo> roleName2InfoMap =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        new HashMap<String,RoleInfo>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * @serial Flag specifying whether the relation type has been declared in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     *         Relation Service (so can no longer be updated)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    private boolean isInRelationService = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    // Constructors
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * Constructor where all role definitions are dynamically created and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * passed as parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * @param relationTypeName  Name of relation type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * @param roleInfoArray  List of role definitions (RoleInfo objects)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * @exception InvalidRelationTypeException  if:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * <P>- the same name has been used for two different roles
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * <P>- no role info provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * <P>- one null role info provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    public RelationTypeSupport(String relationTypeName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
                            RoleInfo[] roleInfoArray)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
               InvalidRelationTypeException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        if (relationTypeName == null || roleInfoArray == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            String excMsg = "Invalid parameter.";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
            throw new IllegalArgumentException(excMsg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
43235
da1786d695b6 8172971: java.management could use System.Logger
dfuchs
parents: 25859
diff changeset
   176
        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", relationTypeName);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        // Can throw InvalidRelationTypeException, ClassNotFoundException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        // and NotCompliantMBeanException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
        initMembers(relationTypeName, roleInfoArray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
43235
da1786d695b6 8172971: java.management could use System.Logger
dfuchs
parents: 25859
diff changeset
   182
        RELATION_LOGGER.log(Level.TRACE, "RETURN");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * Constructor to be used for subclasses.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * @param relationTypeName  Name of relation type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * @exception IllegalArgumentException  if null parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    protected RelationTypeSupport(String relationTypeName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        if (relationTypeName == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
            String excMsg = "Invalid parameter.";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            throw new IllegalArgumentException(excMsg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
43235
da1786d695b6 8172971: java.management could use System.Logger
dfuchs
parents: 25859
diff changeset
   200
        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", relationTypeName);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
        typeName = relationTypeName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
43235
da1786d695b6 8172971: java.management could use System.Logger
dfuchs
parents: 25859
diff changeset
   204
        RELATION_LOGGER.log(Level.TRACE, "RETURN");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    // Accessors
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * Returns the relation type name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * @return the relation type name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    public String getRelationTypeName() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
        return typeName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * Returns the list of role definitions (ArrayList of RoleInfo objects).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    public List<RoleInfo> getRoleInfos() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        return new ArrayList<RoleInfo>(roleName2InfoMap.values());
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
     * Returns the role info (RoleInfo object) for the given role info name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * (null if not found).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     * @param roleInfoName  role info name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * @return RoleInfo object providing role definition
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     * does not exist
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * @exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * @exception RoleInfoNotFoundException  if no role info with that name in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * relation type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
    public RoleInfo getRoleInfo(String roleInfoName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
               RoleInfoNotFoundException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        if (roleInfoName == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
            String excMsg = "Invalid parameter.";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
            throw new IllegalArgumentException(excMsg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
43235
da1786d695b6 8172971: java.management could use System.Logger
dfuchs
parents: 25859
diff changeset
   250
        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", roleInfoName);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
        // No null RoleInfo allowed, so use get()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
        RoleInfo result = roleName2InfoMap.get(roleInfoName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
        if (result == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
            StringBuilder excMsgStrB = new StringBuilder();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
            String excMsg = "No role info for role ";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
            excMsgStrB.append(excMsg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
            excMsgStrB.append(roleInfoName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
            throw new RoleInfoNotFoundException(excMsgStrB.toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
43235
da1786d695b6 8172971: java.management could use System.Logger
dfuchs
parents: 25859
diff changeset
   263
        RELATION_LOGGER.log(Level.TRACE, "RETURN");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
        return result;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    // Misc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * Add a role info.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * This method of course should not be used after the creation of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     * relation type, because updating it would invalidate that the relations
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     * created associated to that type still conform to it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     * Can throw a RuntimeException if trying to update a relation type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     * declared in the Relation Service.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     * @param roleInfo  role info to be added.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     * @exception IllegalArgumentException  if null parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     * @exception InvalidRelationTypeException  if there is already a role
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     *  info in current relation type with the same name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
    protected void addRoleInfo(RoleInfo roleInfo)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
               InvalidRelationTypeException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
        if (roleInfo == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
            String excMsg = "Invalid parameter.";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
            throw new IllegalArgumentException(excMsg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
43235
da1786d695b6 8172971: java.management could use System.Logger
dfuchs
parents: 25859
diff changeset
   294
        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", roleInfo);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
        if (isInRelationService) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
            // Trying to update a declared relation type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
            String excMsg = "Relation type cannot be updated as it is declared in the Relation Service.";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
            throw new RuntimeException(excMsg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
        String roleName = roleInfo.getName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
        // Checks if the role info has already been described
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
        if (roleName2InfoMap.containsKey(roleName)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
            StringBuilder excMsgStrB = new StringBuilder();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
            String excMsg = "Two role infos provided for role ";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
            excMsgStrB.append(excMsg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
            excMsgStrB.append(roleName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
            throw new InvalidRelationTypeException(excMsgStrB.toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
        roleName2InfoMap.put(roleName, new RoleInfo(roleInfo));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
43235
da1786d695b6 8172971: java.management could use System.Logger
dfuchs
parents: 25859
diff changeset
   315
        RELATION_LOGGER.log(Level.TRACE, "RETURN");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
        return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
    // Sets the internal flag to specify that the relation type has been
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
    // declared in the Relation Service
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
    void setRelationServiceFlag(boolean flag) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
        isInRelationService = flag;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
        return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
    // Initializes the members, i.e. type name and role info list.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
    // -param relationTypeName  Name of relation type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
    // -param roleInfoArray  List of role definitions (RoleInfo objects)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
    // -exception IllegalArgumentException  if null parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
    // -exception InvalidRelationTypeException  If:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
    //  - the same name has been used for two different roles
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
    //  - no role info provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
    //  - one null role info provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
    private void initMembers(String relationTypeName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
                             RoleInfo[] roleInfoArray)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
               InvalidRelationTypeException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
        if (relationTypeName == null || roleInfoArray == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
            String excMsg = "Invalid parameter.";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
            throw new IllegalArgumentException(excMsg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
43235
da1786d695b6 8172971: java.management could use System.Logger
dfuchs
parents: 25859
diff changeset
   346
        RELATION_LOGGER.log(Level.TRACE, "ENTRY {0}", relationTypeName);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
        typeName = relationTypeName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
        // Verifies role infos before setting them
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
        // Can throw InvalidRelationTypeException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
        checkRoleInfos(roleInfoArray);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
        for (int i = 0; i < roleInfoArray.length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
            RoleInfo currRoleInfo = roleInfoArray[i];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
            roleName2InfoMap.put(currRoleInfo.getName(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
                                 new RoleInfo(currRoleInfo));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
43235
da1786d695b6 8172971: java.management could use System.Logger
dfuchs
parents: 25859
diff changeset
   360
        RELATION_LOGGER.log(Level.TRACE, "RETURN");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
        return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
    // Checks the given RoleInfo array to verify that:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
    // - the array is not empty
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
    // - it does not contain a null element
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
    // - a given role name is used only for one RoleInfo
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
    // -param roleInfoArray  array to be checked
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
    // -exception IllegalArgumentException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
    // -exception InvalidRelationTypeException  If:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
    //  - the same name has been used for two different roles
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
    //  - no role info provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
    //  - one null role info provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
    static void checkRoleInfos(RoleInfo[] roleInfoArray)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
        throws IllegalArgumentException,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
               InvalidRelationTypeException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
        if (roleInfoArray == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
            String excMsg = "Invalid parameter.";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
            throw new IllegalArgumentException(excMsg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
        if (roleInfoArray.length == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
            // No role info provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
            String excMsg = "No role info provided.";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
            throw new InvalidRelationTypeException(excMsg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
        Set<String> roleNames = new HashSet<String>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
        for (int i = 0; i < roleInfoArray.length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
            RoleInfo currRoleInfo = roleInfoArray[i];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
            if (currRoleInfo == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
                String excMsg = "Null role info provided.";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
                throw new InvalidRelationTypeException(excMsg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
            String roleName = currRoleInfo.getName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
            // Checks if the role info has already been described
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
            if (roleNames.contains(roleName)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
                StringBuilder excMsgStrB = new StringBuilder();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
                String excMsg = "Two role infos provided for role ";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
                excMsgStrB.append(excMsg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
                excMsgStrB.append(roleName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
                throw new InvalidRelationTypeException(excMsgStrB.toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
            roleNames.add(roleName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
        return;
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
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * Deserializes a {@link RelationTypeSupport} from an {@link ObjectInputStream}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
    private void readObject(ObjectInputStream in)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
            throws IOException, ClassNotFoundException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
      if (compat)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
        // Read an object serialized in the old serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
        ObjectInputStream.GetField fields = in.readFields();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
        typeName = (String) fields.get("myTypeName", null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
        if (fields.defaulted("myTypeName"))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
          throw new NullPointerException("myTypeName");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
        roleName2InfoMap = cast(fields.get("myRoleName2InfoMap", null));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
        if (fields.defaulted("myRoleName2InfoMap"))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
          throw new NullPointerException("myRoleName2InfoMap");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
        isInRelationService = fields.get("myIsInRelServFlg", false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
        if (fields.defaulted("myIsInRelServFlg"))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
          throw new NullPointerException("myIsInRelServFlg");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
      else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
        // Read an object serialized in the new serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
        in.defaultReadObject();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     * Serializes a {@link RelationTypeSupport} to an {@link ObjectOutputStream}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
    private void writeObject(ObjectOutputStream out)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
            throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
      if (compat)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
        // Serializes this instance in the old serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
        ObjectOutputStream.PutField fields = out.putFields();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
        fields.put("myTypeName", typeName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
        fields.put("myRoleName2InfoMap", roleName2InfoMap);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
        fields.put("myIsInRelServFlg", isInRelationService);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
        out.writeFields();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
      else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
        // Serializes this instance in the new serial form
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
        out.defaultWriteObject();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
}