Dead
[official-gcc.git] / gomp-20050608-branch / libjava / classpath / examples / gnu / classpath / examples / CORBA / swing / x5 / _GameManager_Stub.java
blobe9279963a6ad2daaa4de6963d66d0c2f1d87a2bc
1 /* _GameManager_Stub.java --
2 Copyright (C) 2005 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)
9 any later version.
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
19 02110-1301 USA.
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.
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. */
39 package gnu.classpath.examples.CORBA.swing.x5;
41 import java.rmi.RemoteException;
42 import java.rmi.UnexpectedException;
44 import javax.rmi.CORBA.Stub;
45 import javax.rmi.CORBA.Util;
47 import org.omg.CORBA.SystemException;
48 import org.omg.CORBA.portable.ApplicationException;
49 import org.omg.CORBA.portable.OutputStream;
50 import org.omg.CORBA.portable.RemarshalException;
51 import org.omg.CORBA.portable.ServantObject;
53 /**
54 * Normally generated with rmic compiler, this class represents the GameManager
55 * Stub on the client side. The Game Manager methods contain the code for
56 * remote invocation.
58 * This class is normally generated with rmic from the {@link GameManagerImpl}:
59 * <pre>
60 * rmic -iiop -poa -keep gnu.classpath.examples.CORBA.swing.x5.GameManagerImpl
61 * </pre>
62 * (the compiled package must be present in the current folder).
64 * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
66 public class _GameManager_Stub extends Stub implements GameManager
68 /**
69 * Use serialVersionUID for interoperability.
71 private static final long serialVersionUID = 1;
73 private static final String[] _type_ids =
74 { "RMI:gnu.classpath.examples.CORBA.swing.x5.GameManager:0000000000000000" };
76 public String[] _ids()
78 return _type_ids;
81 /**
82 * Notify the manager that the player is no longer willing to play and
83 * should be removed from the queue.
85 public void unregister(Player p)
86 throws RemoteException
88 if (!Util.isLocal(this))
90 try
92 org.omg.CORBA.portable.InputStream in = null;
93 try
95 OutputStream out = _request("unregister", true);
96 Util.writeRemoteObject(out, p);
97 _invoke(out);
99 catch (ApplicationException ex)
101 in = ex.getInputStream();
103 String id = in.read_string();
104 throw new UnexpectedException(id);
106 catch (RemarshalException ex)
108 unregister(p);
110 finally
112 _releaseReply(in);
115 catch (SystemException ex)
117 throw Util.mapSystemException(ex);
120 else
122 ServantObject so =
123 _servant_preinvoke("requestTheGame", GameManager.class);
124 if (so == null)
126 unregister(p);
127 return;
131 ((GameManager) so.servant).unregister(p);
133 catch (Throwable ex)
135 Throwable exCopy = (Throwable) Util.copyObject(ex, _orb());
136 throw Util.wrapException(exCopy);
138 finally
140 _servant_postinvoke(so);
146 * The method that the user should invoke.
148 public void requestTheGame(Player arg0) throws RemoteException
150 if (!Util.isLocal(this))
154 org.omg.CORBA.portable.InputStream in = null;
157 OutputStream out = _request("requestTheGame", true);
158 Util.writeRemoteObject(out, arg0);
159 _invoke(out);
161 catch (ApplicationException ex)
163 in = ex.getInputStream();
165 String id = in.read_string();
166 throw new UnexpectedException(id);
168 catch (RemarshalException ex)
170 requestTheGame(arg0);
172 finally
174 _releaseReply(in);
177 catch (SystemException ex)
179 throw Util.mapSystemException(ex);
182 else
184 ServantObject so =
185 _servant_preinvoke("requestTheGame", GameManager.class);
186 if (so == null)
188 requestTheGame(arg0);
189 return;
193 Player arg0Copy = (Player) Util.copyObject(arg0, _orb());
194 ((GameManager) so.servant).requestTheGame(arg0Copy);
196 catch (Throwable ex)
198 Throwable exCopy = (Throwable) Util.copyObject(ex, _orb());
199 throw Util.wrapException(exCopy);
201 finally
203 _servant_postinvoke(so);