001 package org.omg.CORBA; 002 003 004 /** 005 * org/omg/CORBA/CurrentHelper.java . 006 * Generated by the IDL-to-Java compiler (portable), version "3.2" 007 * from /home/iurt/rpm/BUILD/geronimo-spec-corba/src/main/idl/geronimo-orb.idl 008 * Saturday, November 26, 2011 9:53:35 PM UTC 009 */ 010 011 012 // actually, Current is pseudo, but we need it this way so everything compiles 013 abstract public class CurrentHelper 014 { 015 private static String _id = "IDL:CORBA/Current:1.0"; 016 017 public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.Current that) 018 { 019 org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); 020 a.type (type ()); 021 write (out, that); 022 a.read_value (out.create_input_stream (), type ()); 023 } 024 025 public static org.omg.CORBA.Current extract (org.omg.CORBA.Any a) 026 { 027 return read (a.create_input_stream ()); 028 } 029 030 private static org.omg.CORBA.TypeCode __typeCode = null; 031 synchronized public static org.omg.CORBA.TypeCode type () 032 { 033 if (__typeCode == null) 034 { 035 __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.CORBA.CurrentHelper.id (), "Current"); 036 } 037 return __typeCode; 038 } 039 040 public static String id () 041 { 042 return _id; 043 } 044 045 public static org.omg.CORBA.Current read (org.omg.CORBA.portable.InputStream istream) 046 { 047 return narrow (istream.read_Object (_CurrentStub.class)); 048 } 049 050 public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.Current value) 051 { 052 ostream.write_Object ((org.omg.CORBA.Object) value); 053 } 054 055 public static org.omg.CORBA.Current narrow (org.omg.CORBA.Object obj) 056 { 057 if (obj == null) 058 return null; 059 else if (obj instanceof org.omg.CORBA.Current) 060 return (org.omg.CORBA.Current)obj; 061 else if (!obj._is_a (id ())) 062 throw new org.omg.CORBA.BAD_PARAM (); 063 else 064 { 065 org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate (); 066 org.omg.CORBA._CurrentStub stub = new org.omg.CORBA._CurrentStub (); 067 stub._set_delegate(delegate); 068 return stub; 069 } 070 } 071 072 public static org.omg.CORBA.Current unchecked_narrow (org.omg.CORBA.Object obj) 073 { 074 if (obj == null) 075 return null; 076 else if (obj instanceof org.omg.CORBA.Current) 077 return (org.omg.CORBA.Current)obj; 078 else 079 { 080 org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate (); 081 org.omg.CORBA._CurrentStub stub = new org.omg.CORBA._CurrentStub (); 082 stub._set_delegate(delegate); 083 return stub; 084 } 085 } 086 087 }