1 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 ; 35 import org.omg.CORBA.BAD_INV_ORDER ; 36 import org.omg.CORBA.BAD_OPERATION ; 37 import org.omg.CORBA.MARSHAL ; 38 import org.omg.CORBA.Principal ; 39 import org.omg.CORBA.TypeCode ; 40 import org.omg.CORBA.portable.InputStream ; 41 import org.omg.CORBA.portable.OutputStream ; 42 import org.omg.CORBA.portable.Streamable ; 43 44 import java.io.IOException ; 45 import java.io.Serializable ; 46 import java.math.BigDecimal ; 47 import java.util.logging.Logger ; 48 49 public class AnyImpl extends Any { 50 protected static final L10N L = new L10N(AnyImpl.class); 51 protected static final Logger log = Log.open(AnyImpl.class); 52 53 private TypeCode _type; 54 55 private Object _objValue; 56 57 60 public boolean equal(Any v) 61 { 62 return this == v; 63 } 64 65 68 public TypeCode type() 69 { 70 return _type; 71 } 72 73 76 public void type(TypeCode t) 77 { 78 _type = t; 79 } 80 81 84 public void read_value(InputStream is, TypeCode typeCode) 85 throws MARSHAL 86 { 87 try { 88 _type = typeCode; 89 90 _objValue = ((TypeCodeImpl) typeCode).readValue((IiopReader) is); 91 92 log.fine("VALUE: " + _objValue); 93 } catch (IOException e) { 94 throw new RuntimeException (e); 95 } 96 } 97 98 101 public void write_value(OutputStream os) 102 { 103 throw new UnsupportedOperationException (); 104 } 105 106 109 public OutputStream create_output_stream() 110 { 111 throw new UnsupportedOperationException (); 112 } 113 114 117 public InputStream create_input_stream() 118 { 119 throw new UnsupportedOperationException (); 120 } 121 122 125 public short extract_short() 126 throws BAD_OPERATION 127 { 128 throw new UnsupportedOperationException (); 129 } 130 131 134 public void insert_short(short v) 135 { 136 throw new UnsupportedOperationException (); 137 } 138 139 142 public short extract_ushort() 143 throws BAD_OPERATION 144 { 145 throw new UnsupportedOperationException (); 146 } 147 148 151 public void insert_ushort(short v) 152 { 153 throw new UnsupportedOperationException (); 154 } 155 156 159 public int extract_long() 160 throws BAD_OPERATION 161 { 162 throw new UnsupportedOperationException (); 163 } 164 165 168 public void insert_long(int v) 169 { 170 throw new UnsupportedOperationException (); 171 } 172 173 176 public int extract_ulong() 177 throws BAD_OPERATION 178 { 179 throw new UnsupportedOperationException (); 180 } 181 182 185 public void insert_ulong(int v) 186 { 187 throw new UnsupportedOperationException (); 188 } 189 190 193 public long extract_longlong() 194 throws BAD_OPERATION 195 { 196 throw new UnsupportedOperationException (); 197 } 198 199 202 public void insert_longlong(long v) 203 { 204 throw new UnsupportedOperationException (); 205 } 206 207 210 public long extract_ulonglong() 211 throws BAD_OPERATION 212 { 213 throw new UnsupportedOperationException (); 214 } 215 216 219 public void insert_ulonglong(long v) 220 { 221 throw new UnsupportedOperationException (); 222 } 223 224 227 public float extract_float() 228 throws BAD_OPERATION 229 { 230 throw new UnsupportedOperationException (); 231 } 232 233 236 public void insert_float(float v) 237 { 238 throw new UnsupportedOperationException (); 239 } 240 241 244 public double extract_double() 245 throws BAD_OPERATION 246 { 247 throw new UnsupportedOperationException (); 248 } 249 250 253 public void insert_double(double v) 254 { 255 throw new UnsupportedOperationException (); 256 } 257 258 261 public boolean extract_boolean() 262 throws BAD_OPERATION 263 { 264 throw new UnsupportedOperationException (); 265 } 266 267 270 public void insert_boolean(boolean v) 271 { 272 throw new UnsupportedOperationException (); 273 } 274 275 278 public char extract_char() 279 throws BAD_OPERATION 280 { 281 throw new UnsupportedOperationException (); 282 } 283 284 287 public void insert_char(char v) 288 { 289 throw new UnsupportedOperationException (); 290 } 291 292 295 public char extract_wchar() 296 throws BAD_OPERATION 297 { 298 throw new UnsupportedOperationException (); 299 } 300 301 304 public void insert_wchar(char v) 305 { 306 throw new UnsupportedOperationException (); 307 } 308 309 312 public byte extract_octet() 313 throws BAD_OPERATION 314 { 315 throw new UnsupportedOperationException (); 316 } 317 318 321 public void insert_octet(byte v) 322 { 323 throw new UnsupportedOperationException (); 324 } 325 326 329 public Any extract_any() 330 throws BAD_OPERATION 331 { 332 throw new UnsupportedOperationException (); 333 } 334 335 338 public void insert_any(Any v) 339 { 340 throw new UnsupportedOperationException (); 341 } 342 343 346 public org.omg.CORBA.Object extract_Object() 347 throws BAD_OPERATION 348 { 349 throw new UnsupportedOperationException (); 350 } 351 352 355 public void insert_Object(org.omg.CORBA.Object v) 356 { 357 throw new UnsupportedOperationException (); 358 } 359 360 363 public void insert_Object(org.omg.CORBA.Object v, TypeCode t) 364 { 365 throw new UnsupportedOperationException (); 366 } 367 368 371 public Serializable extract_Value() 372 throws BAD_OPERATION 373 { 374 log.fine("EXTRACT: " + _objValue); 375 376 return (Serializable ) _objValue; 377 } 378 379 382 public void insert_Value(Serializable v) 383 { 384 _objValue = v; 385 } 386 387 390 public void insert_Value(Serializable v, TypeCode t) 391 throws MARSHAL 392 { 393 throw new UnsupportedOperationException (); 394 } 395 396 399 public String extract_string() 400 throws BAD_OPERATION 401 { 402 throw new UnsupportedOperationException (); 403 } 404 405 408 public void insert_string(String v) 409 { 410 throw new UnsupportedOperationException (); 411 } 412 413 416 public String extract_wstring() 417 throws BAD_OPERATION 418 { 419 throw new UnsupportedOperationException (); 420 } 421 422 425 public void insert_wstring(String v) 426 { 427 throw new UnsupportedOperationException (); 428 } 429 430 433 public TypeCode extract_TypeCode() 434 throws BAD_OPERATION 435 { 436 throw new UnsupportedOperationException (); 437 } 438 439 442 public void insert_TypeCode(TypeCode v) 443 { 444 throw new UnsupportedOperationException (); 445 } 446 447 450 public Principal extract_Principal() 451 throws BAD_OPERATION 452 { 453 throw new UnsupportedOperationException (); 454 } 455 456 459 public void insert_Principal(Principal v) 460 { 461 throw new UnsupportedOperationException (); 462 } 463 464 467 public Streamable extract_Streamable() 468 throws BAD_INV_ORDER 469 { 470 throw new UnsupportedOperationException (); 471 } 472 473 476 public void insert_Streamable(Streamable v) 477 { 478 throw new UnsupportedOperationException (); 479 } 480 481 484 public BigDecimal extract_fixed() 485 { 486 throw new UnsupportedOperationException (); 487 } 488 489 492 public void insert_fixed(BigDecimal v) 493 { 494 throw new UnsupportedOperationException (); 495 } 496 } 497 | Popular Tags |