corba/src/share/classes/com/sun/corba/se/spi/legacy/connection/ORBSocketFactory.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) 2000, 2004, 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
02bb8761fcce Initial load
duke
parents:
diff changeset
    26
package com.sun.corba.se.spi.legacy.connection;
02bb8761fcce Initial load
duke
parents:
diff changeset
    27
02bb8761fcce Initial load
duke
parents:
diff changeset
    28
import java.net.ServerSocket;
02bb8761fcce Initial load
duke
parents:
diff changeset
    29
import java.net.Socket;
02bb8761fcce Initial load
duke
parents:
diff changeset
    30
import java.io.IOException;
02bb8761fcce Initial load
duke
parents:
diff changeset
    31
02bb8761fcce Initial load
duke
parents:
diff changeset
    32
import com.sun.corba.se.spi.ior.IOR;
02bb8761fcce Initial load
duke
parents:
diff changeset
    33
import com.sun.corba.se.spi.transport.SocketInfo;
02bb8761fcce Initial load
duke
parents:
diff changeset
    34
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
/**
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    37
 * DEPRECATED.  DEPRECATED. DEPRECATED. DEPRECATED. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
 * DEPRECATED.  DEPRECATED. DEPRECATED. DEPRECATED. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
 * This interface gives one the ability to plug in their own socket
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
 * factory class to an ORB. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    43
 * Usage: <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
 * One specifies a class which implements this interface via the
02bb8761fcce Initial load
duke
parents:
diff changeset
    46
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
 *     <code>ORBConstants.SOCKET_FACTORY_CLASS_PROPERTY</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    49
 * property. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
    50
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    51
 * Example: <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
    52
02bb8761fcce Initial load
duke
parents:
diff changeset
    53
 * <pre>
02bb8761fcce Initial load
duke
parents:
diff changeset
    54
 *   -Dcom.sun.CORBA.connection.ORBSocketFactoryClass=MySocketFactory
02bb8761fcce Initial load
duke
parents:
diff changeset
    55
 * </pre> <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
    56
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    57
 * Typically one would use the same socket factory class on both the
02bb8761fcce Initial load
duke
parents:
diff changeset
    58
 * server side and the client side (but this is not required). <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
    59
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    60
 * A <code>ORBSocketFactory</code> class should have a public default
02bb8761fcce Initial load
duke
parents:
diff changeset
    61
 * constructor which is called once per instantiating ORB.init call.
02bb8761fcce Initial load
duke
parents:
diff changeset
    62
 * That ORB then calls the methods of that <code>ORBSocketFactory</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
    63
 * to obtain client and server sockets. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
    64
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    65
 * This interface also supports multiple server end points.  See the
02bb8761fcce Initial load
duke
parents:
diff changeset
    66
 * documentation on <code>createServerSocket</code> below.
02bb8761fcce Initial load
duke
parents:
diff changeset
    67
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    68
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    69
02bb8761fcce Initial load
duke
parents:
diff changeset
    70
public interface ORBSocketFactory
02bb8761fcce Initial load
duke
parents:
diff changeset
    71
{
02bb8761fcce Initial load
duke
parents:
diff changeset
    72
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
    73
     * DEPRECATED.  DEPRECATED. DEPRECATED. DEPRECATED. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
    74
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
    75
     * A server ORB always creates an "IIOP_CLEAR_TEXT" listening port.
02bb8761fcce Initial load
duke
parents:
diff changeset
    76
     * That port is put into IOP profiles of object references exported
02bb8761fcce Initial load
duke
parents:
diff changeset
    77
     * by an ORB. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
    78
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
    79
     * If
02bb8761fcce Initial load
duke
parents:
diff changeset
    80
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
    81
     *     <code>createServerSocket(String type, int port)</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
    82
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
    83
     * is passed <code>IIOP_CLEAR_TEXT</code> as a <code>type</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
    84
     * argument it should then call and return
02bb8761fcce Initial load
duke
parents:
diff changeset
    85
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
    86
     *     <code>new java.net.ServerSocket(int port)</code> <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
    87
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
    88
     * If
02bb8761fcce Initial load
duke
parents:
diff changeset
    89
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
    90
     *     <code>createSocket(SocketInfo socketInfo)</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
    91
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
    92
     * is passed <code>IIOP_CLEAR_TEXT</code> in
02bb8761fcce Initial load
duke
parents:
diff changeset
    93
     * <code>socketInfo.getType()</code> it should
02bb8761fcce Initial load
duke
parents:
diff changeset
    94
     * then call and return
02bb8761fcce Initial load
duke
parents:
diff changeset
    95
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
    96
     * <pre>
02bb8761fcce Initial load
duke
parents:
diff changeset
    97
     *     new java.net.Socket(socketInfo.getHost(),
02bb8761fcce Initial load
duke
parents:
diff changeset
    98
     *                         socketInfo.getPort())
02bb8761fcce Initial load
duke
parents:
diff changeset
    99
     * </pre>
02bb8761fcce Initial load
duke
parents:
diff changeset
   100
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   101
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   102
    public static final String IIOP_CLEAR_TEXT = "IIOP_CLEAR_TEXT";
02bb8761fcce Initial load
duke
parents:
diff changeset
   103
02bb8761fcce Initial load
duke
parents:
diff changeset
   104
02bb8761fcce Initial load
duke
parents:
diff changeset
   105
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   106
     * DEPRECATED.  DEPRECATED. DEPRECATED. DEPRECATED. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   107
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   108
     * This method is used by a server side ORB. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   109
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   110
     * When an ORB needs to create a listen socket on which connection
02bb8761fcce Initial load
duke
parents:
diff changeset
   111
     * requests are accepted it calls
02bb8761fcce Initial load
duke
parents:
diff changeset
   112
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   113
     *     <code>createServerSocket(String type, int port)</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
   114
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   115
     * The type argument says which type of socket should be created. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   116
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   117
     * The interpretation of the type argument is the responsibility of
02bb8761fcce Initial load
duke
parents:
diff changeset
   118
     * an instance of <code>ORBSocketFactory</code>, except in the case
02bb8761fcce Initial load
duke
parents:
diff changeset
   119
     * of <code>IIOP_CLEAR_TEXT</code>, in which case a standard server
02bb8761fcce Initial load
duke
parents:
diff changeset
   120
     * socket should be created. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   121
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   122
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   123
     * Multiple Server Port API: <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   124
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   125
     * In addition to the IIOP_CLEAR_TEXT listening port, it is possible
02bb8761fcce Initial load
duke
parents:
diff changeset
   126
     * to specify that an ORB listen on additional port of specific types. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   127
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   128
     * This API allows one to specify that an ORB should create an X,
02bb8761fcce Initial load
duke
parents:
diff changeset
   129
     * or an X and a Y listen socket. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   130
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   131
     * If X, to the user, means SSL, then one just plugs in an SSL
02bb8761fcce Initial load
duke
parents:
diff changeset
   132
     * socket factory. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   133
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   134
     * Or, another example, if X and Y, to the user, means SSL without
02bb8761fcce Initial load
duke
parents:
diff changeset
   135
     * authentication and SSL with authentication respectively, then they
02bb8761fcce Initial load
duke
parents:
diff changeset
   136
     * plug in a factory which will either create an X or a Y socket
02bb8761fcce Initial load
duke
parents:
diff changeset
   137
     * depending on the type given to
02bb8761fcce Initial load
duke
parents:
diff changeset
   138
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   139
     *     <code>createServerSocket(String type, int port)</code>. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   140
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   141
     * One specifies multiple listening ports (in addition to the
02bb8761fcce Initial load
duke
parents:
diff changeset
   142
     * default IIOP_CLEAR_TEXT port) using the
02bb8761fcce Initial load
duke
parents:
diff changeset
   143
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   144
     *     <code>ORBConstants.LISTEN_SOCKET_PROPERTY</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
   145
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   146
     * property. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   147
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   148
     * Example usage:<p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   149
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   150
     * <pre>
02bb8761fcce Initial load
duke
parents:
diff changeset
   151
     *    ... \
02bb8761fcce Initial load
duke
parents:
diff changeset
   152
     *    -Dcom.sun.CORBA.connection.ORBSocketFactoryClass=com.my.MySockFact \
02bb8761fcce Initial load
duke
parents:
diff changeset
   153
     *    -Dcom.sun.CORBA.connection.ORBListenSocket=SSL:0,foo:1 \
02bb8761fcce Initial load
duke
parents:
diff changeset
   154
     *    ...
02bb8761fcce Initial load
duke
parents:
diff changeset
   155
     * </pre>
02bb8761fcce Initial load
duke
parents:
diff changeset
   156
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   157
     * The meaning of the "type" (SSL and foo above) is controlled
02bb8761fcce Initial load
duke
parents:
diff changeset
   158
     * by the user. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   159
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   160
     * ORBListenSocket is only meaningful for servers. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   161
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   162
     * The property value is interpreted as follows.  For each
02bb8761fcce Initial load
duke
parents:
diff changeset
   163
     * type/number pair: <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   164
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   165
     * If number is 0 then use an emphemeral port for the listener of
02bb8761fcce Initial load
duke
parents:
diff changeset
   166
     * the associated type. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   167
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   168
     * If number is greater then 0 use that port number. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   169
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   170
     * An ORB creates a listener socket for each type
02bb8761fcce Initial load
duke
parents:
diff changeset
   171
     * specified by the user by calling
02bb8761fcce Initial load
duke
parents:
diff changeset
   172
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   173
     *    <code>createServerSocket(String type, int port)</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
   174
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   175
     * with the type specified by the user. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   176
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   177
     * After an ORB is initialized and the RootPOA has been resolved,
02bb8761fcce Initial load
duke
parents:
diff changeset
   178
     * it is then listening on
02bb8761fcce Initial load
duke
parents:
diff changeset
   179
     * all the end points which were specified.  It may be necessary
02bb8761fcce Initial load
duke
parents:
diff changeset
   180
     * to add this additional end point information to object references
02bb8761fcce Initial load
duke
parents:
diff changeset
   181
     * exported by this ORB.  <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   182
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   183
     * Each object reference will contain the ORB's default IIOP_CLEAR_TEXT
02bb8761fcce Initial load
duke
parents:
diff changeset
   184
     * end point in its IOP profile.  To add additional end point information
02bb8761fcce Initial load
duke
parents:
diff changeset
   185
     * (i.e., an SSL port) to an IOR (i.e., an object reference) one needs
02bb8761fcce Initial load
duke
parents:
diff changeset
   186
     * to intercept IOR creation using
02bb8761fcce Initial load
duke
parents:
diff changeset
   187
     * an <code>PortableInterceptor::IORInterceptor</code>. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   188
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   189
     * Using PortableInterceptors (with a non-standard extension): <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   190
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   191
     * Register an <code>IORInterceptor</code>.  Inside its
02bb8761fcce Initial load
duke
parents:
diff changeset
   192
     * <code>establish_components</code> operation:
02bb8761fcce Initial load
duke
parents:
diff changeset
   193
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   194
     * <pre>
02bb8761fcce Initial load
duke
parents:
diff changeset
   195
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   196
     * com.sun.corba.se.spi.legacy.interceptor.IORInfoExt ext;
02bb8761fcce Initial load
duke
parents:
diff changeset
   197
     * ext = (com.sun.corba.se.spi.legacy.interceptor.IORInfoExt)info;
02bb8761fcce Initial load
duke
parents:
diff changeset
   198
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   199
     * int port = ext.getServerPort("myType");
02bb8761fcce Initial load
duke
parents:
diff changeset
   200
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   201
     * </pre>
02bb8761fcce Initial load
duke
parents:
diff changeset
   202
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   203
     * Once you have the port you may add information to references
02bb8761fcce Initial load
duke
parents:
diff changeset
   204
     * created by the associated adapter by calling
02bb8761fcce Initial load
duke
parents:
diff changeset
   205
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   206
     *    <code>IORInfo::add_ior_component</code><p> <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   207
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   208
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   209
     * Note: if one is using a POA and the lifespan policy of that
02bb8761fcce Initial load
duke
parents:
diff changeset
   210
     * POA is persistent then the port number returned
02bb8761fcce Initial load
duke
parents:
diff changeset
   211
     * by <code>getServerPort</code> <em>may</em>
02bb8761fcce Initial load
duke
parents:
diff changeset
   212
     * be the corresponding ORBD port, depending on whether the POA/ORBD
02bb8761fcce Initial load
duke
parents:
diff changeset
   213
     * protocol is the present port exchange or if, in the future,
02bb8761fcce Initial load
duke
parents:
diff changeset
   214
     * the protocol is based on object reference template exchange.
02bb8761fcce Initial load
duke
parents:
diff changeset
   215
     * In either
02bb8761fcce Initial load
duke
parents:
diff changeset
   216
     * case, the port returned will be correct for the protocol.
02bb8761fcce Initial load
duke
parents:
diff changeset
   217
     * (In more detail, if the port exchange protocol is used then
02bb8761fcce Initial load
duke
parents:
diff changeset
   218
     * getServerPort will return the ORBD's port since the port
02bb8761fcce Initial load
duke
parents:
diff changeset
   219
     * exchange happens before, at ORB initialization.
02bb8761fcce Initial load
duke
parents:
diff changeset
   220
     * If object reference
02bb8761fcce Initial load
duke
parents:
diff changeset
   221
     * exchange is used then the server's transient port will be returned
02bb8761fcce Initial load
duke
parents:
diff changeset
   222
     * since the templates are exchanged after adding components.) <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   223
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   224
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   225
     * Persistent object reference support: <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   226
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   227
     * When creating persistent object references with alternate
02bb8761fcce Initial load
duke
parents:
diff changeset
   228
     * type/port info, ones needs to configure the ORBD to also support
02bb8761fcce Initial load
duke
parents:
diff changeset
   229
     * this alternate info.  This is done as follows: <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   230
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   231
     * - Give the ORBD the same socket factory you gave to the client
02bb8761fcce Initial load
duke
parents:
diff changeset
   232
     * and server. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   233
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   234
     * - specify ORBListenSocket ports of the same types that your
02bb8761fcce Initial load
duke
parents:
diff changeset
   235
     * servers support.  You should probably specify explicit port
02bb8761fcce Initial load
duke
parents:
diff changeset
   236
     * numbers for ORBD if you embed these numbers inside IORs. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   237
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   238
     * Note: when using the port exchange protocol
02bb8761fcce Initial load
duke
parents:
diff changeset
   239
     * the ORBD and servers will exchange port
02bb8761fcce Initial load
duke
parents:
diff changeset
   240
     * numbers for each given type so they know about each other.
02bb8761fcce Initial load
duke
parents:
diff changeset
   241
     * When using object reference template exchange the server's
02bb8761fcce Initial load
duke
parents:
diff changeset
   242
     * transient ports are contained in the template. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   243
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   244
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   245
     * - specify your <code>BadServerIdHandler</code> (discussed below)
02bb8761fcce Initial load
duke
parents:
diff changeset
   246
     * using the
02bb8761fcce Initial load
duke
parents:
diff changeset
   247
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   248
     *    <code>ORBConstants.BAD_SERVER_ID_HANDLER_CLASS_PROPERTY</code> <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   249
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   250
     * Example: <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   251
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   252
     * <pre>
02bb8761fcce Initial load
duke
parents:
diff changeset
   253
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   254
     * -Dcom.sun.CORBA.POA.ORBBadServerIdHandlerClass=corba.socketPersistent.MyBadServerIdHandler
02bb8761fcce Initial load
duke
parents:
diff changeset
   255
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   256
     * </pre>
02bb8761fcce Initial load
duke
parents:
diff changeset
   257
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   258
     * The <code>BadServerIdHandler</code> ...<p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   259
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   260
     * See <code>com.sun.corba.se.impl.activation.ServerManagerImpl.handle</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
   261
     * for example code on writing a bad server id handler.  NOTE:  This
02bb8761fcce Initial load
duke
parents:
diff changeset
   262
     * is an unsupported internal API.  It will not exist in future releases.
02bb8761fcce Initial load
duke
parents:
diff changeset
   263
     * <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   264
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   265
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   266
     * Secure connections to other services: <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   267
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   268
     * If one wants secure connections to other services such as
02bb8761fcce Initial load
duke
parents:
diff changeset
   269
     * Naming then one should configure them with the same
02bb8761fcce Initial load
duke
parents:
diff changeset
   270
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   271
     *     <code>SOCKET_FACTORY_CLASS_PROPERTY</code> and
02bb8761fcce Initial load
duke
parents:
diff changeset
   272
     *     <code>LISTEN_SOCKET_PROPERTY</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
   273
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   274
     * as used by other clients and servers in your distributed system. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   275
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   276
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   277
    public ServerSocket createServerSocket(String type, int port)
02bb8761fcce Initial load
duke
parents:
diff changeset
   278
        throws
02bb8761fcce Initial load
duke
parents:
diff changeset
   279
            IOException;
02bb8761fcce Initial load
duke
parents:
diff changeset
   280
02bb8761fcce Initial load
duke
parents:
diff changeset
   281
02bb8761fcce Initial load
duke
parents:
diff changeset
   282
02bb8761fcce Initial load
duke
parents:
diff changeset
   283
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   284
     * DEPRECATED.  DEPRECATED. DEPRECATED. DEPRECATED. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   285
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   286
     * This method is used by a client side ORB. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   287
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   288
     * Each time a client invokes on an object reference, the reference's
02bb8761fcce Initial load
duke
parents:
diff changeset
   289
     * associated ORB will call
02bb8761fcce Initial load
duke
parents:
diff changeset
   290
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   291
     * <pre>
02bb8761fcce Initial load
duke
parents:
diff changeset
   292
     *    getEndPointInfo(ORB orb,
02bb8761fcce Initial load
duke
parents:
diff changeset
   293
     *                    IOR ior,
02bb8761fcce Initial load
duke
parents:
diff changeset
   294
     *                    SocketInfo socketInfo)
02bb8761fcce Initial load
duke
parents:
diff changeset
   295
     * </pre>
02bb8761fcce Initial load
duke
parents:
diff changeset
   296
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   297
     * NOTE: The type of the <code>ior</code> argument is an internal
02bb8761fcce Initial load
duke
parents:
diff changeset
   298
     * representation for efficiency.  If the <code>ORBSocketFactory</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
   299
     * interface ever becomes standardized then the <code>ior</code> will
02bb8761fcce Initial load
duke
parents:
diff changeset
   300
     * most likely change to a standard type (e.g., a stringified ior,
02bb8761fcce Initial load
duke
parents:
diff changeset
   301
     * an <code>org.omg.IOP.IOR</code>, or ...). <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   302
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   303
     * Typically, this method will look at tagged components in the
02bb8761fcce Initial load
duke
parents:
diff changeset
   304
     * given <code>ior</code> to determine what type of socket to create. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   305
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   306
     * Typically, the <code>ior</code> will contain a tagged component
02bb8761fcce Initial load
duke
parents:
diff changeset
   307
     * specifying an alternate port type and number.  <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   308
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   309
     * This method should return an <code>SocketInfo</code> object
02bb8761fcce Initial load
duke
parents:
diff changeset
   310
     * containing the type/host/port to be used for the connection.
02bb8761fcce Initial load
duke
parents:
diff changeset
   311
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   312
     * If there are no appropriate tagged components then this method
02bb8761fcce Initial load
duke
parents:
diff changeset
   313
     * should return an <code>SocketInfo</code> object with the type
02bb8761fcce Initial load
duke
parents:
diff changeset
   314
     * <code>IIOP_CLEAR_TEXT</code> and host/port from the ior's IOP
02bb8761fcce Initial load
duke
parents:
diff changeset
   315
     * profile. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   316
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   317
     * If the ORB already has an existing connection to the returned
02bb8761fcce Initial load
duke
parents:
diff changeset
   318
     * type/host/port, then that connection is used.  Otherwise the ORB calls
02bb8761fcce Initial load
duke
parents:
diff changeset
   319
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   320
     *    <code>createSocket(SocketInfo socketInfo)</code> <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   321
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   322
     * The <code>orb</code> argument is useful for handling
02bb8761fcce Initial load
duke
parents:
diff changeset
   323
     * the <code>ior</code> argument. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   324
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   325
     * The <code>SocketInfo</code> given to <code>getEndPointInfo</code>
02bb8761fcce Initial load
duke
parents:
diff changeset
   326
     * is either null or an object obtained
02bb8761fcce Initial load
duke
parents:
diff changeset
   327
     * from <code>GetEndPointInfoAgainException</code> <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   328
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   329
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   330
    public SocketInfo getEndPointInfo(org.omg.CORBA.ORB orb,
02bb8761fcce Initial load
duke
parents:
diff changeset
   331
                                        IOR ior,
02bb8761fcce Initial load
duke
parents:
diff changeset
   332
                                        SocketInfo socketInfo);
02bb8761fcce Initial load
duke
parents:
diff changeset
   333
02bb8761fcce Initial load
duke
parents:
diff changeset
   334
02bb8761fcce Initial load
duke
parents:
diff changeset
   335
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   336
     * DEPRECATED.  DEPRECATED. DEPRECATED. DEPRECATED. <p
02bb8761fcce Initial load
duke
parents:
diff changeset
   337
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   338
     * This method is used by a client side ORB. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   339
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   340
     * This method should return a client socket of the given
02bb8761fcce Initial load
duke
parents:
diff changeset
   341
     * type/host/port. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   342
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   343
     * Note: the <code>SocketInfo</code> is the same instance as was
02bb8761fcce Initial load
duke
parents:
diff changeset
   344
     * returned by <code>getSocketInfo</code> so extra cookie info may
02bb8761fcce Initial load
duke
parents:
diff changeset
   345
     * be attached. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   346
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   347
     * If this method throws GetEndPointInfoAgainException then the
02bb8761fcce Initial load
duke
parents:
diff changeset
   348
     * ORB calls <code>getEndPointInfo</code> again, passing it the
02bb8761fcce Initial load
duke
parents:
diff changeset
   349
     * <code>SocketInfo</code> object contained in the exception. <p>
02bb8761fcce Initial load
duke
parents:
diff changeset
   350
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   351
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   352
    public Socket createSocket(SocketInfo socketInfo)
02bb8761fcce Initial load
duke
parents:
diff changeset
   353
        throws
02bb8761fcce Initial load
duke
parents:
diff changeset
   354
            IOException,
02bb8761fcce Initial load
duke
parents:
diff changeset
   355
            GetEndPointInfoAgainException;
02bb8761fcce Initial load
duke
parents:
diff changeset
   356
}
02bb8761fcce Initial load
duke
parents:
diff changeset
   357
02bb8761fcce Initial load
duke
parents:
diff changeset
   358
// End of file.