Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / libjava / classpath / org / omg / PortableInterceptor / _IORInterceptor_3_0Stub.java
blob52856407a5460f54fc6412a81a795ef2ae68bb2a
1 /* _IORInterceptor_3_0Stub.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 org.omg.PortableInterceptor;
41 import org.omg.CORBA.MARSHAL;
42 import org.omg.CORBA.portable.ApplicationException;
43 import org.omg.CORBA.portable.Delegate;
44 import org.omg.CORBA.portable.InputStream;
45 import org.omg.CORBA.portable.ObjectImpl;
46 import org.omg.CORBA.portable.OutputStream;
47 import org.omg.CORBA.portable.RemarshalException;
49 import java.io.Serializable;
51 /**
52 * The IORInterceptor_3_0 stub (proxy), used on the client side. The
53 * {@link IORInterceptor_3_0} methods contain the code for remote invocaton. The
54 * stub is required by {@link IORInterceptor_3_0Helper} .read, .narrow and
55 * .unchecked_narrow methods.
57 * @specnote Being not specified in 1.5 API, this class is package private.
58 * From that happened to some other stubs, it will likely to appear in the 1.6
59 * or later. Because of this, it is placed here.
61 * @specnote The stub and the helper support the existence of the interceptor
62 * on the remote side only. To support the corresponding support on the side
63 * where the ORB is registered with this interceptor, you also need
64 * _IORInfoStub, IORInfoHelper and either servants or implementation bases
65 * for both POA and IORInfo. These classes are not defined in the 1.5 API,
66 * hence they are not included. You may need to generate the manually from
67 * the IDL descriptions, available from
68 * http://www.omg.org/docs/formal/04-03-12.pdf.
70 * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
72 class _IORInterceptor_3_0Stub
73 extends ObjectImpl
74 implements IORInterceptor_3_0, Serializable
76 /**
77 * Use serialVersionUID for interoperability.
79 private static final long serialVersionUID = 1;
81 /**
82 * Create the IORInterceptor_3_0 stub. To get the stub working, you must later
83 * set the delegate with {@link ObjectImpl#_set_delegate(Delegate)}.
85 public _IORInterceptor_3_0Stub()
89 /**
90 * Create the naming context stub with the given delegate.
92 public _IORInterceptor_3_0Stub(Delegate delegate)
94 _set_delegate(delegate);
97 /**
98 * Return the array of repository ids for this object.
100 public String[] _ids()
102 return new String[] { IORInterceptor_3_0Helper.id() };
105 /** {@inheritDoc} */
106 public void adapter_manager_state_changed(int adapterManagerId,
107 short adapterState)
109 InputStream input = null;
112 OutputStream output = _request("adapter_manager_state_changed", true);
113 output.write_long(adapterManagerId);
114 output.write_short(adapterState);
115 input = _invoke(output);
118 catch (ApplicationException ex)
120 input = ex.getInputStream();
121 String id = ex.getId();
122 throw new MARSHAL(id);
124 catch (RemarshalException remarsh)
126 adapter_manager_state_changed(adapterManagerId, adapterState);
128 finally
130 _releaseReply(input);
134 /** {@inheritDoc} */
135 public void adapter_state_changed(ObjectReferenceTemplate[] adapters,
136 short adaptersState)
138 InputStream input = null;
141 OutputStream output = _request("adapter_state_changed", true);
142 output.write_long(adapters.length);
143 for (int i0 = 0; i0 < adapters.length; i0++)
144 ObjectReferenceTemplateHelper.write(output, adapters[i0]);
145 output.write_short(adaptersState);
146 input = _invoke(output);
149 catch (ApplicationException ex)
151 input = ex.getInputStream();
152 String id = ex.getId();
153 throw new MARSHAL(id);
155 catch (RemarshalException remarsh)
157 adapter_state_changed(adapters, adaptersState);
159 finally
161 _releaseReply(input);
165 /** {@inheritDoc} */
166 public void components_established(IORInfo info)
168 InputStream input = null;
171 OutputStream output = _request("components_established", true);
172 output.write_Object(info);
173 input = _invoke(output);
176 catch (ApplicationException ex)
178 input = ex.getInputStream();
179 String id = ex.getId();
180 throw new MARSHAL(id);
182 catch (RemarshalException remarsh)
184 components_established(info);
186 finally
188 _releaseReply(input);
192 /** {@inheritDoc} */
193 public void establish_components(IORInfo info)
195 InputStream input = null;
198 OutputStream output = _request("establish_components", true);
199 output.write_Object(info);
200 input = _invoke(output);
203 catch (ApplicationException ex)
205 input = ex.getInputStream();
206 String id = ex.getId();
207 throw new MARSHAL(id);
209 catch (RemarshalException remarsh)
211 establish_components(info);
213 finally
215 _releaseReply(input);
219 /** {@inheritDoc} */
220 public String name()
222 InputStream input = null;
225 OutputStream output = _request("name", true);
226 input = _invoke(output);
227 String returns = input.read_string();
229 return returns;
231 catch (ApplicationException ex)
233 input = ex.getInputStream();
234 String id = ex.getId();
235 throw new MARSHAL(id);
237 catch (RemarshalException remarsh)
239 return name();
241 finally
243 _releaseReply(input);
247 /** {@inheritDoc} */
248 public void destroy()
250 InputStream input = null;
253 OutputStream output = _request("destroy", true);
254 input = _invoke(output);
257 catch (ApplicationException ex)
259 input = ex.getInputStream();
260 String id = ex.getId();
261 throw new MARSHAL(id);
263 catch (RemarshalException remarsh)
265 destroy();
267 finally
269 _releaseReply(input);