duke@1: /* ohair@158: * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. duke@1: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@1: * duke@1: * This code is free software; you can redistribute it and/or modify it duke@1: * under the terms of the GNU General Public License version 2 only, as ohair@158: * published by the Free Software Foundation. Oracle designates this duke@1: * particular file as subject to the "Classpath" exception as provided ohair@158: * by Oracle in the LICENSE file that accompanied this code. duke@1: * duke@1: * This code is distributed in the hope that it will be useful, but WITHOUT duke@1: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@1: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@1: * version 2 for more details (a copy is included in the LICENSE file that duke@1: * accompanied this code). duke@1: * duke@1: * You should have received a copy of the GNU General Public License version duke@1: * 2 along with this work; if not, write to the Free Software Foundation, duke@1: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@1: * ohair@158: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@158: * or visit www.oracle.com if you need additional information or have any ohair@158: * questions. duke@1: */ duke@1: duke@1: package org.omg.PortableServer; duke@1: duke@1: duke@1: /** duke@1: * org/omg/PortableServer/CurrentHelper.java . duke@1: * Generated by the IDL-to-Java compiler (portable), version "3.1" duke@1: * from ../../../../src/share/classes/org/omg/PortableServer/poa.idl duke@1: * Tuesday, October 23, 2001 1:17:01 PM PDT duke@1: */ duke@1: duke@1: duke@1: /** duke@1: * The PortableServer::Current interface, derived from duke@1: * CORBA::Current, provides method implementations with duke@1: * access to the identity of the object on which the duke@1: * method was invoked. The Current interface is provided duke@1: * to support servants that implement multiple objects, duke@1: * but can be used within the context of POA-dispatched duke@1: * method invocations on any servant. To provide location duke@1: * transparency, ORBs are required to support use of duke@1: * Current in the context of both locally and remotely duke@1: * invoked operations. An instance of Current can be duke@1: * obtained by the application by issuing the duke@1: * CORBA::ORB::resolve_initial_references("POACurrent") duke@1: * operation. Thereafter, it can be used within the duke@1: * context of a method dispatched by the POA to obtain duke@1: * the POA and ObjectId that identify the object on duke@1: * which that operation was invoked. duke@1: */ duke@1: abstract public class CurrentHelper duke@1: { duke@1: private static String _id = "IDL:omg.org/PortableServer/Current:2.3"; duke@1: duke@1: public static void insert (org.omg.CORBA.Any a, duke@1: org.omg.PortableServer.Current that) duke@1: { duke@1: org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); duke@1: a.type (type ()); duke@1: write (out, that); duke@1: a.read_value (out.create_input_stream (), type ()); duke@1: } duke@1: duke@1: public static org.omg.PortableServer.Current extract (org.omg.CORBA.Any a) duke@1: { duke@1: return read (a.create_input_stream ()); duke@1: } duke@1: duke@1: private static org.omg.CORBA.TypeCode __typeCode = null; duke@1: synchronized public static org.omg.CORBA.TypeCode type () duke@1: { duke@1: if (__typeCode == null) duke@1: { duke@1: __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc ( duke@1: org.omg.PortableServer.CurrentHelper.id (), "Current"); duke@1: } duke@1: return __typeCode; duke@1: } duke@1: duke@1: public static String id () duke@1: { duke@1: return _id; duke@1: } duke@1: duke@1: public static org.omg.PortableServer.Current read ( duke@1: org.omg.CORBA.portable.InputStream istream) duke@1: { duke@1: throw new org.omg.CORBA.MARSHAL (); duke@1: } duke@1: duke@1: public static void write (org.omg.CORBA.portable.OutputStream ostream, duke@1: org.omg.PortableServer.Current value) duke@1: { duke@1: throw new org.omg.CORBA.MARSHAL (); duke@1: } duke@1: duke@1: public static org.omg.PortableServer.Current narrow ( duke@1: org.omg.CORBA.Object obj) duke@1: { duke@1: if (obj == null) duke@1: return null; duke@1: else if (obj instanceof org.omg.PortableServer.Current) duke@1: return (org.omg.PortableServer.Current)obj; duke@1: else if (!obj._is_a (id ())) duke@1: throw new org.omg.CORBA.BAD_PARAM (); duke@1: return null; duke@1: } duke@1: duke@1: }