OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [classpath/] [tools/] [gnu/] [classpath/] [tools/] [rmiregistry/] [RegistryImpl_Skel.java] - Blame information for rev 779

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 779 jeremybenn
/* RegistryImpl_Skel.java
2
   Copyright (C) 2002, 2006 Free Software Foundation, Inc.
3
 
4
This file is part of GNU Classpath.
5
 
6
GNU Classpath is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2, or (at your option)
9
any later version.
10
 
11
GNU Classpath is distributed in the hope that it will be useful, but
12
WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
General Public License for more details.
15
 
16
You should have received a copy of the GNU General Public License
17
along with GNU Classpath; see the file COPYING.  If not, write to the
18
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
02110-1301 USA.
20
 
21
Linking this library statically or dynamically with other modules is
22
making a combined work based on this library.  Thus, the terms and
23
conditions of the GNU General Public License cover the whole
24
combination.
25
 
26
As a special exception, the copyright holders of this library give you
27
permission to link this library with independent modules to produce an
28
executable, regardless of the license terms of these independent
29
modules, and to copy and distribute the resulting executable under
30
terms of your choice, provided that you also meet, for each linked
31
independent module, the terms and conditions of the license of that
32
module.  An independent module is a module which is not derived from
33
or based on this library.  If you modify this library, you may extend
34
this exception to your version of the library, but you are not
35
obligated to do so.  If you do not wish to do so, delete this
36
exception statement from your version. */
37
 
38
 
39
package gnu.classpath.tools.rmiregistry;
40
 
41
import java.io.IOException;
42
import java.io.ObjectInput;
43
import java.io.ObjectOutput;
44
import java.rmi.MarshalException;
45
import java.rmi.Remote;
46
import java.rmi.UnmarshalException;
47
import java.rmi.server.Operation;
48
import java.rmi.server.RemoteCall;
49
import java.rmi.server.SkeletonMismatchException;
50
 
51
/**
52
 * This skeleton supports unlikely cases when the naming service is
53
 * contacted from other interoperable java implementation that still uses
54
 * the old style skeleton-dependent invocations.
55
 */
56
public final class RegistryImpl_Skel
57
    implements java.rmi.server.Skeleton
58
{
59
    private static final long interfaceHash = 4905912898345647071L;
60
 
61
    /**
62
     * Repeated multiple times.
63
     */
64
    static final String EUM = "error unmarshalling arguments for Registry";
65
 
66
    /**
67
     * Repeated multiple times.
68
     */
69
    static final String EMR = "error marshalling return from Registry";
70
 
71
    private static final Operation[] operations =
72
      {
73
         new Operation("void bind(java.lang.String, Remote"),
74
         new Operation("java.lang.String[] list("),
75
         new Operation("Remote lookup(java.lang.String"),
76
         new Operation("void rebind(java.lang.String, Remote"),
77
         new Operation("void unbind(java.lang.String")
78
      };
79
 
80
    public Operation[] getOperations()
81
  {
82
    return ((Operation[]) operations.clone());
83
  }
84
 
85
    public void dispatch(Remote obj, RemoteCall call,
86
                       int opnum, long hash) throws java.lang.Exception
87
  {
88
    if (opnum < 0)
89
      {
90
        if (hash == 7583982177005850366L)
91
          opnum = 0;
92
        else if (hash == 2571371476350237748L)
93
          opnum = 1;
94
        else if (hash == -7538657168040752697L)
95
          opnum = 2;
96
        else if (hash == -8381844669958460146L)
97
          opnum = 3;
98
        else if (hash == 7305022919901907578L)
99
          opnum = 4;
100
        else
101
          throw new SkeletonMismatchException("interface hash mismatch");
102
      }
103
    else if (hash != interfaceHash)
104
      throw new SkeletonMismatchException("interface hash mismatch");
105
 
106
    RegistryImpl server = (RegistryImpl) obj;
107
    switch (opnum)
108
      {
109
      case 0:
110
      {
111
        java.lang.String $param_0;
112
        Remote $param_1;
113
        try
114
          {
115
            ObjectInput in = call.getInputStream();
116
            $param_0 = (java.lang.String) in.readObject();
117
            $param_1 = (Remote) in.readObject();
118
 
119
          }
120
        catch (IOException e)
121
          {
122
            throw new UnmarshalException(EUM, e);
123
          }
124
        catch (java.lang.ClassCastException e)
125
          {
126
            throw new UnmarshalException(EUM, e);
127
          }
128
        finally
129
          {
130
            call.releaseInputStream();
131
          }
132
        server.bind($param_0, $param_1);
133
        try
134
          {
135
            ObjectOutput out = call.getResultStream(true);
136
          }
137
        catch (IOException e)
138
          {
139
            throw new MarshalException(EMR, e);
140
          }
141
        break;
142
      }
143
 
144
      case 1:
145
      {
146
        try
147
          {
148
            ObjectInput in = call.getInputStream();
149
 
150
          }
151
        catch (IOException e)
152
          {
153
            throw new UnmarshalException(EUM, e);
154
          }
155
        finally
156
          {
157
            call.releaseInputStream();
158
          }
159
        java.lang.String[] $result = server.list();
160
        try
161
          {
162
            ObjectOutput out = call.getResultStream(true);
163
            out.writeObject($result);
164
          }
165
        catch (IOException e)
166
          {
167
            throw new MarshalException(EMR, e);
168
          }
169
        break;
170
      }
171
 
172
      case 2:
173
      {
174
        java.lang.String $param_0;
175
        try
176
          {
177
            ObjectInput in = call.getInputStream();
178
            $param_0 = (java.lang.String) in.readObject();
179
 
180
          }
181
        catch (IOException e)
182
          {
183
            throw new UnmarshalException(EUM, e);
184
          }
185
        catch (java.lang.ClassCastException e)
186
          {
187
            throw new UnmarshalException(EUM, e);
188
          }
189
        finally
190
          {
191
            call.releaseInputStream();
192
          }
193
        Remote $result = server.lookup($param_0);
194
        try
195
          {
196
            ObjectOutput out = call.getResultStream(true);
197
            out.writeObject($result);
198
          }
199
        catch (IOException e)
200
          {
201
            throw new MarshalException(EMR, e);
202
          }
203
        break;
204
      }
205
 
206
      case 3:
207
      {
208
        java.lang.String $param_0;
209
        Remote $param_1;
210
        try
211
          {
212
            ObjectInput in = call.getInputStream();
213
            $param_0 = (java.lang.String) in.readObject();
214
            $param_1 = (Remote) in.readObject();
215
 
216
          }
217
        catch (IOException e)
218
          {
219
            throw new UnmarshalException(EUM, e);
220
          }
221
        catch (java.lang.ClassCastException e)
222
          {
223
            throw new UnmarshalException(EUM, e);
224
          }
225
        finally
226
          {
227
            call.releaseInputStream();
228
          }
229
        server.rebind($param_0, $param_1);
230
        try
231
          {
232
            ObjectOutput out = call.getResultStream(true);
233
          }
234
        catch (IOException e)
235
          {
236
            throw new MarshalException(EMR, e);
237
          }
238
        break;
239
      }
240
 
241
      case 4:
242
      {
243
        java.lang.String $param_0;
244
        try
245
          {
246
            ObjectInput in = call.getInputStream();
247
            $param_0 = (java.lang.String) in.readObject();
248
 
249
          }
250
        catch (IOException e)
251
          {
252
            throw new UnmarshalException(EUM, e);
253
          }
254
        catch (java.lang.ClassCastException e)
255
          {
256
            throw new UnmarshalException(EUM, e);
257
          }
258
        finally
259
          {
260
            call.releaseInputStream();
261
          }
262
        server.unbind($param_0);
263
        try
264
          {
265
            ObjectOutput out = call.getResultStream(true);
266
          }
267
        catch (IOException e)
268
          {
269
            throw new MarshalException(EMR, e);
270
          }
271
        break;
272
      }
273
 
274
      default:
275
        throw new UnmarshalException("invalid method number");
276
      }
277
  }
278
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.