corba/src/share/classes/org/omg/PortableServer/Servant.java
author ohair
Tue, 25 May 2010 15:52:11 -0700
changeset 5555 b2b5ed3f0d0d
parent 4 02bb8761fcce
permissions -rw-r--r--
6943119: Rebrand source copyright notices Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     1
/*
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
     2
 * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
02bb8761fcce Initial load
duke
parents:
diff changeset
     4
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
02bb8761fcce Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    10
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
02bb8761fcce Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
02bb8761fcce Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
02bb8761fcce Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
02bb8761fcce Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
02bb8761fcce Initial load
duke
parents:
diff changeset
    16
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
02bb8761fcce Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
02bb8761fcce Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
02bb8761fcce Initial load
duke
parents:
diff changeset
    20
 *
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    23
 * questions.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    24
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    25
package org.omg.PortableServer;
02bb8761fcce Initial load
duke
parents:
diff changeset
    26
02bb8761fcce Initial load
duke
parents:
diff changeset
    27
import org.omg.CORBA.ORB;
02bb8761fcce Initial load
duke
parents:
diff changeset
    28
import org.omg.PortableServer.portable.Delegate;
02bb8761fcce Initial load
duke
parents:
diff changeset
    29
02bb8761fcce Initial load
duke
parents:
diff changeset
    30
/**
02bb8761fcce Initial load
duke
parents:
diff changeset
    31
 * Defines the native <code>Servant</code> type. In Java, the
02bb8761fcce Initial load
duke
parents:
diff changeset
    32
 * <code>Servant</code> type is mapped to the Java
02bb8761fcce Initial load
duke
parents:
diff changeset
    33
 * <code>org.omg.PortableServer.Servant</code> class.
02bb8761fcce Initial load
duke
parents:
diff changeset
    34
 * It serves as the base class for all POA servant
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
 * implementations and provides a number of methods that may
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
 * be invoked by the application programmer, as well as methods
02bb8761fcce Initial load
duke
parents:
diff changeset
    37
 * which are invoked by the POA itself and may be overridden by
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
 * the user to control aspects of servant behavior.
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
 * Based on IDL to Java spec. (CORBA V2.3.1) ptc/00-01-08.pdf.
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
abstract public class Servant {
02bb8761fcce Initial load
duke
parents:
diff changeset
    43
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
    private transient Delegate _delegate = null;
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
    46
     * Gets the ORB vendor-specific implementation of
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
     * <code>PortableServer::Servant</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
     * @return <code>_delegate</code> the ORB vendor-specific
02bb8761fcce Initial load
duke
parents:
diff changeset
    49
     * implementation of <code>PortableServer::Servant</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
    50
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
    51
    final public Delegate _get_delegate() {
02bb8761fcce Initial load
duke
parents:
diff changeset
    52
        if (_delegate == null) {
02bb8761fcce Initial load
duke
parents:
diff changeset
    53
            throw
02bb8761fcce Initial load
duke
parents:
diff changeset
    54
                new
02bb8761fcce Initial load
duke
parents:
diff changeset
    55
                org.omg.CORBA.BAD_INV_ORDER
02bb8761fcce Initial load
duke
parents:
diff changeset
    56
                ("The Servant has not been associated with an ORB instance");
02bb8761fcce Initial load
duke
parents:
diff changeset
    57
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
    58
        return _delegate;
02bb8761fcce Initial load
duke
parents:
diff changeset
    59
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
    60
02bb8761fcce Initial load
duke
parents:
diff changeset
    61
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
    62
     * Supports the Java ORB portability
02bb8761fcce Initial load
duke
parents:
diff changeset
    63
     * interfaces by providing a method for classes that support
02bb8761fcce Initial load
duke
parents:
diff changeset
    64
     * ORB portability through delegation to set their delegate.
02bb8761fcce Initial load
duke
parents:
diff changeset
    65
     * @param delegate ORB vendor-specific implementation of
02bb8761fcce Initial load
duke
parents:
diff changeset
    66
     *                 the <code>PortableServer::Servant</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
    67
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
    68
    final public void _set_delegate(Delegate delegate) {
02bb8761fcce Initial load
duke
parents:
diff changeset
    69
        _delegate = delegate;
02bb8761fcce Initial load
duke
parents:
diff changeset
    70
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
    71
02bb8761fcce Initial load
duke
parents:
diff changeset
    72
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
    73
     * Allows the servant to obtain the object reference for
02bb8761fcce Initial load
duke
parents:
diff changeset
    74
     * the target CORBA object it is incarnating for that request.
02bb8761fcce Initial load
duke
parents:
diff changeset
    75
     * @return <code>this_object</code> <code>Object</code> reference
02bb8761fcce Initial load
duke
parents:
diff changeset
    76
     * associated with the request.
02bb8761fcce Initial load
duke
parents:
diff changeset
    77
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
    78
    final public org.omg.CORBA.Object _this_object() {
02bb8761fcce Initial load
duke
parents:
diff changeset
    79
        return _get_delegate().this_object(this);
02bb8761fcce Initial load
duke
parents:
diff changeset
    80
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
    81
02bb8761fcce Initial load
duke
parents:
diff changeset
    82
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
    83
     * Allows the servant to obtain the object reference for
02bb8761fcce Initial load
duke
parents:
diff changeset
    84
     * the target CORBA Object it is incarnating for that request.
02bb8761fcce Initial load
duke
parents:
diff changeset
    85
     * @param orb ORB with which the servant is associated.
02bb8761fcce Initial load
duke
parents:
diff changeset
    86
     * @return <code>_this_object</code> reference associated with the request.
02bb8761fcce Initial load
duke
parents:
diff changeset
    87
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
    88
    final public org.omg.CORBA.Object _this_object(ORB orb) {
02bb8761fcce Initial load
duke
parents:
diff changeset
    89
        try {
02bb8761fcce Initial load
duke
parents:
diff changeset
    90
            ((org.omg.CORBA_2_3.ORB)orb).set_delegate(this);
02bb8761fcce Initial load
duke
parents:
diff changeset
    91
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
    92
        catch(ClassCastException e) {
02bb8761fcce Initial load
duke
parents:
diff changeset
    93
            throw
02bb8761fcce Initial load
duke
parents:
diff changeset
    94
                new
02bb8761fcce Initial load
duke
parents:
diff changeset
    95
                org.omg.CORBA.BAD_PARAM
02bb8761fcce Initial load
duke
parents:
diff changeset
    96
                ("POA Servant requires an instance of org.omg.CORBA_2_3.ORB");
02bb8761fcce Initial load
duke
parents:
diff changeset
    97
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
    98
        return _this_object();
02bb8761fcce Initial load
duke
parents:
diff changeset
    99
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   100
02bb8761fcce Initial load
duke
parents:
diff changeset
   101
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   102
     * Returns the instance of the ORB
02bb8761fcce Initial load
duke
parents:
diff changeset
   103
     * currently associated with the <code>Servant</code> (convenience method).
02bb8761fcce Initial load
duke
parents:
diff changeset
   104
     * @return <code>orb</code> the instance of the ORB currently
02bb8761fcce Initial load
duke
parents:
diff changeset
   105
     * associated with the <code>Servant</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
   106
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   107
    final public ORB _orb() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   108
        return _get_delegate().orb(this);
02bb8761fcce Initial load
duke
parents:
diff changeset
   109
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   110
02bb8761fcce Initial load
duke
parents:
diff changeset
   111
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   112
     * Allows easy execution of common methods, equivalent to
02bb8761fcce Initial load
duke
parents:
diff changeset
   113
     * <code>PortableServer::Current:get_POA</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
   114
     * @return <code>poa</code> POA associated with the servant.
02bb8761fcce Initial load
duke
parents:
diff changeset
   115
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   116
    final public POA _poa() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   117
        return _get_delegate().poa(this);
02bb8761fcce Initial load
duke
parents:
diff changeset
   118
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   119
02bb8761fcce Initial load
duke
parents:
diff changeset
   120
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   121
     * Allows easy execution of
02bb8761fcce Initial load
duke
parents:
diff changeset
   122
     * common methods, equivalent
02bb8761fcce Initial load
duke
parents:
diff changeset
   123
     * to calling <code>PortableServer::Current::get_object_id</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
   124
     * @return <code>object_id</code> the <code>Object</code> ID associated
02bb8761fcce Initial load
duke
parents:
diff changeset
   125
     * with this servant.
02bb8761fcce Initial load
duke
parents:
diff changeset
   126
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   127
    final public byte[] _object_id() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   128
        return _get_delegate().object_id(this);
02bb8761fcce Initial load
duke
parents:
diff changeset
   129
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   130
02bb8761fcce Initial load
duke
parents:
diff changeset
   131
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   132
     * Returns the
02bb8761fcce Initial load
duke
parents:
diff changeset
   133
     * root POA from the ORB instance associated with the servant.
02bb8761fcce Initial load
duke
parents:
diff changeset
   134
     * Subclasses may override this method to return a different POA.
02bb8761fcce Initial load
duke
parents:
diff changeset
   135
     * @return <code>default_POA</code> the POA associated with the
02bb8761fcce Initial load
duke
parents:
diff changeset
   136
     * <code>Servant</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
   137
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   138
    public POA _default_POA() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   139
        return _get_delegate().default_POA(this);
02bb8761fcce Initial load
duke
parents:
diff changeset
   140
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   141
02bb8761fcce Initial load
duke
parents:
diff changeset
   142
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   143
     * Checks to see if the specified <code>repository_id</code> is present
02bb8761fcce Initial load
duke
parents:
diff changeset
   144
     * on the list returned by <code>_all_interfaces()</code> or is the
02bb8761fcce Initial load
duke
parents:
diff changeset
   145
     * <code>repository_id</code> for the generic CORBA Object.
02bb8761fcce Initial load
duke
parents:
diff changeset
   146
     * @param repository_id the <code>repository_id</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
   147
     *          to be checked in the repository list or against the id
02bb8761fcce Initial load
duke
parents:
diff changeset
   148
     *          of generic CORBA objects.
02bb8761fcce Initial load
duke
parents:
diff changeset
   149
     * @return <code>is_a</code> boolean indicating whether the specified
02bb8761fcce Initial load
duke
parents:
diff changeset
   150
     *          <code>repository_id</code> is
02bb8761fcce Initial load
duke
parents:
diff changeset
   151
     *         in the repository list or is same as a generic CORBA
02bb8761fcce Initial load
duke
parents:
diff changeset
   152
     *         object.
02bb8761fcce Initial load
duke
parents:
diff changeset
   153
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   154
    public boolean _is_a(String repository_id) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   155
        return _get_delegate().is_a(this, repository_id);
02bb8761fcce Initial load
duke
parents:
diff changeset
   156
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   157
02bb8761fcce Initial load
duke
parents:
diff changeset
   158
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   159
     * Checks for the existence of an
02bb8761fcce Initial load
duke
parents:
diff changeset
   160
     * <code>Object</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
   161
     * The <code>Servant</code> provides a default implementation of
02bb8761fcce Initial load
duke
parents:
diff changeset
   162
     * <code>_non_existent()</code> that can be overridden by derived servants.
02bb8761fcce Initial load
duke
parents:
diff changeset
   163
     * @return <code>non_existent</code> <code>true</code> if that object does
02bb8761fcce Initial load
duke
parents:
diff changeset
   164
     *           not exist,  <code>false</code> otherwise.
02bb8761fcce Initial load
duke
parents:
diff changeset
   165
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   166
    public boolean _non_existent() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   167
        return _get_delegate().non_existent(this);
02bb8761fcce Initial load
duke
parents:
diff changeset
   168
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   169
02bb8761fcce Initial load
duke
parents:
diff changeset
   170
    // Ken and Simon will ask about editorial changes
02bb8761fcce Initial load
duke
parents:
diff changeset
   171
    // needed in IDL to Java mapping to the following
02bb8761fcce Initial load
duke
parents:
diff changeset
   172
    // signature.
02bb8761fcce Initial load
duke
parents:
diff changeset
   173
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   174
     * Returns an object in the Interface Repository
02bb8761fcce Initial load
duke
parents:
diff changeset
   175
     * which provides type information that may be useful to a program.
02bb8761fcce Initial load
duke
parents:
diff changeset
   176
     * <code>Servant</code> provides a default implementation of
02bb8761fcce Initial load
duke
parents:
diff changeset
   177
     * <code>_get_interface()</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
   178
     * that can be overridden by derived servants if the default
02bb8761fcce Initial load
duke
parents:
diff changeset
   179
     * behavior is not adequate.
02bb8761fcce Initial load
duke
parents:
diff changeset
   180
     * @return <code>get_interface</code> type information that corresponds to this servant.
02bb8761fcce Initial load
duke
parents:
diff changeset
   181
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   182
    /*
02bb8761fcce Initial load
duke
parents:
diff changeset
   183
    public org.omg.CORBA.Object _get_interface() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   184
        return _get_delegate().get_interface(this);
02bb8761fcce Initial load
duke
parents:
diff changeset
   185
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   186
    */
02bb8761fcce Initial load
duke
parents:
diff changeset
   187
02bb8761fcce Initial load
duke
parents:
diff changeset
   188
    // _get_interface_def() replaces the _get_interface() method
02bb8761fcce Initial load
duke
parents:
diff changeset
   189
02bb8761fcce Initial load
duke
parents:
diff changeset
   190
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   191
     * Returns an <code>InterfaceDef</code> object as a
02bb8761fcce Initial load
duke
parents:
diff changeset
   192
     * <code>CORBA::Object</code> that defines the runtime type of the
02bb8761fcce Initial load
duke
parents:
diff changeset
   193
     * <code>CORBA::Object</code> implemented by the <code>Servant</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
   194
     * The invoker of <code>_get_interface_def</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
   195
     * must narrow the result to an <code>InterfaceDef</code> in order
02bb8761fcce Initial load
duke
parents:
diff changeset
   196
     * to use it.
02bb8761fcce Initial load
duke
parents:
diff changeset
   197
     * <P>This default implementation of <code>_get_interface_def()</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
   198
     * can be overridden
02bb8761fcce Initial load
duke
parents:
diff changeset
   199
     * by derived servants if the default behavior is not adequate.
02bb8761fcce Initial load
duke
parents:
diff changeset
   200
     * As defined in the CORBA 2.3.1 specification, section 11.3.1, the
02bb8761fcce Initial load
duke
parents:
diff changeset
   201
     * default behavior of <code>_get_interface_def()</code> is to use
02bb8761fcce Initial load
duke
parents:
diff changeset
   202
     * the most derived
02bb8761fcce Initial load
duke
parents:
diff changeset
   203
     * interface of a static servant or the most derived interface retrieved
02bb8761fcce Initial load
duke
parents:
diff changeset
   204
     * from a dynamic servant to obtain the <code>InterfaceDef</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
   205
     * This behavior must
02bb8761fcce Initial load
duke
parents:
diff changeset
   206
     * be supported by the <code>Delegate</code> that implements the
02bb8761fcce Initial load
duke
parents:
diff changeset
   207
     * <code>Servant</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
   208
     * @return <code>get_interface_def</code> an <code>InterfaceDef</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
   209
     * object as a
02bb8761fcce Initial load
duke
parents:
diff changeset
   210
     * <code>CORBA::Object</code> that defines the runtime type of the
02bb8761fcce Initial load
duke
parents:
diff changeset
   211
     * <code>CORBA::Object</code> implemented by the <code>Servant</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
   212
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   213
    public org.omg.CORBA.Object _get_interface_def()
02bb8761fcce Initial load
duke
parents:
diff changeset
   214
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   215
        // First try to call the delegate implementation class's
02bb8761fcce Initial load
duke
parents:
diff changeset
   216
        // "Object get_interface_def(..)" method (will work for ORBs
02bb8761fcce Initial load
duke
parents:
diff changeset
   217
        // whose delegates implement this method).
02bb8761fcce Initial load
duke
parents:
diff changeset
   218
        // Else call the delegate implementation class's
02bb8761fcce Initial load
duke
parents:
diff changeset
   219
        // "InterfaceDef get_interface(..)" method using reflection
02bb8761fcce Initial load
duke
parents:
diff changeset
   220
        // (will work for ORBs that were built using an older version
02bb8761fcce Initial load
duke
parents:
diff changeset
   221
        // of the Delegate interface with a get_interface method
02bb8761fcce Initial load
duke
parents:
diff changeset
   222
        // but not a get_interface_def method).
02bb8761fcce Initial load
duke
parents:
diff changeset
   223
02bb8761fcce Initial load
duke
parents:
diff changeset
   224
        org.omg.PortableServer.portable.Delegate delegate = _get_delegate();
02bb8761fcce Initial load
duke
parents:
diff changeset
   225
        try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   226
            // If the ORB's delegate class does not implement
02bb8761fcce Initial load
duke
parents:
diff changeset
   227
            // "Object get_interface_def(..)", this will throw
02bb8761fcce Initial load
duke
parents:
diff changeset
   228
            // an AbstractMethodError.
02bb8761fcce Initial load
duke
parents:
diff changeset
   229
            return delegate.get_interface_def(this);
02bb8761fcce Initial load
duke
parents:
diff changeset
   230
        } catch( AbstractMethodError aex ) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   231
            // Call "InterfaceDef get_interface(..)" method using reflection.
02bb8761fcce Initial load
duke
parents:
diff changeset
   232
            try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   233
                Class[] argc = { org.omg.PortableServer.Servant.class };
02bb8761fcce Initial load
duke
parents:
diff changeset
   234
                java.lang.reflect.Method meth =
02bb8761fcce Initial load
duke
parents:
diff changeset
   235
                     delegate.getClass().getMethod("get_interface", argc);
02bb8761fcce Initial load
duke
parents:
diff changeset
   236
                Object[] argx = { this };
02bb8761fcce Initial load
duke
parents:
diff changeset
   237
                return (org.omg.CORBA.Object)meth.invoke(delegate, argx);
02bb8761fcce Initial load
duke
parents:
diff changeset
   238
            } catch( java.lang.reflect.InvocationTargetException exs ) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   239
                Throwable t = exs.getTargetException();
02bb8761fcce Initial load
duke
parents:
diff changeset
   240
                if (t instanceof Error) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   241
                    throw (Error) t;
02bb8761fcce Initial load
duke
parents:
diff changeset
   242
                } else if (t instanceof RuntimeException) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   243
                    throw (RuntimeException) t;
02bb8761fcce Initial load
duke
parents:
diff changeset
   244
                } else {
02bb8761fcce Initial load
duke
parents:
diff changeset
   245
                    throw new org.omg.CORBA.NO_IMPLEMENT();
02bb8761fcce Initial load
duke
parents:
diff changeset
   246
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   247
            } catch( RuntimeException rex ) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   248
                throw rex;
02bb8761fcce Initial load
duke
parents:
diff changeset
   249
            } catch( Exception exr ) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   250
                throw new org.omg.CORBA.NO_IMPLEMENT();
02bb8761fcce Initial load
duke
parents:
diff changeset
   251
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   252
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   253
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   254
02bb8761fcce Initial load
duke
parents:
diff changeset
   255
    // methods for which the user must provide an
02bb8761fcce Initial load
duke
parents:
diff changeset
   256
    // implementation
02bb8761fcce Initial load
duke
parents:
diff changeset
   257
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   258
     * Used by the ORB to obtain complete type
02bb8761fcce Initial load
duke
parents:
diff changeset
   259
     * information from the servant.
02bb8761fcce Initial load
duke
parents:
diff changeset
   260
     * @param poa POA with which the servant is associated.
02bb8761fcce Initial load
duke
parents:
diff changeset
   261
     * @param objectId is the id corresponding to the object
02bb8761fcce Initial load
duke
parents:
diff changeset
   262
     *         associated with this servant.
02bb8761fcce Initial load
duke
parents:
diff changeset
   263
     * @return list of type information for the object.
02bb8761fcce Initial load
duke
parents:
diff changeset
   264
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   265
    abstract public String[] _all_interfaces( POA poa, byte[] objectId);
02bb8761fcce Initial load
duke
parents:
diff changeset
   266
}