001/* MARSHAL.java --
002   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
003
004This file is part of GNU Classpath.
005
006GNU Classpath is free software; you can redistribute it and/or modify
007it under the terms of the GNU General Public License as published by
008the Free Software Foundation; either version 2, or (at your option)
009any later version.
010
011GNU Classpath is distributed in the hope that it will be useful, but
012WITHOUT ANY WARRANTY; without even the implied warranty of
013MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014General Public License for more details.
015
016You should have received a copy of the GNU General Public License
017along with GNU Classpath; see the file COPYING.  If not, write to the
018Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
01902110-1301 USA.
020
021Linking this library statically or dynamically with other modules is
022making a combined work based on this library.  Thus, the terms and
023conditions of the GNU General Public License cover the whole
024combination.
025
026As a special exception, the copyright holders of this library give you
027permission to link this library with independent modules to produce an
028executable, regardless of the license terms of these independent
029modules, and to copy and distribute the resulting executable under
030terms of your choice, provided that you also meet, for each linked
031independent module, the terms and conditions of the license of that
032module.  An independent module is a module which is not derived from
033or based on this library.  If you modify this library, you may extend
034this exception to your version of the library, but you are not
035obligated to do so.  If you do not wish to do so, delete this
036exception statement from your version. */
037
038
039package org.omg.CORBA;
040
041import java.io.Serializable;
042
043/**
044 * Means that some request or reply from the network has a wrong size or is
045 * structurally invalid. In GNU Classpath, this exception may have the following
046 * minor codes (the high 20 bits being Classpath VMCID):
047 * 
048 * <table border="1">
049 * <tr>
050 * <th>Hex</th>
051 * <th>Dec</th>
052 * <th>Minor</th>
053 * <th>Name</th>
054 * <th>Case</th>
055 * </tr>
056 * <tr>
057 * <td>47430001</td>
058 * <td>1195573249</td>
059 * <td>1</td>
060 * <td>Giop</td>
061 * <td>The message being received is not a GIOP message. It does not start from
062 * the expected magic sequence byte[] { 'G', 'I', 'O', 'P' }.</td>
063 * </tr>
064 * <tr>
065 * <td>47430002</td>
066 * <td>1195573250</td>
067 * <td>2</td>
068 * <td>Header</td>
069 * <td>The unexpected IOException while reading or writing the GIOP message
070 * header or the subsequent request or response header</td>
071 * </tr>
072 * <tr>
073 * <td>47430003</td>
074 * <td>1195573251</td>
075 * <td>3</td>
076 * <td>EOF</td>
077 * <td>The data stream ended before reading all expected values from it. This
078 * usually means that the CORBA message is corrupted, but may also indicate that
079 * the server expects the remote method being invoked to have more or different
080 * parameters</td>
081 * </tr>
082 * <tr>
083 * <td>47430005</td>
084 * <td>1195573253</td>
085 * <td>5</td>
086 * <td>CDR</td>
087 * <td>The unexpected IOException while reading or writing the data via Commond
088 * Data Representation stream</td>
089 * </tr>
090 * <tr>
091 * <td>47430006</td>
092 * <td>1195573254 </td>
093 * <td>6</td>
094 * <td>Value</td>
095 * <td>The unexpected IOException while reading or writing the Value type.
096 * </td>
097 * </tr>
098 * <tr>
099 * <td>47430007 </td>
100 * <td>1195573255</td>
101 * <td>7</td>
102 * <td>Forwarding</td>
103 * <td>The unexpected IOException while handling request forwarding.</td>
104 * </tr>
105 * <tr>
106 * <td>47430008</td>
107 * <td>1195573256</td>
108 * <td>8</td>
109 * <td>Encapsulation </td>
110 * <td>The unexpected IOException while handling data encapsulation, tagged
111 * components, tagged profiles, etc.</td>
112 * </tr>
113 * <tr>
114 * <td>47430009</td>
115 * <td>1195573257</td>
116 * <td>9 </td>
117 * <td>Any</td>
118 * <td>The unexpected IOException while inserting or extracting data to/from
119 * the Any.</td>
120 * </tr>
121 * <tr>
122 * <td>4743000a</td>
123 * <td>1195573258 </td>
124 * <td>10</td>
125 * <td>UserException</td>
126 * <td>The unexpected UserException in the context where it cannot be handled
127 * as such and must be converted to the SystemException. </td>
128 * </tr>
129 * <tr>
130 * <td>4743000b</td>
131 * <td>1195573259</td>
132 * <td>11</td>
133 * <td>Inappropriate</td>
134 * <td>While the operation could formally be applied to the target, the OMG
135 * standard states that it is actually not applicable. For example, some CORBA
136 * objects like POA are always local and should not be passed to or returned
137 * from the remote side.</td>
138 * </tr>
139 * <tr>
140 * <td>4743000c</td>
141 * <td>1195573260</td>
142 * <td>12</td>
143 * <td>Negative</td>
144 * <td>When reading data, it was discovered that size of the data structure
145 * like string, sequence or character is written as the negative number.</td>
146 * </tr>
147 * <tr>
148 * <td>4743000e</td>
149 * <td>1195573262 </td>
150 * <td>14</td>
151 * <td>Graph</td>
152 * <td>Reference to non-existing node in the data grapth while reading the
153 * value types.</td>
154 * </tr>
155 * <tr>
156 * <td>4743000f</td>
157 * <td>1195573263</td>
158 * <td>15</td>
159 * <td>Boxed</td>
160 * <td>Unexpected exception was thrown from the IDL type helper while handling
161 * the object of this type as a boxed value.</td>
162 * </tr>
163 * <tr>
164 * <td>47430010</td>
165 * <td>1195573264</td>
166 * <td>16</td>
167 * <td>Instantiation</td>
168 * <td>Unable to instantiate an value type object while reading it from the
169 * stream.</td>
170 * </tr>
171 * <tr>
172 * <td>47430011</td>
173 * <td>1195573265</td>
174 * <td>17</td>
175 * <td>ValueHeaderTag</td>
176 * <td>The header tag of the value type being read from the CDR stream contains
177 * an unexpected value outside 0x7fffff00 .. 0x7fffffff and also not null and
178 * not an indirection.</td>
179 * </tr>
180 * <tr>
181 * <td>47430012</td>
182 * <td>1195573266</td>
183 * <td>18</td>
184 * <td>ValueHeaderFlags</td>
185 * <td>The header tag flags of the value type being read from the CDR stream
186 * make the invalid combination (for instance, 0x7fffff04).</td>
187 * </tr>
188 * <tr>
189 * <td>47430013</td>
190 * <td>1195573267</td>
191 * <td>19</td>
192 * <td>ClassCast</td>
193 * <td>The value type class, written on the wire, is not compatible with the
194 * expected class, passed as a parameter to the InputStream.read_value.</td>
195 * </tr>
196 * <tr>
197 * <td>47430014</td>
198 * <td>1195573268</td>
199 * <td>20</td>
200 * <td>Offset</td>
201 * <td>Positive or otherwise invalid indirection offset when reading the data
202 * graph of the value type.</td>
203 * </tr>
204 * <tr>
205 * <td>47430015</td>
206 * <td>1195573269</td>
207 * <td>21</td>
208 * <td>Chunks</td>
209 * <td>Errors while reading the chunked value type.</td>
210 * </tr>
211 * <tr>
212 * <td>47430016</td>
213 * <td>1195573270</td>
214 * <td>22</td>
215 * <td>UnsupportedValue</td>
216 * <td>No means are provided to read or write this value type (not Streamable,
217 * not CustomMarshal, not Serializable, no factory, no helper.</td>
218 * </tr>
219 * <tr> 
220 * <td>47430017</td>
221 * <td>1195573271</td>
222 * <td>23</td>
223 * <td>Factory</td>
224 * <td>The value factory, required for the operation being invoked, is not
225 * registered with this ORB.</td>
226 * </tr>
227 * <tr>
228 * <td>47430018</td>
229 * <td>1195573272</td>
230 * <td>24</td>
231 * 
232 * <td>UnsupportedAddressing</td>
233 * <td>Unsupported object addressing method in GIOP request header.</td>
234 * </tr>
235 * <tr>
236 * <td>47430019</td>
237 * <td>1195573273</td>
238 * <td>25</td>
239 * <td>IOR</td>
240 * <td>Invalid object reference (IOR).</td>
241 * </tr>
242 * <tr>
243 * <td>4743001a</td>
244 * <td>1195573274</td>
245 * <td>26</td>
246 * <td>TargetConversion</td>
247 * <td>Problems with converting between stubs, ties, interfaces and
248 * implementations.</td>
249 * 
250 * </tr>
251 * <tr>
252 * <td>4743001b</td>
253 * <td>1195573275</td>
254 * <td>27</td>
255 * <td>ValueFields</td>
256 * <td>Problems with reading or writing the fields of the value type object
257 * </td>
258 * </tr>
259 * <tr>
260 * <td>4743001c</td>
261 * <td>1195573276</td>
262 * <td>28</td>
263 * <td>NonSerializable</td>
264 * <td>The instance of the value type, passed using RMI over IIOP, is not
265 * serializable</td>
266 * </tr>
267 * </table>
268 * 
269 * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
270 */
271public final class MARSHAL
272  extends SystemException
273  implements Serializable
274{
275  /**
276   * Use serialVersionUID for interoperability.
277   */
278  private static final long serialVersionUID = 7416408250336395546L;
279
280  /**
281   * Creates a MARSHAL with the default minor code of 0, completion state
282   * COMPLETED_NO and the given explaining message.
283   * 
284   * @param message the explaining message.
285   */
286  public MARSHAL(String message)
287  {
288    super(message, 0, CompletionStatus.COMPLETED_NO);
289  }
290
291  /**
292   * Creates MARSHAL with the default minor code of 0 and a completion state
293   * COMPLETED_NO.
294   */
295  public MARSHAL()
296  {
297    super("", 0, CompletionStatus.COMPLETED_NO);
298  }
299
300  /**
301   * Creates a MARSHAL exception with the specified minor code and completion
302   * status.
303   * 
304   * @param minor_code additional error code.
305   * @param is_completed the method completion status.
306   */
307  public MARSHAL(int minor_code, CompletionStatus is_completed)
308  {
309    super("", minor_code, is_completed);
310  }
311
312  /**
313   * Created MARSHAL exception, providing full information.
314   * 
315   * @param reason explaining message.
316   * @param minor_code additional error code (the "minor").
317   * @param is_completed the method completion status.
318   */
319  public MARSHAL(String reason, int minor_code, CompletionStatus is_completed)
320  {
321    super(reason, minor_code, is_completed);
322  }
323}