corba/src/share/classes/com/sun/corba/se/impl/orb/ParserTable.java
author alanb
Mon, 10 Jun 2013 17:15:42 +0100
changeset 18302 3b06314efbd0
parent 13052 63c6c4c360e1
child 18312 c940914e1849
permissions -rw-r--r--
8016218: Warnings building corba repo due to missing hashCode methods Reviewed-by: chegar, coffeys, dfuchs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     1
/*
13052
63c6c4c360e1 7079902: Refine CORBA data models
mbankal
parents: 5555
diff changeset
     2
 * Copyright (c) 2002, 2012, 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.impl.orb ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    27
02bb8761fcce Initial load
duke
parents:
diff changeset
    28
import java.net.URL ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    29
import java.net.InetSocketAddress;
02bb8761fcce Initial load
duke
parents:
diff changeset
    30
import java.net.Socket ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    31
import java.net.ServerSocket ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    32
02bb8761fcce Initial load
duke
parents:
diff changeset
    33
import java.io.IOException ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    34
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
import java.util.HashMap ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
import java.util.List;
02bb8761fcce Initial load
duke
parents:
diff changeset
    37
import java.util.Map ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
import java.security.AccessController ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
import java.security.PrivilegedExceptionAction ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
import java.security.PrivilegedActionException ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
02bb8761fcce Initial load
duke
parents:
diff changeset
    43
import org.omg.PortableInterceptor.ORBInitializer ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
import org.omg.PortableInterceptor.ORBInitInfo ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
02bb8761fcce Initial load
duke
parents:
diff changeset
    46
import com.sun.corba.se.pept.broker.Broker;
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
import com.sun.corba.se.pept.encoding.InputObject;
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
import com.sun.corba.se.pept.encoding.OutputObject;
02bb8761fcce Initial load
duke
parents:
diff changeset
    49
import com.sun.corba.se.pept.protocol.MessageMediator;
02bb8761fcce Initial load
duke
parents:
diff changeset
    50
import com.sun.corba.se.pept.transport.Acceptor;
02bb8761fcce Initial load
duke
parents:
diff changeset
    51
import com.sun.corba.se.pept.transport.Connection;
02bb8761fcce Initial load
duke
parents:
diff changeset
    52
import com.sun.corba.se.pept.transport.ContactInfo;
02bb8761fcce Initial load
duke
parents:
diff changeset
    53
import com.sun.corba.se.pept.transport.ContactInfoList;
02bb8761fcce Initial load
duke
parents:
diff changeset
    54
import com.sun.corba.se.pept.transport.EventHandler;
02bb8761fcce Initial load
duke
parents:
diff changeset
    55
import com.sun.corba.se.pept.transport.InboundConnectionCache;
02bb8761fcce Initial load
duke
parents:
diff changeset
    56
02bb8761fcce Initial load
duke
parents:
diff changeset
    57
import com.sun.corba.se.spi.ior.IOR ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    58
import com.sun.corba.se.spi.ior.ObjectKey ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    59
import com.sun.corba.se.spi.ior.iiop.GIOPVersion ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    60
import com.sun.corba.se.spi.logging.CORBALogDomains ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    61
import com.sun.corba.se.spi.orb.ORB;
02bb8761fcce Initial load
duke
parents:
diff changeset
    62
import com.sun.corba.se.spi.orb.Operation ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    63
import com.sun.corba.se.spi.orb.OperationFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    64
import com.sun.corba.se.spi.orb.ParserData ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    65
import com.sun.corba.se.spi.orb.ParserDataFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    66
import com.sun.corba.se.spi.orb.StringPair ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    67
import com.sun.corba.se.spi.transport.CorbaContactInfoList;
02bb8761fcce Initial load
duke
parents:
diff changeset
    68
import com.sun.corba.se.spi.transport.CorbaContactInfoListFactory;
02bb8761fcce Initial load
duke
parents:
diff changeset
    69
import com.sun.corba.se.spi.transport.CorbaTransportManager;
02bb8761fcce Initial load
duke
parents:
diff changeset
    70
import com.sun.corba.se.spi.transport.IORToSocketInfo;
02bb8761fcce Initial load
duke
parents:
diff changeset
    71
import com.sun.corba.se.spi.transport.ReadTimeouts;
02bb8761fcce Initial load
duke
parents:
diff changeset
    72
import com.sun.corba.se.spi.transport.SocketInfo;
02bb8761fcce Initial load
duke
parents:
diff changeset
    73
import com.sun.corba.se.spi.transport.IIOPPrimaryToContactInfo;
02bb8761fcce Initial load
duke
parents:
diff changeset
    74
import com.sun.corba.se.spi.transport.TransportDefault;
02bb8761fcce Initial load
duke
parents:
diff changeset
    75
02bb8761fcce Initial load
duke
parents:
diff changeset
    76
import com.sun.corba.se.impl.encoding.CodeSetComponentInfo ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    77
import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    78
import com.sun.corba.se.impl.legacy.connection.USLPort ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    79
import com.sun.corba.se.impl.logging.ORBUtilSystemException ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    80
import com.sun.corba.se.impl.oa.poa.BadServerIdHandler ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    81
import com.sun.corba.se.impl.orbutil.ORBClassLoader ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    82
import com.sun.corba.se.impl.orbutil.ORBConstants ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    83
import com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    84
import com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    85
import com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    86
import com.sun.corba.se.impl.transport.DefaultIORToSocketInfoImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
    87
import com.sun.corba.se.impl.transport.DefaultSocketFactoryImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
    88
02bb8761fcce Initial load
duke
parents:
diff changeset
    89
/** Initialize the parser data for the standard ORB parser.  This is used both
02bb8761fcce Initial load
duke
parents:
diff changeset
    90
 * to implement ORBDataParserImpl and to provide the basic testing framework
02bb8761fcce Initial load
duke
parents:
diff changeset
    91
 * for ORBDataParserImpl.
02bb8761fcce Initial load
duke
parents:
diff changeset
    92
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    93
public class ParserTable {
02bb8761fcce Initial load
duke
parents:
diff changeset
    94
    private static String MY_CLASS_NAME = ParserTable.class.getName() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    95
02bb8761fcce Initial load
duke
parents:
diff changeset
    96
    private static ParserTable myInstance = new ParserTable() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    97
02bb8761fcce Initial load
duke
parents:
diff changeset
    98
    private ORBUtilSystemException wrapper ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    99
02bb8761fcce Initial load
duke
parents:
diff changeset
   100
    public static ParserTable get()
02bb8761fcce Initial load
duke
parents:
diff changeset
   101
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   102
        return myInstance ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   103
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   104
02bb8761fcce Initial load
duke
parents:
diff changeset
   105
    private ParserData[] parserData ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   106
02bb8761fcce Initial load
duke
parents:
diff changeset
   107
    public ParserData[] getParserData()
02bb8761fcce Initial load
duke
parents:
diff changeset
   108
    {
13052
63c6c4c360e1 7079902: Refine CORBA data models
mbankal
parents: 5555
diff changeset
   109
        ParserData[] parserArray = new ParserData[parserData.length];
63c6c4c360e1 7079902: Refine CORBA data models
mbankal
parents: 5555
diff changeset
   110
        System.arraycopy(parserData, 0, parserArray, 0, parserData.length);
63c6c4c360e1 7079902: Refine CORBA data models
mbankal
parents: 5555
diff changeset
   111
        return parserArray;
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   112
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   113
02bb8761fcce Initial load
duke
parents:
diff changeset
   114
    private ParserTable() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   115
        wrapper = ORBUtilSystemException.get( CORBALogDomains.ORB_LIFECYCLE ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   116
02bb8761fcce Initial load
duke
parents:
diff changeset
   117
        String codeSetTestString =
02bb8761fcce Initial load
duke
parents:
diff changeset
   118
            OSFCodeSetRegistry.ISO_8859_1_VALUE + "," +
02bb8761fcce Initial load
duke
parents:
diff changeset
   119
            OSFCodeSetRegistry.UTF_16_VALUE + "," +
02bb8761fcce Initial load
duke
parents:
diff changeset
   120
            OSFCodeSetRegistry.ISO_646_VALUE ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   121
02bb8761fcce Initial load
duke
parents:
diff changeset
   122
        String[] debugTestData = { "subcontract", "poa", "transport" } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   123
02bb8761fcce Initial load
duke
parents:
diff changeset
   124
        USLPort[] USLPorts = { new USLPort( "FOO", 2701 ), new USLPort( "BAR", 3333 ) } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   125
02bb8761fcce Initial load
duke
parents:
diff changeset
   126
        ReadTimeouts readTimeouts =
02bb8761fcce Initial load
duke
parents:
diff changeset
   127
               TransportDefault.makeReadTimeoutsFactory().create(
02bb8761fcce Initial load
duke
parents:
diff changeset
   128
                    ORBConstants.TRANSPORT_TCP_INITIAL_TIME_TO_WAIT,
02bb8761fcce Initial load
duke
parents:
diff changeset
   129
                    ORBConstants.TRANSPORT_TCP_MAX_TIME_TO_WAIT,
02bb8761fcce Initial load
duke
parents:
diff changeset
   130
                    ORBConstants.TRANSPORT_TCP_GIOP_HEADER_MAX_TIME_TO_WAIT,
02bb8761fcce Initial load
duke
parents:
diff changeset
   131
                    ORBConstants.TRANSPORT_TCP_TIME_TO_WAIT_BACKOFF_FACTOR);
02bb8761fcce Initial load
duke
parents:
diff changeset
   132
02bb8761fcce Initial load
duke
parents:
diff changeset
   133
        ORBInitializer[] TestORBInitializers =
02bb8761fcce Initial load
duke
parents:
diff changeset
   134
            { null,
02bb8761fcce Initial load
duke
parents:
diff changeset
   135
              new TestORBInitializer1(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   136
              new TestORBInitializer2() }  ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   137
        StringPair[] TestORBInitData = {
02bb8761fcce Initial load
duke
parents:
diff changeset
   138
            new StringPair( "foo.bar.blech.NonExistent", "dummy" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   139
            new StringPair( MY_CLASS_NAME + "$TestORBInitializer1", "dummy" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   140
            new StringPair( MY_CLASS_NAME + "$TestORBInitializer2", "dummy" ) } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   141
02bb8761fcce Initial load
duke
parents:
diff changeset
   142
        Acceptor[] TestAcceptors =
02bb8761fcce Initial load
duke
parents:
diff changeset
   143
            { new TestAcceptor2(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   144
              new TestAcceptor1(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   145
              null }  ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   146
        // REVISIT: The test data gets put into a Properties object where
02bb8761fcce Initial load
duke
parents:
diff changeset
   147
        // order is not guaranteed.  Thus the above array is in reverse.
02bb8761fcce Initial load
duke
parents:
diff changeset
   148
        StringPair[] TestAcceptorData = {
02bb8761fcce Initial load
duke
parents:
diff changeset
   149
            new StringPair( "foo.bar.blech.NonExistent", "dummy" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   150
            new StringPair( MY_CLASS_NAME + "$TestAcceptor1", "dummy" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   151
            new StringPair( MY_CLASS_NAME + "$TestAcceptor2", "dummy" ) } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   152
02bb8761fcce Initial load
duke
parents:
diff changeset
   153
        StringPair[] TestORBInitRefData =
02bb8761fcce Initial load
duke
parents:
diff changeset
   154
            { new StringPair( "Foo", "ior:930492049394" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   155
              new StringPair( "Bar", "ior:3453465785633576" ) } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   156
02bb8761fcce Initial load
duke
parents:
diff changeset
   157
        URL testServicesURL = null ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   158
        String testServicesString = "corbaloc::camelot/NameService" ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   159
02bb8761fcce Initial load
duke
parents:
diff changeset
   160
        try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   161
            testServicesURL = new URL( testServicesString )  ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   162
        } catch (Exception exc) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   163
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   164
02bb8761fcce Initial load
duke
parents:
diff changeset
   165
        // propertyName,
02bb8761fcce Initial load
duke
parents:
diff changeset
   166
        // operation,
02bb8761fcce Initial load
duke
parents:
diff changeset
   167
        // fieldName, defaultValue,
02bb8761fcce Initial load
duke
parents:
diff changeset
   168
        // testValue, testData (string or Pair[])
02bb8761fcce Initial load
duke
parents:
diff changeset
   169
        ParserData[] pd = {
02bb8761fcce Initial load
duke
parents:
diff changeset
   170
            ParserDataFactory.make( ORBConstants.DEBUG_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   171
                OperationFactory.listAction( ",", OperationFactory.stringAction()),
02bb8761fcce Initial load
duke
parents:
diff changeset
   172
                "debugFlags", new String[0],
02bb8761fcce Initial load
duke
parents:
diff changeset
   173
                debugTestData, "subcontract,poa,transport" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   174
            ParserDataFactory.make( ORBConstants.INITIAL_HOST_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   175
                OperationFactory.stringAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   176
                "ORBInitialHost", "",
02bb8761fcce Initial load
duke
parents:
diff changeset
   177
                "Foo", "Foo" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   178
            ParserDataFactory.make( ORBConstants.INITIAL_PORT_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   179
                OperationFactory.integerAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   180
                "ORBInitialPort", new Integer( ORBConstants.DEFAULT_INITIAL_PORT ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   181
                new Integer( 27314 ), "27314" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   182
            // Where did this come from?
02bb8761fcce Initial load
duke
parents:
diff changeset
   183
            //ParserDataFactory.make( ORBConstants.INITIAL_PORT_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   184
                //OperationFactory.booleanAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   185
                //"ORBInitialPortInitialized", Boolean.FALSE,
02bb8761fcce Initial load
duke
parents:
diff changeset
   186
                //Boolean.TRUE, "27314" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   187
            ParserDataFactory.make( ORBConstants.SERVER_HOST_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   188
                OperationFactory.stringAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   189
                "ORBServerHost", "",
02bb8761fcce Initial load
duke
parents:
diff changeset
   190
                "camelot", "camelot" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   191
            ParserDataFactory.make( ORBConstants.SERVER_PORT_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   192
                OperationFactory.integerAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   193
                "ORBServerPort", new Integer( 0 ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   194
                new Integer( 38143 ), "38143" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   195
            // NOTE: We are putting SERVER_HOST_NAME configuration info into
02bb8761fcce Initial load
duke
parents:
diff changeset
   196
            // DataCollectorBase to avoid a security hole.  However, that forces
02bb8761fcce Initial load
duke
parents:
diff changeset
   197
            // us to also set LISTEN_ON_ALL_INTERFACES at the same time.
02bb8761fcce Initial load
duke
parents:
diff changeset
   198
            // This all needs to be cleaned up for two reasons: to get configuration
02bb8761fcce Initial load
duke
parents:
diff changeset
   199
            // out of DataCollectorBase and to correctly support multihoming.
02bb8761fcce Initial load
duke
parents:
diff changeset
   200
            ParserDataFactory.make( ORBConstants.LISTEN_ON_ALL_INTERFACES,
02bb8761fcce Initial load
duke
parents:
diff changeset
   201
                OperationFactory.stringAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   202
                "listenOnAllInterfaces", ORBConstants.LISTEN_ON_ALL_INTERFACES,
02bb8761fcce Initial load
duke
parents:
diff changeset
   203
                "foo", "foo" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   204
            ParserDataFactory.make( ORBConstants.ORB_ID_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   205
                OperationFactory.stringAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   206
                "orbId", "",
02bb8761fcce Initial load
duke
parents:
diff changeset
   207
                "foo", "foo" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   208
            ParserDataFactory.make( ORBConstants.OLD_ORB_ID_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   209
                OperationFactory.stringAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   210
                "orbId", "",
02bb8761fcce Initial load
duke
parents:
diff changeset
   211
                "foo", "foo" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   212
            ParserDataFactory.make( ORBConstants.ORB_SERVER_ID_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   213
                OperationFactory.integerAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   214
                "persistentServerId", new Integer(-1),
02bb8761fcce Initial load
duke
parents:
diff changeset
   215
                new Integer( 1234), "1234" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   216
            ParserDataFactory.make(
02bb8761fcce Initial load
duke
parents:
diff changeset
   217
                ORBConstants.ORB_SERVER_ID_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   218
                OperationFactory.setFlagAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   219
                "persistentServerIdInitialized", Boolean.FALSE,
02bb8761fcce Initial load
duke
parents:
diff changeset
   220
                Boolean.TRUE, "1234" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   221
            ParserDataFactory.make(
02bb8761fcce Initial load
duke
parents:
diff changeset
   222
                ORBConstants.ORB_SERVER_ID_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   223
                OperationFactory.setFlagAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   224
                "orbServerIdPropertySpecified", Boolean.FALSE,
02bb8761fcce Initial load
duke
parents:
diff changeset
   225
                Boolean.TRUE, "1234" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   226
            // REVISIT after switch
02bb8761fcce Initial load
duke
parents:
diff changeset
   227
            // ParserDataFactory.make( ORBConstants.INITIAL_SERVICES_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   228
                // OperationFactory.URLAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   229
                // "servicesURL", null,
02bb8761fcce Initial load
duke
parents:
diff changeset
   230
                // testServicesURL, testServicesString ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   231
            // ParserDataFactory.make( ORBConstants.DEFAULT_INIT_REF_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   232
                // OperationFactory.stringAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   233
                // "defaultInitRef", null,
02bb8761fcce Initial load
duke
parents:
diff changeset
   234
                // "Fooref", "Fooref" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   235
            ParserDataFactory.make( ORBConstants.HIGH_WATER_MARK_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   236
                OperationFactory.integerAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   237
                "highWaterMark", new Integer( 240 ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   238
                new Integer( 3745 ), "3745" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   239
            ParserDataFactory.make( ORBConstants.LOW_WATER_MARK_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   240
                OperationFactory.integerAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   241
                "lowWaterMark", new Integer( 100 ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   242
                new Integer( 12 ), "12" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   243
            ParserDataFactory.make( ORBConstants.NUMBER_TO_RECLAIM_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   244
                OperationFactory.integerAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   245
                "numberToReclaim", new Integer( 5 ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   246
                new Integer( 231 ), "231" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   247
            ParserDataFactory.make( ORBConstants.GIOP_VERSION,
02bb8761fcce Initial load
duke
parents:
diff changeset
   248
                makeGVOperation(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   249
                "giopVersion", GIOPVersion.DEFAULT_VERSION,
02bb8761fcce Initial load
duke
parents:
diff changeset
   250
                new GIOPVersion( 2, 3 ), "2.3" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   251
            ParserDataFactory.make( ORBConstants.GIOP_FRAGMENT_SIZE,
02bb8761fcce Initial load
duke
parents:
diff changeset
   252
                makeFSOperation(), "giopFragmentSize",
02bb8761fcce Initial load
duke
parents:
diff changeset
   253
                new Integer( ORBConstants.GIOP_DEFAULT_FRAGMENT_SIZE ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   254
                new Integer( 65536 ), "65536" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   255
            ParserDataFactory.make( ORBConstants.GIOP_BUFFER_SIZE,
02bb8761fcce Initial load
duke
parents:
diff changeset
   256
                OperationFactory.integerAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   257
                "giopBufferSize", new Integer( ORBConstants.GIOP_DEFAULT_BUFFER_SIZE ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   258
                new Integer( 234000 ), "234000" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   259
            ParserDataFactory.make( ORBConstants.GIOP_11_BUFFMGR,
02bb8761fcce Initial load
duke
parents:
diff changeset
   260
                makeBMGROperation(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   261
                "giop11BuffMgr", new Integer( ORBConstants.DEFAULT_GIOP_11_BUFFMGR ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   262
                new Integer( 1 ), "CLCT" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   263
            ParserDataFactory.make( ORBConstants.GIOP_12_BUFFMGR,
02bb8761fcce Initial load
duke
parents:
diff changeset
   264
                makeBMGROperation(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   265
                "giop12BuffMgr", new Integer( ORBConstants.DEFAULT_GIOP_12_BUFFMGR ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   266
                new Integer( 0 ), "GROW" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   267
02bb8761fcce Initial load
duke
parents:
diff changeset
   268
            // Note that the same property is used to set two different
02bb8761fcce Initial load
duke
parents:
diff changeset
   269
            // fields here.  This requires that both entries use the same test
02bb8761fcce Initial load
duke
parents:
diff changeset
   270
            // data, or the test will fail.
02bb8761fcce Initial load
duke
parents:
diff changeset
   271
            ParserDataFactory.make( ORBConstants.GIOP_TARGET_ADDRESSING,
02bb8761fcce Initial load
duke
parents:
diff changeset
   272
                OperationFactory.compose( OperationFactory.integerRangeAction( 0, 3 ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   273
                    OperationFactory.convertIntegerToShort() ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   274
                "giopTargetAddressPreference",
02bb8761fcce Initial load
duke
parents:
diff changeset
   275
                new Short( ORBConstants.ADDR_DISP_HANDLE_ALL ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   276
                new Short( (short)2 ), "2" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   277
            ParserDataFactory.make( ORBConstants.GIOP_TARGET_ADDRESSING,
02bb8761fcce Initial load
duke
parents:
diff changeset
   278
                makeADOperation(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   279
                "giopAddressDisposition", new Short( KeyAddr.value ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   280
                new Short( (short)2 ), "2" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   281
            ParserDataFactory.make( ORBConstants.ALWAYS_SEND_CODESET_CTX_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   282
                OperationFactory.booleanAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   283
                "alwaysSendCodeSetCtx", Boolean.TRUE,
02bb8761fcce Initial load
duke
parents:
diff changeset
   284
                Boolean.FALSE, "false"),
02bb8761fcce Initial load
duke
parents:
diff changeset
   285
            ParserDataFactory.make( ORBConstants.USE_BOMS,
02bb8761fcce Initial load
duke
parents:
diff changeset
   286
                OperationFactory.booleanAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   287
                "useByteOrderMarkers",
02bb8761fcce Initial load
duke
parents:
diff changeset
   288
                    Boolean.valueOf( ORBConstants.DEFAULT_USE_BYTE_ORDER_MARKERS ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   289
                Boolean.FALSE, "false" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   290
            ParserDataFactory.make( ORBConstants.USE_BOMS_IN_ENCAPS,
02bb8761fcce Initial load
duke
parents:
diff changeset
   291
                OperationFactory.booleanAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   292
                "useByteOrderMarkersInEncaps",
02bb8761fcce Initial load
duke
parents:
diff changeset
   293
                    Boolean.valueOf( ORBConstants.DEFAULT_USE_BYTE_ORDER_MARKERS_IN_ENCAPS ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   294
                Boolean.FALSE, "false" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   295
            ParserDataFactory.make( ORBConstants.CHAR_CODESETS,
02bb8761fcce Initial load
duke
parents:
diff changeset
   296
                makeCSOperation(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   297
                "charData", CodeSetComponentInfo.JAVASOFT_DEFAULT_CODESETS.getCharComponent(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   298
                CodeSetComponentInfo.createFromString( codeSetTestString ), codeSetTestString ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   299
            ParserDataFactory.make( ORBConstants.WCHAR_CODESETS,
02bb8761fcce Initial load
duke
parents:
diff changeset
   300
                makeCSOperation(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   301
                "wcharData", CodeSetComponentInfo.JAVASOFT_DEFAULT_CODESETS.getWCharComponent(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   302
                CodeSetComponentInfo.createFromString( codeSetTestString ), codeSetTestString ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   303
            ParserDataFactory.make( ORBConstants.ALLOW_LOCAL_OPTIMIZATION,
02bb8761fcce Initial load
duke
parents:
diff changeset
   304
                OperationFactory.booleanAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   305
                "allowLocalOptimization", Boolean.FALSE,
02bb8761fcce Initial load
duke
parents:
diff changeset
   306
                Boolean.TRUE, "true" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   307
            ParserDataFactory.make( ORBConstants.LEGACY_SOCKET_FACTORY_CLASS_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   308
                makeLegacySocketFactoryOperation(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   309
                // No default - must be set by user if they are using
02bb8761fcce Initial load
duke
parents:
diff changeset
   310
                // legacy socket factory.
02bb8761fcce Initial load
duke
parents:
diff changeset
   311
                "legacySocketFactory", null,
02bb8761fcce Initial load
duke
parents:
diff changeset
   312
                new TestLegacyORBSocketFactory(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   313
                MY_CLASS_NAME + "$TestLegacyORBSocketFactory" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   314
            ParserDataFactory.make( ORBConstants.SOCKET_FACTORY_CLASS_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   315
                makeSocketFactoryOperation(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   316
                "socketFactory", new DefaultSocketFactoryImpl(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   317
                new TestORBSocketFactory(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   318
                MY_CLASS_NAME + "$TestORBSocketFactory" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   319
            ParserDataFactory.make( ORBConstants.LISTEN_SOCKET_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   320
                makeUSLOperation() ,
02bb8761fcce Initial load
duke
parents:
diff changeset
   321
                "userSpecifiedListenPorts", new USLPort[0],
02bb8761fcce Initial load
duke
parents:
diff changeset
   322
                USLPorts, "FOO:2701,BAR:3333" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   323
            ParserDataFactory.make( ORBConstants.IOR_TO_SOCKET_INFO_CLASS_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   324
                makeIORToSocketInfoOperation(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   325
                "iorToSocketInfo", new DefaultIORToSocketInfoImpl(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   326
                new TestIORToSocketInfo(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   327
                MY_CLASS_NAME + "$TestIORToSocketInfo" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   328
            ParserDataFactory.make( ORBConstants.IIOP_PRIMARY_TO_CONTACT_INFO_CLASS_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   329
                makeIIOPPrimaryToContactInfoOperation(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   330
                "iiopPrimaryToContactInfo", null,
02bb8761fcce Initial load
duke
parents:
diff changeset
   331
                new TestIIOPPrimaryToContactInfo(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   332
                MY_CLASS_NAME + "$TestIIOPPrimaryToContactInfo" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   333
            ParserDataFactory.make( ORBConstants.CONTACT_INFO_LIST_FACTORY_CLASS_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   334
                makeContactInfoListFactoryOperation(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   335
                "corbaContactInfoListFactory", null,
02bb8761fcce Initial load
duke
parents:
diff changeset
   336
                new TestContactInfoListFactory(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   337
                MY_CLASS_NAME + "$TestContactInfoListFactory" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   338
            ParserDataFactory.make( ORBConstants.PERSISTENT_SERVER_PORT_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   339
                OperationFactory.integerAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   340
                "persistentServerPort", new Integer( 0 ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   341
                new Integer( 2743 ), "2743" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   342
            ParserDataFactory.make( ORBConstants.PERSISTENT_SERVER_PORT_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   343
                OperationFactory.setFlagAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   344
                "persistentPortInitialized", Boolean.FALSE,
02bb8761fcce Initial load
duke
parents:
diff changeset
   345
                Boolean.TRUE, "2743" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   346
            ParserDataFactory.make( ORBConstants.SERVER_ID_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   347
                OperationFactory.integerAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   348
                "persistentServerId", new Integer( 0 ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   349
                new Integer( 294 ), "294" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   350
            ParserDataFactory.make( ORBConstants.SERVER_ID_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   351
                OperationFactory.setFlagAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   352
                "persistentServerIdInitialized", Boolean.FALSE,
02bb8761fcce Initial load
duke
parents:
diff changeset
   353
                Boolean.TRUE, "294" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   354
            ParserDataFactory.make( ORBConstants.SERVER_ID_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   355
                OperationFactory.setFlagAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   356
                "orbServerIdPropertySpecified", Boolean.FALSE,
02bb8761fcce Initial load
duke
parents:
diff changeset
   357
                Boolean.TRUE, "294" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   358
            ParserDataFactory.make( ORBConstants.ACTIVATED_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   359
                OperationFactory.booleanAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   360
                "serverIsORBActivated", Boolean.FALSE,
02bb8761fcce Initial load
duke
parents:
diff changeset
   361
                Boolean.TRUE, "true" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   362
            ParserDataFactory.make( ORBConstants.BAD_SERVER_ID_HANDLER_CLASS_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   363
                OperationFactory.classAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   364
                "badServerIdHandlerClass", null,
02bb8761fcce Initial load
duke
parents:
diff changeset
   365
                TestBadServerIdHandler.class, MY_CLASS_NAME + "$TestBadServerIdHandler" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   366
            ParserDataFactory.make( ORBConstants.PI_ORB_INITIALIZER_CLASS_PREFIX,
02bb8761fcce Initial load
duke
parents:
diff changeset
   367
                makeROIOperation(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   368
                "orbInitializers", new ORBInitializer[0],
02bb8761fcce Initial load
duke
parents:
diff changeset
   369
                TestORBInitializers, TestORBInitData, ORBInitializer.class ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   370
            ParserDataFactory.make( ORBConstants.ACCEPTOR_CLASS_PREFIX_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   371
                makeAcceptorInstantiationOperation(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   372
                "acceptors", new Acceptor[0],
02bb8761fcce Initial load
duke
parents:
diff changeset
   373
                TestAcceptors, TestAcceptorData, Acceptor.class ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   374
02bb8761fcce Initial load
duke
parents:
diff changeset
   375
            //
02bb8761fcce Initial load
duke
parents:
diff changeset
   376
            // Socket/Channel control
02bb8761fcce Initial load
duke
parents:
diff changeset
   377
            //
02bb8761fcce Initial load
duke
parents:
diff changeset
   378
02bb8761fcce Initial load
duke
parents:
diff changeset
   379
            // Acceptor:
02bb8761fcce Initial load
duke
parents:
diff changeset
   380
            // useNIOSelector == true
02bb8761fcce Initial load
duke
parents:
diff changeset
   381
            //   useSelectThreadToWait = true
02bb8761fcce Initial load
duke
parents:
diff changeset
   382
            //   useWorkerThreadForEvent = false
02bb8761fcce Initial load
duke
parents:
diff changeset
   383
            // else
02bb8761fcce Initial load
duke
parents:
diff changeset
   384
            //   useSelectThreadToWait = false
02bb8761fcce Initial load
duke
parents:
diff changeset
   385
            //   useWorkerThreadForEvent = true
02bb8761fcce Initial load
duke
parents:
diff changeset
   386
02bb8761fcce Initial load
duke
parents:
diff changeset
   387
            // Connection:
02bb8761fcce Initial load
duke
parents:
diff changeset
   388
            // useNIOSelector == true
02bb8761fcce Initial load
duke
parents:
diff changeset
   389
            //   useSelectThreadToWait = true
02bb8761fcce Initial load
duke
parents:
diff changeset
   390
            //   useWorkerThreadForEvent = true
02bb8761fcce Initial load
duke
parents:
diff changeset
   391
            // else
02bb8761fcce Initial load
duke
parents:
diff changeset
   392
            //   useSelectThreadToWait = false
02bb8761fcce Initial load
duke
parents:
diff changeset
   393
            //   useWorkerThreadForEvent = true
02bb8761fcce Initial load
duke
parents:
diff changeset
   394
02bb8761fcce Initial load
duke
parents:
diff changeset
   395
            ParserDataFactory.make( ORBConstants.ACCEPTOR_SOCKET_TYPE_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   396
                OperationFactory.stringAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   397
                "acceptorSocketType", ORBConstants.SOCKETCHANNEL,
02bb8761fcce Initial load
duke
parents:
diff changeset
   398
                "foo", "foo" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   399
02bb8761fcce Initial load
duke
parents:
diff changeset
   400
            ParserDataFactory.make( ORBConstants.USE_NIO_SELECT_TO_WAIT_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   401
                OperationFactory.booleanAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   402
                "acceptorSocketUseSelectThreadToWait", Boolean.TRUE,
02bb8761fcce Initial load
duke
parents:
diff changeset
   403
                Boolean.TRUE, "true" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   404
            ParserDataFactory.make( ORBConstants.ACCEPTOR_SOCKET_USE_WORKER_THREAD_FOR_EVENT_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   405
                OperationFactory.booleanAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   406
                "acceptorSocketUseWorkerThreadForEvent", Boolean.TRUE,
02bb8761fcce Initial load
duke
parents:
diff changeset
   407
                Boolean.TRUE, "true" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   408
            ParserDataFactory.make( ORBConstants.CONNECTION_SOCKET_TYPE_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   409
                OperationFactory.stringAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   410
                "connectionSocketType", ORBConstants.SOCKETCHANNEL,
02bb8761fcce Initial load
duke
parents:
diff changeset
   411
                "foo", "foo" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   412
            ParserDataFactory.make( ORBConstants.USE_NIO_SELECT_TO_WAIT_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   413
                OperationFactory.booleanAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   414
                "connectionSocketUseSelectThreadToWait", Boolean.TRUE,
02bb8761fcce Initial load
duke
parents:
diff changeset
   415
                Boolean.TRUE, "true" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   416
            ParserDataFactory.make( ORBConstants.CONNECTION_SOCKET_USE_WORKER_THREAD_FOR_EVENT_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   417
                OperationFactory.booleanAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   418
                "connectionSocketUseWorkerThreadForEvent", Boolean.TRUE,
02bb8761fcce Initial load
duke
parents:
diff changeset
   419
                Boolean.TRUE, "true" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   420
            ParserDataFactory.make( ORBConstants.DISABLE_DIRECT_BYTE_BUFFER_USE_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   421
                OperationFactory.booleanAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   422
                "disableDirectByteBufferUse", Boolean.FALSE,
02bb8761fcce Initial load
duke
parents:
diff changeset
   423
                Boolean.TRUE, "true" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   424
            ParserDataFactory.make(ORBConstants.TRANSPORT_TCP_READ_TIMEOUTS_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   425
                makeTTCPRTOperation(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   426
                "readTimeouts",  TransportDefault.makeReadTimeoutsFactory().create(
02bb8761fcce Initial load
duke
parents:
diff changeset
   427
                    ORBConstants.TRANSPORT_TCP_INITIAL_TIME_TO_WAIT,
02bb8761fcce Initial load
duke
parents:
diff changeset
   428
                    ORBConstants.TRANSPORT_TCP_MAX_TIME_TO_WAIT,
02bb8761fcce Initial load
duke
parents:
diff changeset
   429
                    ORBConstants.TRANSPORT_TCP_GIOP_HEADER_MAX_TIME_TO_WAIT,
02bb8761fcce Initial load
duke
parents:
diff changeset
   430
                    ORBConstants.TRANSPORT_TCP_TIME_TO_WAIT_BACKOFF_FACTOR),
02bb8761fcce Initial load
duke
parents:
diff changeset
   431
                readTimeouts, "100:3000:300:20" ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   432
            ParserDataFactory.make(
02bb8761fcce Initial load
duke
parents:
diff changeset
   433
                ORBConstants.ENABLE_JAVA_SERIALIZATION_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   434
                OperationFactory.booleanAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   435
                "enableJavaSerialization", Boolean.FALSE,
02bb8761fcce Initial load
duke
parents:
diff changeset
   436
                Boolean.FALSE, "false"),
02bb8761fcce Initial load
duke
parents:
diff changeset
   437
            ParserDataFactory.make(
02bb8761fcce Initial load
duke
parents:
diff changeset
   438
                ORBConstants.USE_REP_ID,
02bb8761fcce Initial load
duke
parents:
diff changeset
   439
                OperationFactory.booleanAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   440
                "useRepId", Boolean.TRUE,
02bb8761fcce Initial load
duke
parents:
diff changeset
   441
                Boolean.TRUE, "true"),
02bb8761fcce Initial load
duke
parents:
diff changeset
   442
            ParserDataFactory.make( ORBConstants.ORB_INIT_REF_PROPERTY,
02bb8761fcce Initial load
duke
parents:
diff changeset
   443
                OperationFactory.identityAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   444
                "orbInitialReferences", new StringPair[0],
02bb8761fcce Initial load
duke
parents:
diff changeset
   445
                TestORBInitRefData, TestORBInitRefData, StringPair.class )
02bb8761fcce Initial load
duke
parents:
diff changeset
   446
        } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   447
02bb8761fcce Initial load
duke
parents:
diff changeset
   448
        parserData = pd ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   449
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   450
02bb8761fcce Initial load
duke
parents:
diff changeset
   451
    public final class TestBadServerIdHandler implements BadServerIdHandler
02bb8761fcce Initial load
duke
parents:
diff changeset
   452
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   453
        public boolean equals( Object other )
02bb8761fcce Initial load
duke
parents:
diff changeset
   454
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   455
            return other instanceof TestBadServerIdHandler ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   456
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   457
18302
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   458
        public int hashCode() {
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   459
            return 1;
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   460
        }
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   461
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   462
        public void handle( ObjectKey objectKey )
02bb8761fcce Initial load
duke
parents:
diff changeset
   463
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   464
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   465
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   466
02bb8761fcce Initial load
duke
parents:
diff changeset
   467
    private Operation makeTTCPRTOperation()
02bb8761fcce Initial load
duke
parents:
diff changeset
   468
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   469
        Operation[] fourIop = { OperationFactory.integerAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   470
                                OperationFactory.integerAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   471
                                OperationFactory.integerAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   472
                                OperationFactory.integerAction() } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   473
02bb8761fcce Initial load
duke
parents:
diff changeset
   474
        Operation op2 = OperationFactory.sequenceAction( ":", fourIop ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   475
02bb8761fcce Initial load
duke
parents:
diff changeset
   476
        Operation rtOp = new Operation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   477
            public Object operate(Object value)
02bb8761fcce Initial load
duke
parents:
diff changeset
   478
            {
02bb8761fcce Initial load
duke
parents:
diff changeset
   479
                Object[] values = (Object[])value ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   480
                Integer initialTime = (Integer)(values[0]) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   481
                Integer maxGIOPHdrTime = (Integer)(values[1]) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   482
                Integer maxGIOPBodyTime = (Integer)(values[2]) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   483
                Integer backoffPercent = (Integer)(values[3]) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   484
                return TransportDefault.makeReadTimeoutsFactory().create(
02bb8761fcce Initial load
duke
parents:
diff changeset
   485
                                                   initialTime.intValue(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   486
                                                   maxGIOPHdrTime.intValue(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   487
                                                   maxGIOPBodyTime.intValue(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   488
                                                   backoffPercent.intValue());
02bb8761fcce Initial load
duke
parents:
diff changeset
   489
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   490
        } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   491
02bb8761fcce Initial load
duke
parents:
diff changeset
   492
        Operation ttcprtOp = OperationFactory.compose(op2, rtOp);
02bb8761fcce Initial load
duke
parents:
diff changeset
   493
        return ttcprtOp;
02bb8761fcce Initial load
duke
parents:
diff changeset
   494
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   495
02bb8761fcce Initial load
duke
parents:
diff changeset
   496
    private Operation makeUSLOperation()
02bb8761fcce Initial load
duke
parents:
diff changeset
   497
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   498
        Operation[] siop = { OperationFactory.stringAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   499
            OperationFactory.integerAction() } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   500
        Operation op2 = OperationFactory.sequenceAction( ":", siop ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   501
02bb8761fcce Initial load
duke
parents:
diff changeset
   502
        Operation uslop = new Operation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   503
            public Object operate( Object value )
02bb8761fcce Initial load
duke
parents:
diff changeset
   504
            {
02bb8761fcce Initial load
duke
parents:
diff changeset
   505
                Object[] values = (Object[])value ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   506
                String type = (String)(values[0]) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   507
                Integer port = (Integer)(values[1]) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   508
                return new USLPort( type, port.intValue() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   509
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   510
        } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   511
02bb8761fcce Initial load
duke
parents:
diff changeset
   512
        Operation op3 = OperationFactory.compose( op2, uslop ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   513
        Operation listenop = OperationFactory.listAction( ",", op3 ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   514
        return listenop ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   515
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   516
02bb8761fcce Initial load
duke
parents:
diff changeset
   517
    public static final class TestLegacyORBSocketFactory
02bb8761fcce Initial load
duke
parents:
diff changeset
   518
        implements com.sun.corba.se.spi.legacy.connection.ORBSocketFactory
02bb8761fcce Initial load
duke
parents:
diff changeset
   519
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   520
        public boolean equals( Object other )
02bb8761fcce Initial load
duke
parents:
diff changeset
   521
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   522
            return other instanceof TestLegacyORBSocketFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   523
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   524
18302
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   525
        public int hashCode() {
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   526
            return 1;
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   527
        }
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   528
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   529
        public ServerSocket createServerSocket( String type, int port )
02bb8761fcce Initial load
duke
parents:
diff changeset
   530
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   531
            return null ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   532
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   533
02bb8761fcce Initial load
duke
parents:
diff changeset
   534
        public SocketInfo getEndPointInfo( org.omg.CORBA.ORB orb,
02bb8761fcce Initial load
duke
parents:
diff changeset
   535
            IOR ior, SocketInfo socketInfo )
02bb8761fcce Initial load
duke
parents:
diff changeset
   536
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   537
            return null ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   538
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   539
02bb8761fcce Initial load
duke
parents:
diff changeset
   540
        public Socket createSocket( SocketInfo socketInfo )
02bb8761fcce Initial load
duke
parents:
diff changeset
   541
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   542
            return null ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   543
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   544
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   545
02bb8761fcce Initial load
duke
parents:
diff changeset
   546
    public static final class TestORBSocketFactory
02bb8761fcce Initial load
duke
parents:
diff changeset
   547
        implements com.sun.corba.se.spi.transport.ORBSocketFactory
02bb8761fcce Initial load
duke
parents:
diff changeset
   548
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   549
        public boolean equals( Object other )
02bb8761fcce Initial load
duke
parents:
diff changeset
   550
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   551
            return other instanceof TestORBSocketFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   552
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   553
18302
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   554
        public int hashCode() {
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   555
            return 1;
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   556
        }
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   557
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   558
        public void setORB(ORB orb)
02bb8761fcce Initial load
duke
parents:
diff changeset
   559
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   560
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   561
02bb8761fcce Initial load
duke
parents:
diff changeset
   562
        public ServerSocket createServerSocket( String type, InetSocketAddress a )
02bb8761fcce Initial load
duke
parents:
diff changeset
   563
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   564
            return null ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   565
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   566
02bb8761fcce Initial load
duke
parents:
diff changeset
   567
        public Socket createSocket( String type, InetSocketAddress a )
02bb8761fcce Initial load
duke
parents:
diff changeset
   568
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   569
            return null ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   570
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   571
02bb8761fcce Initial load
duke
parents:
diff changeset
   572
        public void setAcceptedSocketOptions(Acceptor acceptor,
02bb8761fcce Initial load
duke
parents:
diff changeset
   573
                                             ServerSocket serverSocket,
02bb8761fcce Initial load
duke
parents:
diff changeset
   574
                                             Socket socket)
02bb8761fcce Initial load
duke
parents:
diff changeset
   575
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   576
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   577
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   578
02bb8761fcce Initial load
duke
parents:
diff changeset
   579
    public static final class TestIORToSocketInfo
02bb8761fcce Initial load
duke
parents:
diff changeset
   580
        implements IORToSocketInfo
02bb8761fcce Initial load
duke
parents:
diff changeset
   581
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   582
        public boolean equals( Object other )
02bb8761fcce Initial load
duke
parents:
diff changeset
   583
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   584
            return other instanceof TestIORToSocketInfo;
02bb8761fcce Initial load
duke
parents:
diff changeset
   585
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   586
18302
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   587
        public int hashCode() {
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   588
            return 1;
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   589
        }
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   590
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   591
        public List getSocketInfo(IOR ior)
02bb8761fcce Initial load
duke
parents:
diff changeset
   592
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   593
            return null;
02bb8761fcce Initial load
duke
parents:
diff changeset
   594
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   595
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   596
02bb8761fcce Initial load
duke
parents:
diff changeset
   597
    public static final class TestIIOPPrimaryToContactInfo
02bb8761fcce Initial load
duke
parents:
diff changeset
   598
        implements IIOPPrimaryToContactInfo
02bb8761fcce Initial load
duke
parents:
diff changeset
   599
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   600
        public void reset(ContactInfo primary)
02bb8761fcce Initial load
duke
parents:
diff changeset
   601
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   602
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   603
02bb8761fcce Initial load
duke
parents:
diff changeset
   604
        public boolean hasNext(ContactInfo primary,
02bb8761fcce Initial load
duke
parents:
diff changeset
   605
                               ContactInfo previous,
02bb8761fcce Initial load
duke
parents:
diff changeset
   606
                               List contactInfos)
02bb8761fcce Initial load
duke
parents:
diff changeset
   607
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   608
            return true;
02bb8761fcce Initial load
duke
parents:
diff changeset
   609
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   610
02bb8761fcce Initial load
duke
parents:
diff changeset
   611
        public ContactInfo next(ContactInfo primary,
02bb8761fcce Initial load
duke
parents:
diff changeset
   612
                                ContactInfo previous,
02bb8761fcce Initial load
duke
parents:
diff changeset
   613
                                List contactInfos)
02bb8761fcce Initial load
duke
parents:
diff changeset
   614
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   615
            return null;
02bb8761fcce Initial load
duke
parents:
diff changeset
   616
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   617
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   618
02bb8761fcce Initial load
duke
parents:
diff changeset
   619
    public static final class TestContactInfoListFactory
02bb8761fcce Initial load
duke
parents:
diff changeset
   620
        implements CorbaContactInfoListFactory
02bb8761fcce Initial load
duke
parents:
diff changeset
   621
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   622
        public boolean equals( Object other )
02bb8761fcce Initial load
duke
parents:
diff changeset
   623
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   624
            return other instanceof TestContactInfoListFactory;
02bb8761fcce Initial load
duke
parents:
diff changeset
   625
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   626
18302
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   627
        public int hashCode() {
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   628
            return 1;
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   629
        }
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   630
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   631
        public void setORB(ORB orb) { }
02bb8761fcce Initial load
duke
parents:
diff changeset
   632
02bb8761fcce Initial load
duke
parents:
diff changeset
   633
        public CorbaContactInfoList create( IOR ior ) { return null; }
02bb8761fcce Initial load
duke
parents:
diff changeset
   634
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   635
02bb8761fcce Initial load
duke
parents:
diff changeset
   636
    private Operation makeMapOperation( final Map map )
02bb8761fcce Initial load
duke
parents:
diff changeset
   637
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   638
        return new Operation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   639
            public Object operate( Object value )
02bb8761fcce Initial load
duke
parents:
diff changeset
   640
            {
02bb8761fcce Initial load
duke
parents:
diff changeset
   641
                return map.get( value ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   642
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   643
        } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   644
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   645
02bb8761fcce Initial load
duke
parents:
diff changeset
   646
    private Operation makeBMGROperation()
02bb8761fcce Initial load
duke
parents:
diff changeset
   647
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   648
        Map map = new HashMap() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   649
        map.put( "GROW", new Integer(0) ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   650
        map.put( "CLCT", new Integer(1) ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   651
        map.put( "STRM", new Integer(2) ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   652
        return makeMapOperation( map ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   653
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   654
02bb8761fcce Initial load
duke
parents:
diff changeset
   655
    private Operation makeLegacySocketFactoryOperation()
02bb8761fcce Initial load
duke
parents:
diff changeset
   656
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   657
        Operation sfop = new Operation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   658
            public Object operate( Object value )
02bb8761fcce Initial load
duke
parents:
diff changeset
   659
            {
02bb8761fcce Initial load
duke
parents:
diff changeset
   660
                String param = (String)value ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   661
02bb8761fcce Initial load
duke
parents:
diff changeset
   662
                try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   663
                    Class legacySocketFactoryClass =
02bb8761fcce Initial load
duke
parents:
diff changeset
   664
                        ORBClassLoader.loadClass(param);
02bb8761fcce Initial load
duke
parents:
diff changeset
   665
                    // For security reasons avoid creating an instance if
02bb8761fcce Initial load
duke
parents:
diff changeset
   666
                    // this socket factory class is not one that would fail
02bb8761fcce Initial load
duke
parents:
diff changeset
   667
                    // the class cast anyway.
02bb8761fcce Initial load
duke
parents:
diff changeset
   668
                    if (com.sun.corba.se.spi.legacy.connection.ORBSocketFactory.class.isAssignableFrom(legacySocketFactoryClass)) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   669
                        return legacySocketFactoryClass.newInstance();
02bb8761fcce Initial load
duke
parents:
diff changeset
   670
                    } else {
02bb8761fcce Initial load
duke
parents:
diff changeset
   671
                        throw wrapper.illegalSocketFactoryType( legacySocketFactoryClass.toString() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   672
                    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   673
                } catch (Exception ex) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   674
                    // ClassNotFoundException, IllegalAccessException,
02bb8761fcce Initial load
duke
parents:
diff changeset
   675
                    // InstantiationException, SecurityException or
02bb8761fcce Initial load
duke
parents:
diff changeset
   676
                    // ClassCastException
02bb8761fcce Initial load
duke
parents:
diff changeset
   677
                    throw wrapper.badCustomSocketFactory( ex, param ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   678
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   679
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   680
        } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   681
02bb8761fcce Initial load
duke
parents:
diff changeset
   682
        return sfop ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   683
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   684
02bb8761fcce Initial load
duke
parents:
diff changeset
   685
    private Operation makeSocketFactoryOperation()
02bb8761fcce Initial load
duke
parents:
diff changeset
   686
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   687
        Operation sfop = new Operation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   688
            public Object operate( Object value )
02bb8761fcce Initial load
duke
parents:
diff changeset
   689
            {
02bb8761fcce Initial load
duke
parents:
diff changeset
   690
                String param = (String)value ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   691
02bb8761fcce Initial load
duke
parents:
diff changeset
   692
                try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   693
                    Class socketFactoryClass = ORBClassLoader.loadClass(param);
02bb8761fcce Initial load
duke
parents:
diff changeset
   694
                    // For security reasons avoid creating an instance if
02bb8761fcce Initial load
duke
parents:
diff changeset
   695
                    // this socket factory class is not one that would fail
02bb8761fcce Initial load
duke
parents:
diff changeset
   696
                    // the class cast anyway.
02bb8761fcce Initial load
duke
parents:
diff changeset
   697
                    if (com.sun.corba.se.spi.transport.ORBSocketFactory.class.isAssignableFrom(socketFactoryClass)) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   698
                        return socketFactoryClass.newInstance();
02bb8761fcce Initial load
duke
parents:
diff changeset
   699
                    } else {
02bb8761fcce Initial load
duke
parents:
diff changeset
   700
                        throw wrapper.illegalSocketFactoryType( socketFactoryClass.toString() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   701
                    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   702
                } catch (Exception ex) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   703
                    // ClassNotFoundException, IllegalAccessException,
02bb8761fcce Initial load
duke
parents:
diff changeset
   704
                    // InstantiationException, SecurityException or
02bb8761fcce Initial load
duke
parents:
diff changeset
   705
                    // ClassCastException
02bb8761fcce Initial load
duke
parents:
diff changeset
   706
                    throw wrapper.badCustomSocketFactory( ex, param ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   707
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   708
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   709
        } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   710
02bb8761fcce Initial load
duke
parents:
diff changeset
   711
        return sfop ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   712
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   713
02bb8761fcce Initial load
duke
parents:
diff changeset
   714
    private Operation makeIORToSocketInfoOperation()
02bb8761fcce Initial load
duke
parents:
diff changeset
   715
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   716
        Operation op = new Operation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   717
            public Object operate( Object value )
02bb8761fcce Initial load
duke
parents:
diff changeset
   718
            {
02bb8761fcce Initial load
duke
parents:
diff changeset
   719
                String param = (String)value ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   720
02bb8761fcce Initial load
duke
parents:
diff changeset
   721
                try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   722
                    Class iorToSocketInfoClass = ORBClassLoader.loadClass(param);
02bb8761fcce Initial load
duke
parents:
diff changeset
   723
                    // For security reasons avoid creating an instance if
02bb8761fcce Initial load
duke
parents:
diff changeset
   724
                    // this socket factory class is not one that would fail
02bb8761fcce Initial load
duke
parents:
diff changeset
   725
                    // the class cast anyway.
02bb8761fcce Initial load
duke
parents:
diff changeset
   726
                    if (IORToSocketInfo.class.isAssignableFrom(iorToSocketInfoClass)) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   727
                        return iorToSocketInfoClass.newInstance();
02bb8761fcce Initial load
duke
parents:
diff changeset
   728
                    } else {
02bb8761fcce Initial load
duke
parents:
diff changeset
   729
                        throw wrapper.illegalIorToSocketInfoType( iorToSocketInfoClass.toString() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   730
                    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   731
                } catch (Exception ex) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   732
                    // ClassNotFoundException, IllegalAccessException,
02bb8761fcce Initial load
duke
parents:
diff changeset
   733
                    // InstantiationException, SecurityException or
02bb8761fcce Initial load
duke
parents:
diff changeset
   734
                    // ClassCastException
02bb8761fcce Initial load
duke
parents:
diff changeset
   735
                    throw wrapper.badCustomIorToSocketInfo( ex, param ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   736
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   737
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   738
        } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   739
02bb8761fcce Initial load
duke
parents:
diff changeset
   740
        return op ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   741
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   742
02bb8761fcce Initial load
duke
parents:
diff changeset
   743
    private Operation makeIIOPPrimaryToContactInfoOperation()
02bb8761fcce Initial load
duke
parents:
diff changeset
   744
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   745
        Operation op = new Operation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   746
            public Object operate( Object value )
02bb8761fcce Initial load
duke
parents:
diff changeset
   747
            {
02bb8761fcce Initial load
duke
parents:
diff changeset
   748
                String param = (String)value ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   749
02bb8761fcce Initial load
duke
parents:
diff changeset
   750
                try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   751
                    Class iiopPrimaryToContactInfoClass = ORBClassLoader.loadClass(param);
02bb8761fcce Initial load
duke
parents:
diff changeset
   752
                    // For security reasons avoid creating an instance if
02bb8761fcce Initial load
duke
parents:
diff changeset
   753
                    // this socket factory class is not one that would fail
02bb8761fcce Initial load
duke
parents:
diff changeset
   754
                    // the class cast anyway.
02bb8761fcce Initial load
duke
parents:
diff changeset
   755
                    if (IIOPPrimaryToContactInfo.class.isAssignableFrom(iiopPrimaryToContactInfoClass)) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   756
                        return iiopPrimaryToContactInfoClass.newInstance();
02bb8761fcce Initial load
duke
parents:
diff changeset
   757
                    } else {
02bb8761fcce Initial load
duke
parents:
diff changeset
   758
                        throw wrapper.illegalIiopPrimaryToContactInfoType( iiopPrimaryToContactInfoClass.toString() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   759
                    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   760
                } catch (Exception ex) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   761
                    // ClassNotFoundException, IllegalAccessException,
02bb8761fcce Initial load
duke
parents:
diff changeset
   762
                    // InstantiationException, SecurityException or
02bb8761fcce Initial load
duke
parents:
diff changeset
   763
                    // ClassCastException
02bb8761fcce Initial load
duke
parents:
diff changeset
   764
                    throw wrapper.badCustomIiopPrimaryToContactInfo( ex, param ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   765
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   766
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   767
        } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   768
02bb8761fcce Initial load
duke
parents:
diff changeset
   769
        return op ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   770
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   771
02bb8761fcce Initial load
duke
parents:
diff changeset
   772
    private Operation makeContactInfoListFactoryOperation()
02bb8761fcce Initial load
duke
parents:
diff changeset
   773
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   774
        Operation op = new Operation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   775
            public Object operate( Object value )
02bb8761fcce Initial load
duke
parents:
diff changeset
   776
            {
02bb8761fcce Initial load
duke
parents:
diff changeset
   777
                String param = (String)value ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   778
02bb8761fcce Initial load
duke
parents:
diff changeset
   779
                try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   780
                    Class contactInfoListFactoryClass =
02bb8761fcce Initial load
duke
parents:
diff changeset
   781
                        ORBClassLoader.loadClass(param);
02bb8761fcce Initial load
duke
parents:
diff changeset
   782
                    // For security reasons avoid creating an instance if
02bb8761fcce Initial load
duke
parents:
diff changeset
   783
                    // this socket factory class is not one that would fail
02bb8761fcce Initial load
duke
parents:
diff changeset
   784
                    // the class cast anyway.
02bb8761fcce Initial load
duke
parents:
diff changeset
   785
                    if (CorbaContactInfoListFactory.class.isAssignableFrom(
02bb8761fcce Initial load
duke
parents:
diff changeset
   786
                        contactInfoListFactoryClass)) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   787
                        return contactInfoListFactoryClass.newInstance();
02bb8761fcce Initial load
duke
parents:
diff changeset
   788
                    } else {
02bb8761fcce Initial load
duke
parents:
diff changeset
   789
                        throw wrapper.illegalContactInfoListFactoryType(
02bb8761fcce Initial load
duke
parents:
diff changeset
   790
                            contactInfoListFactoryClass.toString() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   791
                    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   792
                } catch (Exception ex) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   793
                    // ClassNotFoundException, IllegalAccessException,
02bb8761fcce Initial load
duke
parents:
diff changeset
   794
                    // InstantiationException, SecurityException or
02bb8761fcce Initial load
duke
parents:
diff changeset
   795
                    // ClassCastException
02bb8761fcce Initial load
duke
parents:
diff changeset
   796
                    throw wrapper.badContactInfoListFactory( ex, param ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   797
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   798
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   799
        } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   800
02bb8761fcce Initial load
duke
parents:
diff changeset
   801
        return op ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   802
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   803
02bb8761fcce Initial load
duke
parents:
diff changeset
   804
    private Operation makeCSOperation()
02bb8761fcce Initial load
duke
parents:
diff changeset
   805
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   806
        Operation csop = new Operation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   807
            public Object operate( Object value )
02bb8761fcce Initial load
duke
parents:
diff changeset
   808
            {
02bb8761fcce Initial load
duke
parents:
diff changeset
   809
                String val = (String)value ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   810
                return CodeSetComponentInfo.createFromString( val ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   811
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   812
        } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   813
02bb8761fcce Initial load
duke
parents:
diff changeset
   814
        return csop ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   815
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   816
02bb8761fcce Initial load
duke
parents:
diff changeset
   817
    private Operation makeADOperation()
02bb8761fcce Initial load
duke
parents:
diff changeset
   818
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   819
        Operation admap = new Operation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   820
            private Integer[] map = {
02bb8761fcce Initial load
duke
parents:
diff changeset
   821
                new Integer( KeyAddr.value ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   822
                new Integer( ProfileAddr.value ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   823
                new Integer( ReferenceAddr.value ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   824
                new Integer( KeyAddr.value ) } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   825
02bb8761fcce Initial load
duke
parents:
diff changeset
   826
            public Object operate( Object value )
02bb8761fcce Initial load
duke
parents:
diff changeset
   827
            {
02bb8761fcce Initial load
duke
parents:
diff changeset
   828
                int val = ((Integer)value).intValue() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   829
                return map[val] ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   830
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   831
        } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   832
02bb8761fcce Initial load
duke
parents:
diff changeset
   833
        Operation rangeop = OperationFactory.integerRangeAction( 0, 3 ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   834
        Operation op1 = OperationFactory.compose( rangeop, admap ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   835
        Operation result = OperationFactory.compose( op1, OperationFactory.convertIntegerToShort() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   836
        return result ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   837
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   838
02bb8761fcce Initial load
duke
parents:
diff changeset
   839
    private Operation makeFSOperation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   840
        Operation fschecker = new Operation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   841
            public Object operate( Object value )
02bb8761fcce Initial load
duke
parents:
diff changeset
   842
            {
02bb8761fcce Initial load
duke
parents:
diff changeset
   843
                int giopFragmentSize = ((Integer)value).intValue() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   844
                if (giopFragmentSize < ORBConstants.GIOP_FRAGMENT_MINIMUM_SIZE){
02bb8761fcce Initial load
duke
parents:
diff changeset
   845
                    throw wrapper.fragmentSizeMinimum( new Integer( giopFragmentSize ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   846
                        new Integer( ORBConstants.GIOP_FRAGMENT_MINIMUM_SIZE ) ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   847
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   848
02bb8761fcce Initial load
duke
parents:
diff changeset
   849
                if (giopFragmentSize % ORBConstants.GIOP_FRAGMENT_DIVISOR != 0)
02bb8761fcce Initial load
duke
parents:
diff changeset
   850
                    throw wrapper.fragmentSizeDiv( new Integer( giopFragmentSize ),
02bb8761fcce Initial load
duke
parents:
diff changeset
   851
                            new Integer( ORBConstants.GIOP_FRAGMENT_DIVISOR ) ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   852
02bb8761fcce Initial load
duke
parents:
diff changeset
   853
                return value ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   854
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   855
        } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   856
02bb8761fcce Initial load
duke
parents:
diff changeset
   857
        Operation result = OperationFactory.compose( OperationFactory.integerAction(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   858
            fschecker ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   859
        return result ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   860
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   861
02bb8761fcce Initial load
duke
parents:
diff changeset
   862
    private Operation makeGVOperation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   863
        Operation gvHelper = OperationFactory.listAction( ".",
02bb8761fcce Initial load
duke
parents:
diff changeset
   864
            OperationFactory.integerAction() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   865
        Operation gvMain = new Operation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   866
            public Object operate( Object value )
02bb8761fcce Initial load
duke
parents:
diff changeset
   867
            {
02bb8761fcce Initial load
duke
parents:
diff changeset
   868
                Object[] nums = (Object[])value ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   869
                int major = ((Integer)(nums[0])).intValue() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   870
                int minor = ((Integer)(nums[1])).intValue() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   871
02bb8761fcce Initial load
duke
parents:
diff changeset
   872
                return new GIOPVersion( major, minor ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   873
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   874
        } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   875
02bb8761fcce Initial load
duke
parents:
diff changeset
   876
        Operation result = OperationFactory.compose( gvHelper, gvMain );
02bb8761fcce Initial load
duke
parents:
diff changeset
   877
        return result ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   878
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   879
02bb8761fcce Initial load
duke
parents:
diff changeset
   880
    public static final class TestORBInitializer1 extends org.omg.CORBA.LocalObject
02bb8761fcce Initial load
duke
parents:
diff changeset
   881
        implements ORBInitializer
02bb8761fcce Initial load
duke
parents:
diff changeset
   882
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   883
        public boolean equals( Object other )
02bb8761fcce Initial load
duke
parents:
diff changeset
   884
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   885
            return other instanceof TestORBInitializer1 ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   886
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   887
18302
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   888
        public int hashCode() {
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   889
            return 1;
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   890
        }
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   891
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   892
        public void pre_init( ORBInitInfo info )
02bb8761fcce Initial load
duke
parents:
diff changeset
   893
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   894
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   895
02bb8761fcce Initial load
duke
parents:
diff changeset
   896
        public void post_init( ORBInitInfo info )
02bb8761fcce Initial load
duke
parents:
diff changeset
   897
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   898
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   899
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   900
02bb8761fcce Initial load
duke
parents:
diff changeset
   901
    public static final class TestORBInitializer2 extends org.omg.CORBA.LocalObject
02bb8761fcce Initial load
duke
parents:
diff changeset
   902
        implements ORBInitializer
02bb8761fcce Initial load
duke
parents:
diff changeset
   903
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   904
        public boolean equals( Object other )
02bb8761fcce Initial load
duke
parents:
diff changeset
   905
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   906
            return other instanceof TestORBInitializer2 ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   907
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   908
18302
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   909
        public int hashCode() {
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   910
            return 1;
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   911
        }
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   912
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   913
        public void pre_init( ORBInitInfo info )
02bb8761fcce Initial load
duke
parents:
diff changeset
   914
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   915
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   916
02bb8761fcce Initial load
duke
parents:
diff changeset
   917
        public void post_init( ORBInitInfo info )
02bb8761fcce Initial load
duke
parents:
diff changeset
   918
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   919
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   920
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   921
02bb8761fcce Initial load
duke
parents:
diff changeset
   922
    private Operation makeROIOperation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   923
        Operation clsop = OperationFactory.classAction() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   924
        Operation indexOp = OperationFactory.suffixAction() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   925
        Operation op1 = OperationFactory.compose( indexOp, clsop ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   926
        Operation mop = OperationFactory.maskErrorAction( op1 ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   927
02bb8761fcce Initial load
duke
parents:
diff changeset
   928
        Operation mkinst = new Operation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   929
            public Object operate( Object value )
02bb8761fcce Initial load
duke
parents:
diff changeset
   930
            {
02bb8761fcce Initial load
duke
parents:
diff changeset
   931
                final Class initClass = (Class)value ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   932
                if (initClass == null)
02bb8761fcce Initial load
duke
parents:
diff changeset
   933
                    return null ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   934
02bb8761fcce Initial load
duke
parents:
diff changeset
   935
                // For security reasons avoid creating an instance
02bb8761fcce Initial load
duke
parents:
diff changeset
   936
                // if this class is one that would fail the class cast
02bb8761fcce Initial load
duke
parents:
diff changeset
   937
                // to ORBInitializer anyway.
02bb8761fcce Initial load
duke
parents:
diff changeset
   938
                if( org.omg.PortableInterceptor.ORBInitializer.class.isAssignableFrom(
02bb8761fcce Initial load
duke
parents:
diff changeset
   939
                    initClass ) ) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   940
                    // Now that we have a class object, instantiate one and
02bb8761fcce Initial load
duke
parents:
diff changeset
   941
                    // remember it:
02bb8761fcce Initial load
duke
parents:
diff changeset
   942
                    ORBInitializer initializer = null ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   943
02bb8761fcce Initial load
duke
parents:
diff changeset
   944
                    try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   945
                        initializer = (ORBInitializer)AccessController.doPrivileged(
02bb8761fcce Initial load
duke
parents:
diff changeset
   946
                            new PrivilegedExceptionAction() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   947
                                public Object run()
02bb8761fcce Initial load
duke
parents:
diff changeset
   948
                                    throws InstantiationException, IllegalAccessException
02bb8761fcce Initial load
duke
parents:
diff changeset
   949
                                {
02bb8761fcce Initial load
duke
parents:
diff changeset
   950
                                    return initClass.newInstance() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   951
                                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   952
                            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   953
                        ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   954
                    } catch (PrivilegedActionException exc) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   955
                        // Unwrap the exception, as we don't care exc here
02bb8761fcce Initial load
duke
parents:
diff changeset
   956
                        throw wrapper.orbInitializerFailure( exc.getException(),
02bb8761fcce Initial load
duke
parents:
diff changeset
   957
                            initClass.getName() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   958
                    } catch (Exception exc) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   959
                        throw wrapper.orbInitializerFailure( exc, initClass.getName() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   960
                    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   961
02bb8761fcce Initial load
duke
parents:
diff changeset
   962
                    return initializer ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   963
                } else {
02bb8761fcce Initial load
duke
parents:
diff changeset
   964
                    throw wrapper.orbInitializerType( initClass.getName() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   965
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   966
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   967
        } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   968
02bb8761fcce Initial load
duke
parents:
diff changeset
   969
        Operation result = OperationFactory.compose( mop, mkinst ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   970
02bb8761fcce Initial load
duke
parents:
diff changeset
   971
        return result ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   972
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   973
02bb8761fcce Initial load
duke
parents:
diff changeset
   974
    public static final class TestAcceptor1
02bb8761fcce Initial load
duke
parents:
diff changeset
   975
        implements Acceptor
02bb8761fcce Initial load
duke
parents:
diff changeset
   976
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   977
        public boolean equals( Object other )
02bb8761fcce Initial load
duke
parents:
diff changeset
   978
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   979
            return other instanceof TestAcceptor1 ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   980
        }
18302
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   981
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
   982
        public int hashCode() { return 1; }
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   983
        public boolean initialize() { return true; }
02bb8761fcce Initial load
duke
parents:
diff changeset
   984
        public boolean initialized() { return true; }
02bb8761fcce Initial load
duke
parents:
diff changeset
   985
        public String getConnectionCacheType() { return "FOO"; }
02bb8761fcce Initial load
duke
parents:
diff changeset
   986
        public void setConnectionCache(InboundConnectionCache connectionCache){}
02bb8761fcce Initial load
duke
parents:
diff changeset
   987
        public InboundConnectionCache getConnectionCache() { return null; }
02bb8761fcce Initial load
duke
parents:
diff changeset
   988
        public boolean shouldRegisterAcceptEvent() { return true; }
02bb8761fcce Initial load
duke
parents:
diff changeset
   989
        public void setUseSelectThreadForConnections(boolean x) { }
02bb8761fcce Initial load
duke
parents:
diff changeset
   990
        public boolean shouldUseSelectThreadForConnections() { return true; }
02bb8761fcce Initial load
duke
parents:
diff changeset
   991
        public void setUseWorkerThreadForConnections(boolean x) { }
02bb8761fcce Initial load
duke
parents:
diff changeset
   992
        public boolean shouldUseWorkerThreadForConnections() { return true; }
02bb8761fcce Initial load
duke
parents:
diff changeset
   993
        public void accept() { }
02bb8761fcce Initial load
duke
parents:
diff changeset
   994
        public void close() { }
02bb8761fcce Initial load
duke
parents:
diff changeset
   995
        public EventHandler getEventHandler() { return null; }
02bb8761fcce Initial load
duke
parents:
diff changeset
   996
        public MessageMediator createMessageMediator(
02bb8761fcce Initial load
duke
parents:
diff changeset
   997
            Broker xbroker, Connection xconnection) { return null; }
02bb8761fcce Initial load
duke
parents:
diff changeset
   998
        public MessageMediator finishCreatingMessageMediator(
02bb8761fcce Initial load
duke
parents:
diff changeset
   999
            Broker xbroker, Connection xconnection,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1000
            MessageMediator messageMediator) { return null; }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1001
        public InputObject createInputObject(
02bb8761fcce Initial load
duke
parents:
diff changeset
  1002
            Broker broker, MessageMediator messageMediator) { return null; }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1003
        public OutputObject createOutputObject(
02bb8761fcce Initial load
duke
parents:
diff changeset
  1004
            Broker broker, MessageMediator messageMediator) { return null; }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1005
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1006
02bb8761fcce Initial load
duke
parents:
diff changeset
  1007
    public static final class TestAcceptor2
02bb8761fcce Initial load
duke
parents:
diff changeset
  1008
        implements Acceptor
02bb8761fcce Initial load
duke
parents:
diff changeset
  1009
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1010
        public boolean equals( Object other )
02bb8761fcce Initial load
duke
parents:
diff changeset
  1011
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1012
            return other instanceof TestAcceptor2 ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1013
        }
18302
3b06314efbd0 8016218: Warnings building corba repo due to missing hashCode methods
alanb
parents: 13052
diff changeset
  1014
        public int hashCode() { return 1; }
4
02bb8761fcce Initial load
duke
parents:
diff changeset
  1015
        public boolean initialize() { return true; }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1016
        public boolean initialized() { return true; }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1017
        public String getConnectionCacheType() { return "FOO"; }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1018
        public void setConnectionCache(InboundConnectionCache connectionCache){}
02bb8761fcce Initial load
duke
parents:
diff changeset
  1019
        public InboundConnectionCache getConnectionCache() { return null; }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1020
        public boolean shouldRegisterAcceptEvent() { return true; }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1021
        public void setUseSelectThreadForConnections(boolean x) { }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1022
        public boolean shouldUseSelectThreadForConnections() { return true; }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1023
        public void setUseWorkerThreadForConnections(boolean x) { }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1024
        public boolean shouldUseWorkerThreadForConnections() { return true; }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1025
        public void accept() { }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1026
        public void close() { }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1027
        public EventHandler getEventHandler() { return null; }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1028
        public MessageMediator createMessageMediator(
02bb8761fcce Initial load
duke
parents:
diff changeset
  1029
            Broker xbroker, Connection xconnection) { return null; }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1030
        public MessageMediator finishCreatingMessageMediator(
02bb8761fcce Initial load
duke
parents:
diff changeset
  1031
            Broker xbroker, Connection xconnection,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1032
            MessageMediator messageMediator) { return null; }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1033
        public InputObject createInputObject(
02bb8761fcce Initial load
duke
parents:
diff changeset
  1034
            Broker broker, MessageMediator messageMediator) { return null; }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1035
        public OutputObject createOutputObject(
02bb8761fcce Initial load
duke
parents:
diff changeset
  1036
            Broker broker, MessageMediator messageMediator) { return null; }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1037
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1038
02bb8761fcce Initial load
duke
parents:
diff changeset
  1039
    // REVISIT - this is a cut and paste modification of makeROIOperation.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1040
    private Operation makeAcceptorInstantiationOperation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1041
        Operation clsop = OperationFactory.classAction() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1042
        Operation indexOp = OperationFactory.suffixAction() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1043
        Operation op1 = OperationFactory.compose( indexOp, clsop ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1044
        Operation mop = OperationFactory.maskErrorAction( op1 ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1045
02bb8761fcce Initial load
duke
parents:
diff changeset
  1046
        Operation mkinst = new Operation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1047
            public Object operate( Object value )
02bb8761fcce Initial load
duke
parents:
diff changeset
  1048
            {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1049
                final Class initClass = (Class)value ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1050
                if (initClass == null)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1051
                    return null ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1052
02bb8761fcce Initial load
duke
parents:
diff changeset
  1053
                // For security reasons avoid creating an instance
02bb8761fcce Initial load
duke
parents:
diff changeset
  1054
                // if this class is one that would fail the class cast
02bb8761fcce Initial load
duke
parents:
diff changeset
  1055
                // to ORBInitializer anyway.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1056
                if( Acceptor.class.isAssignableFrom( initClass ) ) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1057
                    // Now that we have a class object, instantiate one and
02bb8761fcce Initial load
duke
parents:
diff changeset
  1058
                    // remember it:
02bb8761fcce Initial load
duke
parents:
diff changeset
  1059
                    Acceptor acceptor = null ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1060
02bb8761fcce Initial load
duke
parents:
diff changeset
  1061
                    try {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1062
                        acceptor = (Acceptor)AccessController.doPrivileged(
02bb8761fcce Initial load
duke
parents:
diff changeset
  1063
                            new PrivilegedExceptionAction() {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1064
                                public Object run()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1065
                                    throws InstantiationException, IllegalAccessException
02bb8761fcce Initial load
duke
parents:
diff changeset
  1066
                                {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1067
                                    return initClass.newInstance() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1068
                                }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1069
                            }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1070
                        ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1071
                    } catch (PrivilegedActionException exc) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1072
                        // Unwrap the exception, as we don't care exc here
02bb8761fcce Initial load
duke
parents:
diff changeset
  1073
                        throw wrapper.acceptorInstantiationFailure( exc.getException(),
02bb8761fcce Initial load
duke
parents:
diff changeset
  1074
                            initClass.getName() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1075
                    } catch (Exception exc) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1076
                        throw wrapper.acceptorInstantiationFailure( exc, initClass.getName() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1077
                    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1078
02bb8761fcce Initial load
duke
parents:
diff changeset
  1079
                    return acceptor ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1080
                } else {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1081
                    throw wrapper.acceptorInstantiationTypeFailure( initClass.getName() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1082
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1083
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1084
        } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1085
02bb8761fcce Initial load
duke
parents:
diff changeset
  1086
        Operation result = OperationFactory.compose( mop, mkinst ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1087
02bb8761fcce Initial load
duke
parents:
diff changeset
  1088
        return result ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1089
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1090
02bb8761fcce Initial load
duke
parents:
diff changeset
  1091
    private Operation makeInitRefOperation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1092
        return new Operation() {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1093
            public Object operate( Object value )
02bb8761fcce Initial load
duke
parents:
diff changeset
  1094
            {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1095
                // Object is String[] of length 2.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1096
                String[] values = (String[])value ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1097
                if (values.length != 2)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1098
                    throw wrapper.orbInitialreferenceSyntax() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1099
02bb8761fcce Initial load
duke
parents:
diff changeset
  1100
                return values[0] + "=" + values[1] ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1101
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1102
        } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1103
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1104
}
02bb8761fcce Initial load
duke
parents:
diff changeset
  1105
02bb8761fcce Initial load
duke
parents:
diff changeset
  1106
// End of file.