PolicyTypeHelper.java revision 608:7e06bf1dcb09
194380Sdfr/* 294380Sdfr * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. 394380Sdfr * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 494380Sdfr * 594380Sdfr * This code is free software; you can redistribute it and/or modify it 694380Sdfr * under the terms of the GNU General Public License version 2 only, as 794380Sdfr * published by the Free Software Foundation. Oracle designates this 8119332Speter * particular file as subject to the "Classpath" exception as provided 9119332Speter * by Oracle in the LICENSE file that accompanied this code. 1094380Sdfr * 1194380Sdfr * This code is distributed in the hope that it will be useful, but WITHOUT 1294380Sdfr * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13177613Sjhb * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14227776Slstewart * version 2 for more details (a copy is included in the LICENSE file that 15164199Sru * accompanied this code). 16113989Sjhb * 17255658Sjilles * You should have received a copy of the GNU General Public License version 18113989Sjhb * 2 along with this work; if not, write to the Free Software Foundation, 19161330Sjhb * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20161330Sjhb * 2194380Sdfr * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2294380Sdfr * or visit www.oracle.com if you need additional information or have any 2394380Sdfr * questions. 2494380Sdfr */ 2594380Sdfrpackage org.omg.CORBA; 2694380Sdfr 2794380Sdfr 2894380Sdfr/** 2994380Sdfr* The Helper for <tt>PolicyType</tt>. For more information on 3094380Sdfr* Helper files, see <a href="doc-files/generatedfiles.html#helper"> 3194380Sdfr* "Generated Files: Helper Files"</a>.<P> 3294380Sdfr* org/omg/CORBA/PolicyTypeHelper.java 3394380Sdfr* Generated by the IDL-to-Java compiler (portable), version "3.0" 3494380Sdfr* from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl 3594380Sdfr* Saturday, July 17, 1999 12:26:20 AM PDT 36232449Sjmallett*/ 37205014Snwhitehorn 38205014Snwhitehorn 39119332Speter// basic Policy definition 4094380Sdfrabstract public class PolicyTypeHelper 4194380Sdfr{ 4294380Sdfr private static String _id = "IDL:omg.org/CORBA/PolicyType:1.0"; 43100385Speter 4494380Sdfr public static void insert (org.omg.CORBA.Any a, int that) 45151360Sps { 46151360Sps org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); 47151360Sps a.type (type ()); 48151360Sps write (out, that); 49151360Sps a.read_value (out.create_input_stream (), type ()); 50151360Sps } 51151360Sps 52151360Sps public static int extract (org.omg.CORBA.Any a) 53151360Sps { 54151360Sps return read (a.create_input_stream ()); 55151360Sps } 56151360Sps 57236027Sed private static org.omg.CORBA.TypeCode __typeCode = null; 58236027Sed synchronized public static org.omg.CORBA.TypeCode type () 59151360Sps { 60236027Sed if (__typeCode == null) 61236027Sed { 62151360Sps __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulong); 63302095Sbrooks __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.PolicyTypeHelper.id (), "PolicyType", __typeCode); 64302095Sbrooks } 65302095Sbrooks return __typeCode; 66151721Speter } 67151583Sps 68151583Sps public static String id () 69119332Speter { 70100385Speter return _id; 71100385Speter } 7294380Sdfr 73183271Sobrien public static int read (org.omg.CORBA.portable.InputStream istream) 74183271Sobrien { 75183271Sobrien int value = (int)0; 76183271Sobrien value = istream.read_ulong (); 77183271Sobrien return value; 78119332Speter } 7994380Sdfr 80236027Sed public static void write (org.omg.CORBA.portable.OutputStream ostream, int value) 81236027Sed { 8294380Sdfr ostream.write_ulong (value); 83226349Smarcel } 84226349Smarcel 85226349Smarcel} 86226349Smarcel