001 package org.omg.CosTransactions; 002 003 004 /** 005 * org/omg/CosTransactions/ResourceHelper.java . 006 * Generated by the IDL-to-Java compiler (portable), version "3.2" 007 * from /builddir/build/BUILD/geronimo-specs-1.6/geronimo-spec-corba/src/main/idl/CosTransactions.idl 008 * Saturday, September 22, 2012 10:56:39 AM CEST 009 */ 010 011 abstract public class ResourceHelper 012 { 013 private static String _id = "IDL:CosTransactions/Resource:1.0"; 014 015 public static void insert (org.omg.CORBA.Any a, org.omg.CosTransactions.Resource that) 016 { 017 org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); 018 a.type (type ()); 019 write (out, that); 020 a.read_value (out.create_input_stream (), type ()); 021 } 022 023 public static org.omg.CosTransactions.Resource extract (org.omg.CORBA.Any a) 024 { 025 return read (a.create_input_stream ()); 026 } 027 028 private static org.omg.CORBA.TypeCode __typeCode = null; 029 synchronized public static org.omg.CORBA.TypeCode type () 030 { 031 if (__typeCode == null) 032 { 033 __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.CosTransactions.ResourceHelper.id (), "Resource"); 034 } 035 return __typeCode; 036 } 037 038 public static String id () 039 { 040 return _id; 041 } 042 043 public static org.omg.CosTransactions.Resource read (org.omg.CORBA.portable.InputStream istream) 044 { 045 return narrow (istream.read_Object (_ResourceStub.class)); 046 } 047 048 public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CosTransactions.Resource value) 049 { 050 ostream.write_Object ((org.omg.CORBA.Object) value); 051 } 052 053 public static org.omg.CosTransactions.Resource narrow (org.omg.CORBA.Object obj) 054 { 055 if (obj == null) 056 return null; 057 else if (obj instanceof org.omg.CosTransactions.Resource) 058 return (org.omg.CosTransactions.Resource)obj; 059 else if (!obj._is_a (id ())) 060 throw new org.omg.CORBA.BAD_PARAM (); 061 else 062 { 063 org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate (); 064 org.omg.CosTransactions._ResourceStub stub = new org.omg.CosTransactions._ResourceStub (); 065 stub._set_delegate(delegate); 066 return stub; 067 } 068 } 069 070 public static org.omg.CosTransactions.Resource unchecked_narrow (org.omg.CORBA.Object obj) 071 { 072 if (obj == null) 073 return null; 074 else if (obj instanceof org.omg.CosTransactions.Resource) 075 return (org.omg.CosTransactions.Resource)obj; 076 else 077 { 078 org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate (); 079 org.omg.CosTransactions._ResourceStub stub = new org.omg.CosTransactions._ResourceStub (); 080 stub._set_delegate(delegate); 081 return stub; 082 } 083 } 084 085 }