1/*
2 * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24// Stub class generated by rmic, do not edit.
25// Contents subject to change without notice.
26
27public final class CheckAnnotations_Stub
28    extends java.rmi.server.RemoteStub
29    implements MyRMI, java.rmi.Remote
30{
31    private static final java.rmi.server.Operation[] operations = {
32        new java.rmi.server.Operation("void printErr(java.lang.String)"),
33        new java.rmi.server.Operation("void printOut(java.lang.String)"),
34        new java.rmi.server.Operation("void shutdown()")
35    };
36
37    private static final long interfaceHash = -3955951123118841923L;
38
39    private static final long serialVersionUID = 2;
40
41    private static boolean useNewInvoke;
42    private static java.lang.reflect.Method $method_printErr_0;
43    private static java.lang.reflect.Method $method_printOut_1;
44    private static java.lang.reflect.Method $method_shutdown_2;
45
46    static {
47        try {
48            java.rmi.server.RemoteRef.class.getMethod("invoke",
49                new java.lang.Class[] {
50                    java.rmi.Remote.class,
51                    java.lang.reflect.Method.class,
52                    java.lang.Object[].class,
53                    long.class
54                });
55            useNewInvoke = true;
56            $method_printErr_0 = MyRMI.class.getMethod("printErr", new java.lang.Class[] {java.lang.String.class});
57            $method_printOut_1 = MyRMI.class.getMethod("printOut", new java.lang.Class[] {java.lang.String.class});
58            $method_shutdown_2 = MyRMI.class.getMethod("shutdown", new java.lang.Class[] {});
59        } catch (java.lang.NoSuchMethodException e) {
60            useNewInvoke = false;
61        }
62    }
63
64    // constructors
65    public CheckAnnotations_Stub() {
66        super();
67    }
68    public CheckAnnotations_Stub(java.rmi.server.RemoteRef ref) {
69        super(ref);
70    }
71
72    // methods from remote interfaces
73
74    // implementation of printErr(String)
75    public void printErr(java.lang.String $param_String_1)
76        throws java.rmi.RemoteException
77    {
78        try {
79            if (useNewInvoke) {
80                ref.invoke(this, $method_printErr_0, new java.lang.Object[] {$param_String_1}, 1120261287704800747L);
81            } else {
82                java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 0, interfaceHash);
83                try {
84                    java.io.ObjectOutput out = call.getOutputStream();
85                    out.writeObject($param_String_1);
86                } catch (java.io.IOException e) {
87                    throw new java.rmi.MarshalException("error marshalling arguments", e);
88                }
89                ref.invoke(call);
90                ref.done(call);
91            }
92        } catch (java.lang.RuntimeException e) {
93            throw e;
94        } catch (java.rmi.RemoteException e) {
95            throw e;
96        } catch (java.lang.Exception e) {
97            throw new java.rmi.UnexpectedException("undeclared checked exception", e);
98        }
99    }
100
101    // implementation of printOut(String)
102    public void printOut(java.lang.String $param_String_1)
103        throws java.rmi.RemoteException
104    {
105        try {
106            if (useNewInvoke) {
107                ref.invoke(this, $method_printOut_1, new java.lang.Object[] {$param_String_1}, -7517735248176918178L);
108            } else {
109                java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 1, interfaceHash);
110                try {
111                    java.io.ObjectOutput out = call.getOutputStream();
112                    out.writeObject($param_String_1);
113                } catch (java.io.IOException e) {
114                    throw new java.rmi.MarshalException("error marshalling arguments", e);
115                }
116                ref.invoke(call);
117                ref.done(call);
118            }
119        } catch (java.lang.RuntimeException e) {
120            throw e;
121        } catch (java.rmi.RemoteException e) {
122            throw e;
123        } catch (java.lang.Exception e) {
124            throw new java.rmi.UnexpectedException("undeclared checked exception", e);
125        }
126    }
127
128    // implementation of shutdown()
129    public void shutdown()
130        throws java.lang.Exception
131    {
132        if (useNewInvoke) {
133            ref.invoke(this, $method_shutdown_2, null, -7207851917985848402L);
134        } else {
135            java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 2, interfaceHash);
136            ref.invoke(call);
137            ref.done(call);
138        }
139    }
140}
141