jdk/src/java.rmi/share/classes/sun/rmi/transport/DGCImpl_Skel.java
author rriggs
Thu, 16 Mar 2017 16:16:31 -0400
changeset 45984 75fef64e21fa
permissions -rw-r--r--
8163958: Improved garbage collection Reviewed-by: smarks, chegar, skoivu, rhalade
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
45984
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
     1
/*
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
     2
 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
     4
 *
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    10
 *
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    15
 * accompanied this code).
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    16
 *
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    20
 *
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    23
 * questions.
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    24
 */
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    25
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    26
package sun.rmi.transport;
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    27
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    28
/**
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    29
 * Skeleton to dispatch DGC methods.
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    30
 * Originally generated by RMIC but frozen to match the stubs.
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    31
 */
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    32
@SuppressWarnings({"deprecation", "serial"})
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    33
public final class DGCImpl_Skel
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    34
        implements java.rmi.server.Skeleton {
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    35
    private static final java.rmi.server.Operation[] operations = {
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    36
            new java.rmi.server.Operation("void clean(java.rmi.server.ObjID[], long, java.rmi.dgc.VMID, boolean)"),
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    37
            new java.rmi.server.Operation("java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease)")
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    38
    };
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    39
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    40
    private static final long interfaceHash = -669196253586618813L;
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    41
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    42
    public java.rmi.server.Operation[] getOperations() {
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    43
        return operations.clone();
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    44
    }
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    45
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    46
    public void dispatch(java.rmi.Remote obj, java.rmi.server.RemoteCall call, int opnum, long hash)
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    47
            throws java.lang.Exception {
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    48
        if (hash != interfaceHash)
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    49
            throw new java.rmi.server.SkeletonMismatchException("interface hash mismatch");
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    50
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    51
        sun.rmi.transport.DGCImpl server = (sun.rmi.transport.DGCImpl) obj;
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    52
        switch (opnum) {
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    53
            case 0: // clean(ObjID[], long, VMID, boolean)
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    54
            {
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    55
                java.rmi.server.ObjID[] $param_arrayOf_ObjID_1;
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    56
                long $param_long_2;
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    57
                java.rmi.dgc.VMID $param_VMID_3;
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    58
                boolean $param_boolean_4;
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    59
                try {
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    60
                    java.io.ObjectInput in = call.getInputStream();
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    61
                    $param_arrayOf_ObjID_1 = (java.rmi.server.ObjID[]) in.readObject();
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    62
                    $param_long_2 = in.readLong();
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    63
                    $param_VMID_3 = (java.rmi.dgc.VMID) in.readObject();
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    64
                    $param_boolean_4 = in.readBoolean();
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    65
                } catch (java.io.IOException e) {
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    66
                    throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    67
                } catch (java.lang.ClassNotFoundException e) {
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    68
                    throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    69
                } finally {
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    70
                    call.releaseInputStream();
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    71
                }
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    72
                server.clean($param_arrayOf_ObjID_1, $param_long_2, $param_VMID_3, $param_boolean_4);
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    73
                try {
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    74
                    call.getResultStream(true);
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    75
                } catch (java.io.IOException e) {
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    76
                    throw new java.rmi.MarshalException("error marshalling return", e);
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    77
                }
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    78
                break;
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    79
            }
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    80
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    81
            case 1: // dirty(ObjID[], long, Lease)
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    82
            {
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    83
                java.rmi.server.ObjID[] $param_arrayOf_ObjID_1;
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    84
                long $param_long_2;
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    85
                java.rmi.dgc.Lease $param_Lease_3;
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    86
                try {
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    87
                    java.io.ObjectInput in = call.getInputStream();
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    88
                    $param_arrayOf_ObjID_1 = (java.rmi.server.ObjID[]) in.readObject();
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    89
                    $param_long_2 = in.readLong();
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    90
                    $param_Lease_3 = (java.rmi.dgc.Lease) in.readObject();
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    91
                } catch (java.io.IOException e) {
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    92
                    throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    93
                } catch (java.lang.ClassNotFoundException e) {
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    94
                    throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    95
                } finally {
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    96
                    call.releaseInputStream();
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    97
                }
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    98
                java.rmi.dgc.Lease $result = server.dirty($param_arrayOf_ObjID_1, $param_long_2, $param_Lease_3);
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
    99
                try {
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
   100
                    java.io.ObjectOutput out = call.getResultStream(true);
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
   101
                    out.writeObject($result);
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
   102
                } catch (java.io.IOException e) {
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
   103
                    throw new java.rmi.MarshalException("error marshalling return", e);
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
   104
                }
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
   105
                break;
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
   106
            }
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
   107
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
   108
            default:
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
   109
                throw new java.rmi.UnmarshalException("invalid method number");
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
   110
        }
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
   111
    }
75fef64e21fa 8163958: Improved garbage collection
rriggs
parents:
diff changeset
   112
}