KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > omg > PortableServer > POAHelper


1 /*
2  * @(#)POAHelper.java 1.4 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package org.omg.PortableServer;
9
10 /**
11 * org/omg/PortableServer/POAHelper.java .
12 * Generated by the IDL-to-Java compiler (portable), version "3.1"
13 * from ../../../../src/share/classes/org/omg/PortableServer/poa.idl
14 * Tuesday, October 23, 2001 1:16:58 PM PDT
15 */

16
17
18 /**
19  * A POA object manages the implementation of a
20  * collection of objects. The POA supports a name space
21  * for the objects, which are identified by Object Ids.
22  * A POA also provides a name space for POAs. A POA is
23  * created as a child of an existing POA, which forms a
24  * hierarchy starting with the root POA. A POA object
25  * must not be exported to other processes, or
26  * externalized with ORB::object_to_string.
27  */

28 abstract public class POAHelper
29 {
30     private static String JavaDoc _id = "IDL:omg.org/PortableServer/POA:2.3";
31
32     public static void insert (org.omg.CORBA.Any JavaDoc a,
33         org.omg.PortableServer.POA JavaDoc that)
34     {
35         org.omg.CORBA.portable.OutputStream JavaDoc out = a.create_output_stream ();
36         a.type (type ());
37         write (out, that);
38         a.read_value (out.create_input_stream (), type ());
39     }
40
41     public static org.omg.PortableServer.POA JavaDoc extract (org.omg.CORBA.Any JavaDoc a)
42     {
43         return read (a.create_input_stream ());
44     }
45
46     private static org.omg.CORBA.TypeCode JavaDoc __typeCode = null;
47     synchronized public static org.omg.CORBA.TypeCode JavaDoc type ()
48     {
49         if (__typeCode == null)
50         {
51             __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.PortableServer.POAHelper.id (), "POA");
52         }
53         return __typeCode;
54     }
55
56     public static String JavaDoc id ()
57     {
58         return _id;
59     }
60
61     public static org.omg.PortableServer.POA JavaDoc read (
62         org.omg.CORBA.portable.InputStream JavaDoc istream)
63     {
64         throw new org.omg.CORBA.MARSHAL JavaDoc ();
65     }
66
67     public static void write (org.omg.CORBA.portable.OutputStream JavaDoc ostream,
68        org.omg.PortableServer.POA JavaDoc value)
69     {
70         throw new org.omg.CORBA.MARSHAL JavaDoc ();
71     }
72
73     public static org.omg.PortableServer.POA JavaDoc narrow (org.omg.CORBA.Object JavaDoc obj)
74     {
75        if (obj == null)
76            return null;
77        else if (obj instanceof org.omg.PortableServer.POA JavaDoc)
78            return (org.omg.PortableServer.POA JavaDoc)obj;
79        else if (!obj._is_a (id ()))
80           throw new org.omg.CORBA.BAD_PARAM JavaDoc ();
81        return null;
82     }
83 }
84
85
Popular Tags