jdk/src/share/classes/java/rmi/server/UnicastRemoteObject.java
author henryjen
Tue, 10 Jun 2014 16:18:54 -0700
changeset 24865 09b1d992ca72
parent 21421 aadfbd8b351b
permissions -rw-r--r--
8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo Reviewed-by: mduigou, lancea, alanb, mullan
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
19201
80230405e311 8020854: change RMI javadocs to specify that remote objects are exported to the wildcard address
smarks
parents: 5506
diff changeset
     2
 * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
package java.rmi.server;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
import java.rmi.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import sun.rmi.server.UnicastServerRef;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import sun.rmi.server.UnicastServerRef2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * Used for exporting a remote object with JRMP and obtaining a stub
21421
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    33
 * that communicates to the remote object. Stubs are either generated
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    34
 * at runtime using dynamic proxy objects, or they are generated statically
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    35
 * at build time, typically using the {@code rmic} tool.
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    36
 *
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    37
 * <p><strong>Deprecated: Static Stubs.</strong> <em>Support for statically
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    38
 * generated stubs is deprecated. This includes the API in this class that
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    39
 * requires the use of static stubs, as well as the runtime support for
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    40
 * loading static stubs.  Generating stubs dynamically is preferred, using one
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    41
 * of the five non-deprecated ways of exporting objects as listed below. Do
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    42
 * not run {@code rmic} to generate static stub classes. It is unnecessary, and
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    43
 * it is also deprecated.</em>
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    44
 *
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    45
 * <p>There are six ways to export remote objects:
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    46
 *
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    47
 * <ol>
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    48
 *
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    49
 * <li>Subclassing {@code UnicastRemoteObject} and calling the
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    50
 * {@link #UnicastRemoteObject()} constructor.
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    51
 *
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    52
 * <li>Subclassing {@code UnicastRemoteObject} and calling the
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    53
 * {@link #UnicastRemoteObject(int) UnicastRemoteObject(port)} constructor.
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    54
 *
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    55
 * <li>Subclassing {@code UnicastRemoteObject} and calling the
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    56
 * {@link #UnicastRemoteObject(int, RMIClientSocketFactory, RMIServerSocketFactory)
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    57
 * UnicastRemoteObject(port, csf, ssf)} constructor.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 *
21421
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    59
 * <li>Calling the
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    60
 * {@link #exportObject(Remote) exportObject(Remote)} method.
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    61
 * <strong>Deprecated.</strong>
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    62
 *
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    63
 * <li>Calling the
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    64
 * {@link #exportObject(Remote, int) exportObject(Remote, port)} method.
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    65
 *
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    66
 * <li>Calling the
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    67
 * {@link #exportObject(Remote, int, RMIClientSocketFactory, RMIServerSocketFactory)
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    68
 * exportObject(Remote, port, csf, ssf)} method.
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    69
 *
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    70
 * </ol>
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    71
 *
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    72
 * <p>The fourth technique, {@link #exportObject(Remote)},
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    73
 * always uses statically generated stubs and is deprecated.
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    74
 *
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    75
 * <p>The other five techniques all use the following approach: if the
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    76
 * {@code java.rmi.server.ignoreStubClasses} property is {@code true}
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    77
 * (case insensitive) or if a static stub cannot be found, stubs are generated
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    78
 * dynamically using {@link java.lang.reflect.Proxy Proxy} objects. Otherwise,
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    79
 * static stubs are used.
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    80
 *
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    81
 * <p>The default value of the
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    82
 * {@code java.rmi.server.ignoreStubClasses} property is {@code false}.
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    83
 *
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    84
 * <p>Statically generated stubs are typically pregenerated from the
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    85
 * remote object's class using the {@code rmic} tool. A static stub is
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    86
 * loaded and an instance of that stub class is constructed as described
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    87
 * below.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 *
21334
c60dfce46a77 8026982: javadoc errors in core libs
rriggs
parents: 19201
diff changeset
    89
 * <ul>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 *
21421
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    91
 * <li>A "root class" is determined as follows: if the remote object's
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 * class directly implements an interface that extends {@link Remote}, then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 * the remote object's class is the root class; otherwise, the root class is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
 * the most derived superclass of the remote object's class that directly
21421
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    95
 * implements an interface that extends {@code Remote}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
 * <li>The name of the stub class to load is determined by concatenating
21421
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
    98
 * the binary name of the root class with the suffix {@code _Stub}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
 * <li>The stub class is loaded by name using the class loader of the root
21421
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   101
 * class. The stub class must extend {@link RemoteStub} and must have a
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   102
 * public constructor that has one parameter of type {@link RemoteRef}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
 * <li>Finally, an instance of the stub class is constructed with a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
 * {@link RemoteRef}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
 *
21421
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   107
 * <li>If the appropriate stub class could not be found, or if the stub class
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   108
 * could not be loaded, or if a problem occurs creating the stub instance, a
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
 * {@link StubNotFoundException} is thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
 *
21421
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   111
 * </ul>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
 *
21421
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   113
 * <p>Stubs are dynamically generated by constructing an instance of
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   114
 * a {@link java.lang.reflect.Proxy Proxy} with the following characteristics:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
 * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
 * <li>The proxy's class is defined by the class loader of the remote
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
 * object's class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
 * <li>The proxy implements all the remote interfaces implemented by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
 * remote object's class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
 * <li>The proxy's invocation handler is a {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
 * RemoteObjectInvocationHandler} instance constructed with a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
 * {@link RemoteRef}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
 * <li>If the proxy could not be created, a {@link StubNotFoundException}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
 * will be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
 * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
 *
19201
80230405e311 8020854: change RMI javadocs to specify that remote objects are exported to the wildcard address
smarks
parents: 5506
diff changeset
   133
 * @implNote
21421
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   134
 * Depending upon which constructor or static method is used for exporting an
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   135
 * object, {@link RMISocketFactory} may be used for creating sockets.
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   136
 * By default, server sockets created by {@link RMISocketFactory}
19201
80230405e311 8020854: change RMI javadocs to specify that remote objects are exported to the wildcard address
smarks
parents: 5506
diff changeset
   137
 * listen on all network interfaces. See the
80230405e311 8020854: change RMI javadocs to specify that remote objects are exported to the wildcard address
smarks
parents: 5506
diff changeset
   138
 * {@link RMISocketFactory} class and the section
80230405e311 8020854: change RMI javadocs to specify that remote objects are exported to the wildcard address
smarks
parents: 5506
diff changeset
   139
 * <a href="{@docRoot}/../platform/rmi/spec/rmi-server29.html">RMI Socket Factories</a>
80230405e311 8020854: change RMI javadocs to specify that remote objects are exported to the wildcard address
smarks
parents: 5506
diff changeset
   140
 * in the
80230405e311 8020854: change RMI javadocs to specify that remote objects are exported to the wildcard address
smarks
parents: 5506
diff changeset
   141
 * <a href="{@docRoot}/../platform/rmi/spec/rmiTOC.html">Java RMI Specification</a>.
80230405e311 8020854: change RMI javadocs to specify that remote objects are exported to the wildcard address
smarks
parents: 5506
diff changeset
   142
 *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
 * @author  Ann Wollrath
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
 * @author  Peter Jones
24865
09b1d992ca72 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
henryjen
parents: 21421
diff changeset
   145
 * @since   1.1
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
 **/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
public class UnicastRemoteObject extends RemoteServer {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * @serial port number on which to export object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    private int port = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * @serial client-side socket factory (if any)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    private RMIClientSocketFactory csf = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * @serial server-side socket factory (if any) to use when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * exporting object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    private RMIServerSocketFactory ssf = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    /* indicate compatibility with JDK 1.1.x version of class */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    private static final long serialVersionUID = 4974527148936298033L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * Creates and exports a new UnicastRemoteObject object using an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * anonymous port.
21421
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   171
     *
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   172
     * <p>The object is exported with a server socket
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   173
     * created using the {@link RMISocketFactory} class.
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   174
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * @throws RemoteException if failed to export object
24865
09b1d992ca72 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
henryjen
parents: 21421
diff changeset
   176
     * @since 1.1
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    protected UnicastRemoteObject() throws RemoteException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
        this(0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * Creates and exports a new UnicastRemoteObject object using the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     * particular supplied port.
21421
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   186
     *
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   187
     * <p>The object is exported with a server socket
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   188
     * created using the {@link RMISocketFactory} class.
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   189
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * @param port the port number on which the remote object receives calls
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * (if <code>port</code> is zero, an anonymous port is chosen)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * @throws RemoteException if failed to export object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    protected UnicastRemoteObject(int port) throws RemoteException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
        this.port = port;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        exportObject((Remote) this, port);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * Creates and exports a new UnicastRemoteObject object using the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * particular supplied port and socket factories.
21421
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   204
     *
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   205
     * <p>Either socket factory may be {@code null}, in which case
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   206
     * the corresponding client or server socket creation method of
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   207
     * {@link RMISocketFactory} is used instead.
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   208
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * @param port the port number on which the remote object receives calls
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * (if <code>port</code> is zero, an anonymous port is chosen)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * @param csf the client-side socket factory for making calls to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * remote object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * @param ssf the server-side socket factory for receiving remote calls
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * @throws RemoteException if failed to export object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    protected UnicastRemoteObject(int port,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                                  RMIClientSocketFactory csf,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                                  RMIServerSocketFactory ssf)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
        throws RemoteException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
        this.port = port;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
        this.csf = csf;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
        this.ssf = ssf;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        exportObject((Remote) this, port, csf, ssf);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     * Re-export the remote object when it is deserialized.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    private void readObject(java.io.ObjectInputStream in)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
        throws java.io.IOException, java.lang.ClassNotFoundException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
        in.defaultReadObject();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
        reexport();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * Returns a clone of the remote object that is distinct from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     * the original.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * @exception CloneNotSupportedException if clone failed due to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * a RemoteException.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * @return the new remote object
24865
09b1d992ca72 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
henryjen
parents: 21421
diff changeset
   245
     * @since 1.1
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    public Object clone() throws CloneNotSupportedException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
            UnicastRemoteObject cloned = (UnicastRemoteObject) super.clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
            cloned.reexport();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
            return cloned;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
        } catch (RemoteException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
            throw new ServerCloneException("Clone failed", e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * Exports this UnicastRemoteObject using its initialized fields because
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     * its creation bypassed running its constructors (via deserialization
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     * or cloning, for example).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
    private void reexport() throws RemoteException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
        if (csf == null && ssf == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
            exportObject((Remote) this, port);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
            exportObject((Remote) this, port, csf, ssf);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * Exports the remote object to make it available to receive incoming
21421
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   274
     * calls using an anonymous port. This method will always return a
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   275
     * statically generated stub.
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   276
     *
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   277
     * <p>The object is exported with a server socket
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   278
     * created using the {@link RMISocketFactory} class.
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   279
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     * @param obj the remote object to be exported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     * @return remote object stub
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     * @exception RemoteException if export fails
24865
09b1d992ca72 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
henryjen
parents: 21421
diff changeset
   283
     * @since 1.1
21421
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   284
     * @deprecated This method is deprecated because it supports only static stubs.
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   285
     * Use {@link #exportObject(Remote, int) exportObject(Remote, port)} or
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   286
     * {@link #exportObject(Remote, int, RMIClientSocketFactory, RMIServerSocketFactory)
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   287
     * exportObject(Remote, port, csf, ssf)}
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   288
     * instead.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     */
21421
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   290
    @Deprecated
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
    public static RemoteStub exportObject(Remote obj)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
        throws RemoteException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
         * Use UnicastServerRef constructor passing the boolean value true
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
         * to indicate that only a generated stub class should be used.  A
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
         * generated stub class must be used instead of a dynamic proxy
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
         * because the return value of this method is RemoteStub which a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
         * dynamic proxy class cannot extend.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
        return (RemoteStub) exportObject(obj, new UnicastServerRef(true));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     * Exports the remote object to make it available to receive incoming
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     * calls, using the particular supplied port.
21421
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   307
     *
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   308
     * <p>The object is exported with a server socket
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   309
     * created using the {@link RMISocketFactory} class.
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   310
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     * @param obj the remote object to be exported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     * @param port the port to export the object on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     * @return remote object stub
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     * @exception RemoteException if export fails
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
    public static Remote exportObject(Remote obj, int port)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
        throws RemoteException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
        return exportObject(obj, new UnicastServerRef(port));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     * Exports the remote object to make it available to receive incoming
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     * calls, using a transport specified by the given socket factory.
21421
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   326
     *
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   327
     * <p>Either socket factory may be {@code null}, in which case
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   328
     * the corresponding client or server socket creation method of
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   329
     * {@link RMISocketFactory} is used instead.
aadfbd8b351b 8023863: deprecate support for statically-generated stubs from RMI (JRMP)
smarks
parents: 21334
diff changeset
   330
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * @param obj the remote object to be exported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * @param port the port to export the object on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * @param csf the client-side socket factory for making calls to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * remote object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     * @param ssf the server-side socket factory for receiving remote calls
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
     * @return remote object stub
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     * @exception RemoteException if export fails
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
    public static Remote exportObject(Remote obj, int port,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
                                      RMIClientSocketFactory csf,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
                                      RMIServerSocketFactory ssf)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
        throws RemoteException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
        return exportObject(obj, new UnicastServerRef2(port, csf, ssf));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     * Removes the remote object, obj, from the RMI runtime. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     * successful, the object can no longer accept incoming RMI calls.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     * If the force parameter is true, the object is forcibly unexported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     * even if there are pending calls to the remote object or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     * remote object still has calls in progress.  If the force
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     * parameter is false, the object is only unexported if there are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     * no pending or in progress calls to the object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     * @param obj the remote object to be unexported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     * @param force if true, unexports the object even if there are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
     * pending or in-progress calls; if false, only unexports the object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
     * if there are no pending or in-progress calls
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     * @return true if operation is successful, false otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     * @exception NoSuchObjectException if the remote object is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     * currently exported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
    public static boolean unexportObject(Remote obj, boolean force)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
        throws java.rmi.NoSuchObjectException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
        return sun.rmi.transport.ObjectTable.unexportObject(obj, force);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     * Exports the specified object using the specified server ref.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
    private static Remote exportObject(Remote obj, UnicastServerRef sref)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
        throws RemoteException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
        // if obj extends UnicastRemoteObject, set its ref.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
        if (obj instanceof UnicastRemoteObject) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
            ((UnicastRemoteObject) obj).ref = sref;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
        return sref.exportObject(obj, null, false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
}