/[classpath]/classpath/org/omg/PortableServer/POAHelper.java
ViewVC logotype

Diff of /classpath/org/omg/PortableServer/POAHelper.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by audriusa, Fri Jul 22 16:57:47 2005 UTC revision 1.2 by audriusa, Wed Jul 27 15:58:29 2005 UTC
# Line 39  exception statement from your version. * Line 39  exception statement from your version. *
39  package org.omg.PortableServer;  package org.omg.PortableServer;
40    
41  import org.omg.CORBA.BAD_PARAM;  import org.omg.CORBA.BAD_PARAM;
42    import org.omg.CORBA.TypeCode;
43    import org.omg.CORBA.ORB;
44    import org.omg.CORBA.Any;
45    import org.omg.CORBA.portable.InputStream;
46    import org.omg.CORBA.MARSHAL;
47    import org.omg.CORBA.portable.OutputStream;
48    
49  /**  /**
50   * The helper operations for the CORBA object {@link POA}.   * The helper operations for the CORBA object {@link POA}.
# Line 48  import org.omg.CORBA.BAD_PARAM; Line 54  import org.omg.CORBA.BAD_PARAM;
54  public abstract class POAHelper  public abstract class POAHelper
55  {  {
56    /**    /**
57     * Cast the passed object into the POA. As POA is a local     * Cast the passed object into the POA. As POA is a local object, the method
58     * object, the method just uses java type cast.     * just uses java type cast.
59     *     *
60     * @param obj the object to narrow.     * @param obj the object to narrow.
61     * @return narrowed instance.     * @return narrowed instance.
# Line 66  public abstract class POAHelper Line 72  public abstract class POAHelper
72          throw new BAD_PARAM(obj.getClass().getName() + " is not a POA");          throw new BAD_PARAM(obj.getClass().getName() + " is not a POA");
73        }        }
74    }    }
75    
76      /**
77       * Get the type code of the {@link POA}.
78       */
79      public static TypeCode type()
80      {
81        return ORB.init().create_interface_tc(id(), "POA");
82      }
83    
84      /**
85       * Insert the POA into the given Any.
86       *
87       * @param any the Any to insert into.
88       *
89       * @param that the POA to insert.
90       */
91      public static void insert(Any any, POA that)
92      {
93        any.insert_Object(that);
94      }
95    
96      /**
97       * Extract the POA from given Any.
98       *
99       * @throws BAD_OPERATION if the passed Any does not contain POA.
100       */
101      public static POA extract(Any any)
102      {
103        return narrow(any.extract_Object());
104      }
105    
106      /**
107       * Get the POA repository id.
108       *
109       * @return "IDL:omg.org/PortableServer/POA:2.3", always.
110       */
111      public static String id()
112      {
113        return "IDL:omg.org/PortableServer/POA:2.3";
114      }
115    
116      /**
117       * This should read POA from the CDR input stream, but, following the specs,
118       * it doesnot. The jdk 1.5 API specification defines that POA cannot be
119       * exported.
120       *
121       * @param input a org.omg.CORBA.portable stream to read from.
122       *
123       * @specenote Sun throws the same exception.
124       *
125       * @throws MARSHAL, always.
126       */
127      public static POA read(InputStream input)
128      {
129        throw new MARSHAL("Not applicable");
130      }
131    
132      /**
133       * This should read POA from the CDR input stream, but, following the specs,
134       * it doesnot. The jdk 1.5 API specification defines that POA cannot be
135       * exported.
136       *
137       * @param input a org.omg.CORBA.portable stream to read from.
138       *
139       * @specenote Sun throws the same exception.
140       *
141       * @throws MARSHAL, always.
142       */
143      public static void write(OutputStream output, POA value)
144      {
145        throw new MARSHAL("Not applicable");
146      }
147  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26