Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.rmi/share/classes/sun/rmi/registry/RegistryImpl_Skel.java
41154 views
1
/*
2
* Copyright (c) 2017, 2019, 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. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
10
*
11
* This code is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
* version 2 for more details (a copy is included in the LICENSE file that
15
* accompanied this code).
16
*
17
* You should have received a copy of the GNU General Public License version
18
* 2 along with this work; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
*
21
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
* or visit www.oracle.com if you need additional information or have any
23
* questions.
24
*/
25
26
27
package sun.rmi.registry;
28
29
import java.io.IOException;
30
import java.io.ObjectInputStream;
31
32
import jdk.internal.access.SharedSecrets;
33
import sun.rmi.transport.StreamRemoteCall;
34
35
/**
36
* Skeleton to dispatch RegistryImpl methods.
37
* Originally generated by RMIC but frozen to match the stubs.
38
*/
39
@SuppressWarnings({"deprecation", "serial"})
40
public final class RegistryImpl_Skel
41
implements java.rmi.server.Skeleton {
42
private static final java.rmi.server.Operation[] operations = {
43
new java.rmi.server.Operation("void bind(java.lang.String, java.rmi.Remote)"),
44
new java.rmi.server.Operation("java.lang.String list()[]"),
45
new java.rmi.server.Operation("java.rmi.Remote lookup(java.lang.String)"),
46
new java.rmi.server.Operation("void rebind(java.lang.String, java.rmi.Remote)"),
47
new java.rmi.server.Operation("void unbind(java.lang.String)")
48
};
49
50
private static final long interfaceHash = 4905912898345647071L;
51
52
public java.rmi.server.Operation[] getOperations() {
53
return operations.clone();
54
}
55
56
public void dispatch(java.rmi.Remote obj, java.rmi.server.RemoteCall remoteCall, int opnum, long hash)
57
throws java.lang.Exception {
58
if (opnum < 0) {
59
if (hash == 7583982177005850366L) {
60
opnum = 0;
61
} else if (hash == 2571371476350237748L) {
62
opnum = 1;
63
} else if (hash == -7538657168040752697L) {
64
opnum = 2;
65
} else if (hash == -8381844669958460146L) {
66
opnum = 3;
67
} else if (hash == 7305022919901907578L) {
68
opnum = 4;
69
} else {
70
throw new java.rmi.UnmarshalException("invalid method hash");
71
}
72
} else {
73
if (hash != interfaceHash)
74
throw new java.rmi.server.SkeletonMismatchException("interface hash mismatch");
75
}
76
77
sun.rmi.registry.RegistryImpl server = (sun.rmi.registry.RegistryImpl) obj;
78
StreamRemoteCall call = (StreamRemoteCall) remoteCall;
79
switch (opnum) {
80
case 0: // bind(String, Remote)
81
{
82
// Check access before reading the arguments
83
RegistryImpl.checkAccess("Registry.bind");
84
85
java.lang.String $param_String_1;
86
java.rmi.Remote $param_Remote_2;
87
try {
88
ObjectInputStream in = (ObjectInputStream)call.getInputStream();
89
$param_String_1 =
90
SharedSecrets.getJavaObjectInputStreamReadString().readString(in);
91
$param_Remote_2 = (java.rmi.Remote) in.readObject();
92
} catch (ClassCastException | IOException | ClassNotFoundException e) {
93
call.discardPendingRefs();
94
throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
95
} finally {
96
call.releaseInputStream();
97
}
98
server.bind($param_String_1, $param_Remote_2);
99
try {
100
call.getResultStream(true);
101
} catch (java.io.IOException e) {
102
throw new java.rmi.MarshalException("error marshalling return", e);
103
}
104
break;
105
}
106
107
case 1: // list()
108
{
109
call.releaseInputStream();
110
java.lang.String[] $result = server.list();
111
try {
112
java.io.ObjectOutput out = call.getResultStream(true);
113
out.writeObject($result);
114
} catch (java.io.IOException e) {
115
throw new java.rmi.MarshalException("error marshalling return", e);
116
}
117
break;
118
}
119
120
case 2: // lookup(String)
121
{
122
java.lang.String $param_String_1;
123
try {
124
ObjectInputStream in = (ObjectInputStream)call.getInputStream();
125
$param_String_1 =
126
SharedSecrets.getJavaObjectInputStreamReadString().readString(in);
127
} catch (ClassCastException | IOException e) {
128
call.discardPendingRefs();
129
throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
130
} finally {
131
call.releaseInputStream();
132
}
133
java.rmi.Remote $result = server.lookup($param_String_1);
134
try {
135
java.io.ObjectOutput out = call.getResultStream(true);
136
out.writeObject($result);
137
} catch (java.io.IOException e) {
138
throw new java.rmi.MarshalException("error marshalling return", e);
139
}
140
break;
141
}
142
143
case 3: // rebind(String, Remote)
144
{
145
// Check access before reading the arguments
146
RegistryImpl.checkAccess("Registry.rebind");
147
148
java.lang.String $param_String_1;
149
java.rmi.Remote $param_Remote_2;
150
try {
151
ObjectInputStream in = (ObjectInputStream)call.getInputStream();
152
$param_String_1 =
153
SharedSecrets.getJavaObjectInputStreamReadString().readString(in);
154
$param_Remote_2 = (java.rmi.Remote) in.readObject();
155
} catch (ClassCastException | IOException | java.lang.ClassNotFoundException e) {
156
call.discardPendingRefs();
157
throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
158
} finally {
159
call.releaseInputStream();
160
}
161
server.rebind($param_String_1, $param_Remote_2);
162
try {
163
call.getResultStream(true);
164
} catch (java.io.IOException e) {
165
throw new java.rmi.MarshalException("error marshalling return", e);
166
}
167
break;
168
}
169
170
case 4: // unbind(String)
171
{
172
// Check access before reading the arguments
173
RegistryImpl.checkAccess("Registry.unbind");
174
175
java.lang.String $param_String_1;
176
try {
177
ObjectInputStream in = (ObjectInputStream)call.getInputStream();
178
$param_String_1 =
179
SharedSecrets.getJavaObjectInputStreamReadString().readString(in);
180
} catch (ClassCastException | IOException e) {
181
call.discardPendingRefs();
182
throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
183
} finally {
184
call.releaseInputStream();
185
}
186
server.unbind($param_String_1);
187
try {
188
call.getResultStream(true);
189
} catch (java.io.IOException e) {
190
throw new java.rmi.MarshalException("error marshalling return", e);
191
}
192
break;
193
}
194
195
default:
196
throw new java.rmi.UnmarshalException("invalid method number");
197
}
198
}
199
}
200
201