KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > iiop > AnyImpl


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  * Free SoftwareFoundation, Inc.
23  * 59 Temple Place, Suite 330
24  * Boston, MA 02111-1307 USA
25  *
26  * @author Scott Ferguson
27  */

28
29 package com.caucho.iiop;
30
31 import com.caucho.log.Log;
32 import com.caucho.util.L10N;
33
34 import org.omg.CORBA.Any JavaDoc;
35 import org.omg.CORBA.BAD_INV_ORDER JavaDoc;
36 import org.omg.CORBA.BAD_OPERATION JavaDoc;
37 import org.omg.CORBA.MARSHAL JavaDoc;
38 import org.omg.CORBA.Principal JavaDoc;
39 import org.omg.CORBA.TypeCode JavaDoc;
40 import org.omg.CORBA.portable.InputStream JavaDoc;
41 import org.omg.CORBA.portable.OutputStream JavaDoc;
42 import org.omg.CORBA.portable.Streamable JavaDoc;
43
44 import java.io.IOException JavaDoc;
45 import java.io.Serializable JavaDoc;
46 import java.math.BigDecimal JavaDoc;
47 import java.util.logging.Logger JavaDoc;
48
49 public class AnyImpl extends Any JavaDoc {
50   protected static final L10N L = new L10N(AnyImpl.class);
51   protected static final Logger JavaDoc log = Log.open(AnyImpl.class);
52
53   private TypeCode JavaDoc _type;
54
55   private Object JavaDoc _objValue;
56   
57   /**
58    * Tests for equality.
59    */

60   public boolean equal(Any JavaDoc v)
61   {
62     return this == v;
63   }
64   
65   /**
66    * Return the type.
67    */

68   public TypeCode JavaDoc type()
69   {
70     return _type;
71   }
72   
73   /**
74    * Sets the type.
75    */

76   public void type(TypeCode JavaDoc t)
77   {
78     _type = t;
79   }
80   
81   /**
82    * Reads the value.
83    */

84   public void read_value(InputStream JavaDoc is, TypeCode JavaDoc typeCode)
85     throws MARSHAL JavaDoc
86   {
87     try {
88       _type = typeCode;
89       
90       _objValue = ((TypeCodeImpl) typeCode).readValue((IiopReader) is);
91
92       log.fine("VALUE: " + _objValue);
93     } catch (IOException JavaDoc e) {
94       throw new RuntimeException JavaDoc(e);
95     }
96   }
97   
98   /**
99    * Writes the value.
100    */

101   public void write_value(OutputStream JavaDoc os)
102   {
103     throw new UnsupportedOperationException JavaDoc();
104   }
105   
106   /**
107    * Creates an output stream.
108    */

109   public OutputStream JavaDoc create_output_stream()
110   {
111     throw new UnsupportedOperationException JavaDoc();
112   }
113   
114   /**
115    * Creates an input stream.
116    */

117   public InputStream JavaDoc create_input_stream()
118   {
119     throw new UnsupportedOperationException JavaDoc();
120   }
121   
122   /**
123    * Returns a short value.
124    */

125   public short extract_short()
126     throws BAD_OPERATION JavaDoc
127   {
128     throw new UnsupportedOperationException JavaDoc();
129   }
130   
131   /**
132    * Sets a short value.
133    */

134   public void insert_short(short v)
135   {
136     throw new UnsupportedOperationException JavaDoc();
137   }
138   
139   /**
140    * Returns an unsigned short value.
141    */

142   public short extract_ushort()
143     throws BAD_OPERATION JavaDoc
144   {
145     throw new UnsupportedOperationException JavaDoc();
146   }
147   
148   /**
149    * Sets an unsigned short value.
150    */

151   public void insert_ushort(short v)
152   {
153     throw new UnsupportedOperationException JavaDoc();
154   }
155   
156   /**
157    * Returns a long value.
158    */

159   public int extract_long()
160     throws BAD_OPERATION JavaDoc
161   {
162     throw new UnsupportedOperationException JavaDoc();
163   }
164   
165   /**
166    * Sets a long value.
167    */

168   public void insert_long(int v)
169   {
170     throw new UnsupportedOperationException JavaDoc();
171   }
172   
173   /**
174    * Returns an unsigned long value.
175    */

176   public int extract_ulong()
177     throws BAD_OPERATION JavaDoc
178   {
179     throw new UnsupportedOperationException JavaDoc();
180   }
181   
182   /**
183    * Sets an unsigned long value.
184    */

185   public void insert_ulong(int v)
186   {
187     throw new UnsupportedOperationException JavaDoc();
188   }
189   
190   /**
191    * Returns a longlong value.
192    */

193   public long extract_longlong()
194     throws BAD_OPERATION JavaDoc
195   {
196     throw new UnsupportedOperationException JavaDoc();
197   }
198   
199   /**
200    * Sets a longlong value.
201    */

202   public void insert_longlong(long v)
203   {
204     throw new UnsupportedOperationException JavaDoc();
205   }
206   
207   /**
208    * Returns an unsigned longlong value.
209    */

210   public long extract_ulonglong()
211     throws BAD_OPERATION JavaDoc
212   {
213     throw new UnsupportedOperationException JavaDoc();
214   }
215   
216   /**
217    * Sets a longlong value.
218    */

219   public void insert_ulonglong(long v)
220   {
221     throw new UnsupportedOperationException JavaDoc();
222   }
223   
224   /**
225    * Returns a float value.
226    */

227   public float extract_float()
228     throws BAD_OPERATION JavaDoc
229   {
230     throw new UnsupportedOperationException JavaDoc();
231   }
232   
233   /**
234    * Sets a float value.
235    */

236   public void insert_float(float v)
237   {
238     throw new UnsupportedOperationException JavaDoc();
239   }
240   
241   /**
242    * Returns a double value.
243    */

244   public double extract_double()
245     throws BAD_OPERATION JavaDoc
246   {
247     throw new UnsupportedOperationException JavaDoc();
248   }
249   
250   /**
251    * Sets a double value.
252    */

253   public void insert_double(double v)
254   {
255     throw new UnsupportedOperationException JavaDoc();
256   }
257   
258   /**
259    * Returns a boolean value.
260    */

261   public boolean extract_boolean()
262     throws BAD_OPERATION JavaDoc
263   {
264     throw new UnsupportedOperationException JavaDoc();
265   }
266   
267   /**
268    * Sets a boolean value.
269    */

270   public void insert_boolean(boolean v)
271   {
272     throw new UnsupportedOperationException JavaDoc();
273   }
274   
275   /**
276    * Returns a char value.
277    */

278   public char extract_char()
279     throws BAD_OPERATION JavaDoc
280   {
281     throw new UnsupportedOperationException JavaDoc();
282   }
283   
284   /**
285    * Sets a char value.
286    */

287   public void insert_char(char v)
288   {
289     throw new UnsupportedOperationException JavaDoc();
290   }
291   
292   /**
293    * Returns a char value.
294    */

295   public char extract_wchar()
296     throws BAD_OPERATION JavaDoc
297   {
298     throw new UnsupportedOperationException JavaDoc();
299   }
300   
301   /**
302    * Sets a char value.
303    */

304   public void insert_wchar(char v)
305   {
306     throw new UnsupportedOperationException JavaDoc();
307   }
308   
309   /**
310    * Returns a byte value.
311    */

312   public byte extract_octet()
313     throws BAD_OPERATION JavaDoc
314   {
315     throw new UnsupportedOperationException JavaDoc();
316   }
317   
318   /**
319    * Sets a byte value.
320    */

321   public void insert_octet(byte v)
322   {
323     throw new UnsupportedOperationException JavaDoc();
324   }
325   
326   /**
327    * Returns a any value.
328    */

329   public Any JavaDoc extract_any()
330     throws BAD_OPERATION JavaDoc
331   {
332     throw new UnsupportedOperationException JavaDoc();
333   }
334   
335   /**
336    * Sets a any value.
337    */

338   public void insert_any(Any JavaDoc v)
339   {
340     throw new UnsupportedOperationException JavaDoc();
341   }
342   
343   /**
344    * Returns an object value.
345    */

346   public org.omg.CORBA.Object JavaDoc extract_Object()
347     throws BAD_OPERATION JavaDoc
348   {
349     throw new UnsupportedOperationException JavaDoc();
350   }
351   
352   /**
353    * Sets an object value.
354    */

355   public void insert_Object(org.omg.CORBA.Object JavaDoc v)
356   {
357     throw new UnsupportedOperationException JavaDoc();
358   }
359   
360   /**
361    * Sets an object value.
362    */

363   public void insert_Object(org.omg.CORBA.Object JavaDoc v, TypeCode JavaDoc t)
364   {
365     throw new UnsupportedOperationException JavaDoc();
366   }
367   
368   /**
369    * Returns a value.
370    */

371   public Serializable JavaDoc extract_Value()
372     throws BAD_OPERATION JavaDoc
373   {
374     log.fine("EXTRACT: " + _objValue);
375     
376     return (Serializable JavaDoc) _objValue;
377   }
378   
379   /**
380    * Sets a value.
381    */

382   public void insert_Value(Serializable JavaDoc v)
383   {
384     _objValue = v;
385   }
386   
387   /**
388    * Sets a value.
389    */

390   public void insert_Value(Serializable JavaDoc v, TypeCode JavaDoc t)
391     throws MARSHAL JavaDoc
392   {
393     throw new UnsupportedOperationException JavaDoc();
394   }
395   
396   /**
397    * Returns a string value.
398    */

399   public String JavaDoc extract_string()
400     throws BAD_OPERATION JavaDoc
401   {
402     throw new UnsupportedOperationException JavaDoc();
403   }
404   
405   /**
406    * Sets a string value.
407    */

408   public void insert_string(String JavaDoc v)
409   {
410     throw new UnsupportedOperationException JavaDoc();
411   }
412   
413   /**
414    * Returns a string value.
415    */

416   public String JavaDoc extract_wstring()
417     throws BAD_OPERATION JavaDoc
418   {
419     throw new UnsupportedOperationException JavaDoc();
420   }
421   
422   /**
423    * Sets a string value.
424    */

425   public void insert_wstring(String JavaDoc v)
426   {
427     throw new UnsupportedOperationException JavaDoc();
428   }
429   
430   /**
431    * Returns a TypeCode value.
432    */

433   public TypeCode JavaDoc extract_TypeCode()
434     throws BAD_OPERATION JavaDoc
435   {
436     throw new UnsupportedOperationException JavaDoc();
437   }
438   
439   /**
440    * Sets a TypeCode value.
441    */

442   public void insert_TypeCode(TypeCode JavaDoc v)
443   {
444     throw new UnsupportedOperationException JavaDoc();
445   }
446   
447   /**
448    * Returns a Principal value.
449    */

450   public Principal JavaDoc extract_Principal()
451     throws BAD_OPERATION JavaDoc
452   {
453     throw new UnsupportedOperationException JavaDoc();
454   }
455   
456   /**
457    * Sets a Principal value.
458    */

459   public void insert_Principal(Principal JavaDoc v)
460   {
461     throw new UnsupportedOperationException JavaDoc();
462   }
463   
464   /**
465    * Returns a Streamable value.
466    */

467   public Streamable JavaDoc extract_Streamable()
468     throws BAD_INV_ORDER JavaDoc
469   {
470     throw new UnsupportedOperationException JavaDoc();
471   }
472   
473   /**
474    * Sets a Streamable value.
475    */

476   public void insert_Streamable(Streamable JavaDoc v)
477   {
478     throw new UnsupportedOperationException JavaDoc();
479   }
480   
481   /**
482    * Returns a fixed value.
483    */

484   public BigDecimal JavaDoc extract_fixed()
485   {
486     throw new UnsupportedOperationException JavaDoc();
487   }
488   
489   /**
490    * Sets a fixed value.
491    */

492   public void insert_fixed(BigDecimal JavaDoc v)
493   {
494     throw new UnsupportedOperationException JavaDoc();
495   }
496 }
497
Popular Tags