1 /* RegistryImpl_Stub.java -- Registry stub.
2 Copyright (c) 2006 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
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)
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.
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
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
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. */
38 package gnu.classpath.tools.rmiregistry;
40 import java.rmi.AccessException;
41 import java.rmi.AlreadyBoundException;
42 import java.rmi.NotBoundException;
43 import java.rmi.Remote;
44 import java.rmi.RemoteException;
45 import java.rmi.registry.Registry;
47 import java.lang.reflect.Method;
48 import java.rmi.server.RemoteRef;
49 import java.rmi.server.RemoteStub;
50 import java.rmi.UnexpectedException;
53 * This class delegates its method calls to the remote RMI object, referenced
54 * by {@link RemoteRef}.
56 * It is normally generated with rmic.
58 public final class RegistryImpl_Stub
63 * Use serialVersionUID for interoperability
65 private static final long serialVersionUID = 3;
68 * The explaining message for {@ling UnexpectedException}.
70 private static final String exception_message =
71 "undeclared checked exception";
73 /* All remote methods, invoked by this stub: */
74 private static final Method met_list;
75 private static final Method met_rebind;
76 private static final Method met_unbind;
77 private static final Method met_lookup;
78 private static final Method met_bind;
79 private static final Object[] NO_ARGS = new Object[0];
82 final Class[] NO_ARGSc = new Class[0];
86 Registry.class.getMethod("list", NO_ARGSc);
88 Registry.class.getMethod("rebind", new Class[]
90 String.class, Remote.class
93 Registry.class.getMethod("unbind", new Class[]
98 Registry.class.getMethod("lookup", new Class[]
103 Registry.class.getMethod("bind", new Class[]
105 String.class, Remote.class
109 catch (NoSuchMethodException nex)
111 NoSuchMethodError err = new NoSuchMethodError(
112 "RegistryImpl_Stub class initialization failed");
119 * Create the instance for _RegistryImpl_Stub that forwards method calls to the
122 * @para the reference to the remote object.
124 public RegistryImpl_Stub(RemoteRef reference)
131 public String [] list()
132 throws RemoteException, AccessException
136 Object result = ref.invoke(this, met_list,
138 2571371476350237748L);
139 return (String []) result;
141 catch (RuntimeException e)
145 catch (RemoteException e)
151 UnexpectedException uex = new UnexpectedException(exception_message);
158 public void rebind(String p0, Remote p1)
159 throws RemoteException, AccessException
163 ref.invoke(this, met_rebind,
164 new Object[] {p0, p1},
165 -8381844669958460146L);
167 catch (RuntimeException e)
171 catch (RemoteException e)
177 UnexpectedException uex = new UnexpectedException(exception_message);
184 public void unbind(String p0)
185 throws RemoteException, NotBoundException, AccessException
189 ref.invoke(this, met_unbind,
191 7305022919901907578L);
193 catch (RuntimeException e)
197 catch (RemoteException e)
203 UnexpectedException uex = new UnexpectedException(exception_message);
210 public Remote lookup(String p0)
211 throws RemoteException, NotBoundException, AccessException
215 Object result = ref.invoke(this, met_lookup,
217 -7538657168040752697L);
218 return (Remote) result;
220 catch (RuntimeException e)
224 catch (RemoteException e)
230 UnexpectedException uex = new UnexpectedException(exception_message);
237 public void bind(String p0, Remote p1)
238 throws RemoteException, AlreadyBoundException, AccessException
242 ref.invoke(this, met_bind,
243 new Object[] {p0, p1},
244 7583982177005850366L);
246 catch (RuntimeException e)
250 catch (RemoteException e)
256 UnexpectedException uex = new UnexpectedException(exception_message);