corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java
author ohair
Tue, 25 May 2010 15:52:11 -0700
changeset 5555 b2b5ed3f0d0d
parent 3291 805a72a26925
child 7585 e437618e95df
child 7197 a3c4c326e934
permissions -rw-r--r--
6943119: Rebrand source copyright notices Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     1
/*
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 3291
diff changeset
     2
 * Copyright (c) 2002, 2009, 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: 3291
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: 3291
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: 3291
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 3291
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 3291
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.applet.Applet;
02bb8761fcce Initial load
duke
parents:
diff changeset
    29
02bb8761fcce Initial load
duke
parents:
diff changeset
    30
import java.io.IOException ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    31
02bb8761fcce Initial load
duke
parents:
diff changeset
    32
import java.lang.reflect.Constructor;
02bb8761fcce Initial load
duke
parents:
diff changeset
    33
import java.lang.reflect.Field ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    34
import java.lang.reflect.Modifier ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
import java.lang.reflect.InvocationTargetException ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
02bb8761fcce Initial load
duke
parents:
diff changeset
    37
import java.util.ArrayList ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
import java.util.Iterator ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
import java.util.Properties ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
import java.util.Vector ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
import java.util.Hashtable ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
import java.util.Map ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    43
import java.util.HashMap ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
import java.util.LinkedList ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
import java.util.Collection ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    46
import java.util.Collections ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
import java.util.StringTokenizer ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
import java.util.Enumeration ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    49
import java.util.WeakHashMap ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    50
02bb8761fcce Initial load
duke
parents:
diff changeset
    51
import java.net.InetAddress ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    52
02bb8761fcce Initial load
duke
parents:
diff changeset
    53
import java.security.PrivilegedAction;
02bb8761fcce Initial load
duke
parents:
diff changeset
    54
import java.security.AccessController ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    55
02bb8761fcce Initial load
duke
parents:
diff changeset
    56
import javax.rmi.CORBA.Util;
02bb8761fcce Initial load
duke
parents:
diff changeset
    57
import javax.rmi.CORBA.ValueHandler;
02bb8761fcce Initial load
duke
parents:
diff changeset
    58
02bb8761fcce Initial load
duke
parents:
diff changeset
    59
import org.omg.CORBA.Context;
02bb8761fcce Initial load
duke
parents:
diff changeset
    60
import org.omg.CORBA.ContextList;
02bb8761fcce Initial load
duke
parents:
diff changeset
    61
import org.omg.CORBA.Environment;
02bb8761fcce Initial load
duke
parents:
diff changeset
    62
import org.omg.CORBA.ExceptionList;
02bb8761fcce Initial load
duke
parents:
diff changeset
    63
import org.omg.CORBA.ORBPackage.InvalidName;
02bb8761fcce Initial load
duke
parents:
diff changeset
    64
import org.omg.CORBA.NVList;
02bb8761fcce Initial load
duke
parents:
diff changeset
    65
import org.omg.CORBA.TCKind;
02bb8761fcce Initial load
duke
parents:
diff changeset
    66
import org.omg.CORBA.NamedValue;
02bb8761fcce Initial load
duke
parents:
diff changeset
    67
import org.omg.CORBA.Request;
02bb8761fcce Initial load
duke
parents:
diff changeset
    68
import org.omg.CORBA.SystemException;
02bb8761fcce Initial load
duke
parents:
diff changeset
    69
import org.omg.CORBA.CompletionStatus;
02bb8761fcce Initial load
duke
parents:
diff changeset
    70
import org.omg.CORBA.TypeCode;
02bb8761fcce Initial load
duke
parents:
diff changeset
    71
import org.omg.CORBA.Any;
02bb8761fcce Initial load
duke
parents:
diff changeset
    72
import org.omg.CORBA.StructMember;
02bb8761fcce Initial load
duke
parents:
diff changeset
    73
import org.omg.CORBA.UnionMember;
02bb8761fcce Initial load
duke
parents:
diff changeset
    74
import org.omg.CORBA.ValueMember;
02bb8761fcce Initial load
duke
parents:
diff changeset
    75
import org.omg.CORBA.BAD_PARAM;
02bb8761fcce Initial load
duke
parents:
diff changeset
    76
import org.omg.CORBA.MARSHAL;
02bb8761fcce Initial load
duke
parents:
diff changeset
    77
02bb8761fcce Initial load
duke
parents:
diff changeset
    78
import org.omg.CORBA.portable.ValueFactory;
02bb8761fcce Initial load
duke
parents:
diff changeset
    79
02bb8761fcce Initial load
duke
parents:
diff changeset
    80
import org.omg.CORBA.ORBPackage.InvalidName;
02bb8761fcce Initial load
duke
parents:
diff changeset
    81
02bb8761fcce Initial load
duke
parents:
diff changeset
    82
import com.sun.org.omg.SendingContext.CodeBase;
02bb8761fcce Initial load
duke
parents:
diff changeset
    83
02bb8761fcce Initial load
duke
parents:
diff changeset
    84
import com.sun.corba.se.pept.broker.Broker;
02bb8761fcce Initial load
duke
parents:
diff changeset
    85
import com.sun.corba.se.pept.protocol.ClientInvocationInfo ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    86
import com.sun.corba.se.pept.transport.ContactInfo;
02bb8761fcce Initial load
duke
parents:
diff changeset
    87
import com.sun.corba.se.pept.transport.ConnectionCache;
02bb8761fcce Initial load
duke
parents:
diff changeset
    88
import com.sun.corba.se.pept.transport.TransportManager;
02bb8761fcce Initial load
duke
parents:
diff changeset
    89
02bb8761fcce Initial load
duke
parents:
diff changeset
    90
import com.sun.corba.se.spi.ior.IOR;
02bb8761fcce Initial load
duke
parents:
diff changeset
    91
import com.sun.corba.se.spi.ior.IdentifiableFactoryFinder ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    92
import com.sun.corba.se.spi.ior.TaggedComponentFactoryFinder;
02bb8761fcce Initial load
duke
parents:
diff changeset
    93
import com.sun.corba.se.spi.ior.IORFactories ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    94
import com.sun.corba.se.spi.ior.ObjectKey ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    95
import com.sun.corba.se.spi.ior.ObjectKeyFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    96
import com.sun.corba.se.spi.ior.iiop.IIOPFactories ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    97
import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
02bb8761fcce Initial load
duke
parents:
diff changeset
    98
import com.sun.corba.se.spi.oa.OAInvocationInfo;
02bb8761fcce Initial load
duke
parents:
diff changeset
    99
import com.sun.corba.se.spi.oa.ObjectAdapterFactory;
02bb8761fcce Initial load
duke
parents:
diff changeset
   100
import com.sun.corba.se.spi.orb.DataCollector;
02bb8761fcce Initial load
duke
parents:
diff changeset
   101
import com.sun.corba.se.spi.orb.Operation;
02bb8761fcce Initial load
duke
parents:
diff changeset
   102
import com.sun.corba.se.spi.orb.ORBData;
02bb8761fcce Initial load
duke
parents:
diff changeset
   103
import com.sun.corba.se.spi.orb.ORBConfigurator;
02bb8761fcce Initial load
duke
parents:
diff changeset
   104
import com.sun.corba.se.spi.orb.ParserImplBase;
02bb8761fcce Initial load
duke
parents:
diff changeset
   105
import com.sun.corba.se.spi.orb.PropertyParser;
02bb8761fcce Initial load
duke
parents:
diff changeset
   106
import com.sun.corba.se.spi.orb.OperationFactory;
02bb8761fcce Initial load
duke
parents:
diff changeset
   107
import com.sun.corba.se.spi.orb.ORBVersion;
02bb8761fcce Initial load
duke
parents:
diff changeset
   108
import com.sun.corba.se.spi.orb.ORBVersionFactory;
02bb8761fcce Initial load
duke
parents:
diff changeset
   109
import com.sun.corba.se.spi.orbutil.closure.ClosureFactory;
02bb8761fcce Initial load
duke
parents:
diff changeset
   110
import com.sun.corba.se.spi.orbutil.threadpool.ThreadPoolManager;
02bb8761fcce Initial load
duke
parents:
diff changeset
   111
import com.sun.corba.se.spi.protocol.ClientDelegateFactory;
02bb8761fcce Initial load
duke
parents:
diff changeset
   112
import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry;
02bb8761fcce Initial load
duke
parents:
diff changeset
   113
import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher;
02bb8761fcce Initial load
duke
parents:
diff changeset
   114
import com.sun.corba.se.spi.protocol.RequestDispatcherDefault;
02bb8761fcce Initial load
duke
parents:
diff changeset
   115
import com.sun.corba.se.spi.protocol.PIHandler;
02bb8761fcce Initial load
duke
parents:
diff changeset
   116
import com.sun.corba.se.spi.protocol.CorbaMessageMediator;
02bb8761fcce Initial load
duke
parents:
diff changeset
   117
import com.sun.corba.se.spi.protocol.ForwardException;
02bb8761fcce Initial load
duke
parents:
diff changeset
   118
import com.sun.corba.se.spi.resolver.Resolver;
02bb8761fcce Initial load
duke
parents:
diff changeset
   119
import com.sun.corba.se.spi.resolver.LocalResolver;
02bb8761fcce Initial load
duke
parents:
diff changeset
   120
import com.sun.corba.se.spi.orb.StringPair;
02bb8761fcce Initial load
duke
parents:
diff changeset
   121
import com.sun.corba.se.spi.orb.StringPair;
02bb8761fcce Initial load
duke
parents:
diff changeset
   122
import com.sun.corba.se.spi.transport.CorbaContactInfoListFactory;
02bb8761fcce Initial load
duke
parents:
diff changeset
   123
import com.sun.corba.se.spi.transport.CorbaTransportManager;
02bb8761fcce Initial load
duke
parents:
diff changeset
   124
import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketManager;
02bb8761fcce Initial load
duke
parents:
diff changeset
   125
import com.sun.corba.se.spi.copyobject.CopierManager ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   126
import com.sun.corba.se.spi.presentation.rmi.PresentationDefaults ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   127
import com.sun.corba.se.spi.presentation.rmi.PresentationManager ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   128
import com.sun.corba.se.spi.presentation.rmi.StubAdapter ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   129
import com.sun.corba.se.spi.servicecontext.ServiceContextRegistry;
02bb8761fcce Initial load
duke
parents:
diff changeset
   130
02bb8761fcce Initial load
duke
parents:
diff changeset
   131
import com.sun.corba.se.impl.corba.TypeCodeFactory;
02bb8761fcce Initial load
duke
parents:
diff changeset
   132
import com.sun.corba.se.impl.corba.TypeCodeImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   133
import com.sun.corba.se.impl.corba.NVListImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   134
import com.sun.corba.se.impl.corba.ExceptionListImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   135
import com.sun.corba.se.impl.corba.ContextListImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   136
import com.sun.corba.se.impl.corba.NamedValueImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   137
import com.sun.corba.se.impl.corba.EnvironmentImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   138
import com.sun.corba.se.impl.corba.AsynchInvoke;
02bb8761fcce Initial load
duke
parents:
diff changeset
   139
import com.sun.corba.se.impl.corba.AnyImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   140
import com.sun.corba.se.impl.corba.RequestImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   141
import com.sun.corba.se.impl.dynamicany.DynAnyFactoryImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   142
import com.sun.corba.se.impl.encoding.EncapsOutputStream;
02bb8761fcce Initial load
duke
parents:
diff changeset
   143
import com.sun.corba.se.impl.interceptors.PIHandlerImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   144
import com.sun.corba.se.impl.interceptors.PINoOpHandlerImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   145
import com.sun.corba.se.impl.ior.TaggedComponentFactoryFinderImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   146
import com.sun.corba.se.impl.ior.TaggedProfileFactoryFinderImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   147
import com.sun.corba.se.impl.ior.TaggedProfileTemplateFactoryFinderImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   148
import com.sun.corba.se.impl.oa.toa.TOAFactory;
02bb8761fcce Initial load
duke
parents:
diff changeset
   149
import com.sun.corba.se.impl.oa.poa.BadServerIdHandler;
02bb8761fcce Initial load
duke
parents:
diff changeset
   150
import com.sun.corba.se.impl.oa.poa.DelegateImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   151
import com.sun.corba.se.impl.oa.poa.POAFactory;
02bb8761fcce Initial load
duke
parents:
diff changeset
   152
import com.sun.corba.se.impl.orbutil.ORBClassLoader;
02bb8761fcce Initial load
duke
parents:
diff changeset
   153
import com.sun.corba.se.impl.orbutil.ORBConstants;
02bb8761fcce Initial load
duke
parents:
diff changeset
   154
import com.sun.corba.se.impl.orbutil.ORBUtility;
02bb8761fcce Initial load
duke
parents:
diff changeset
   155
import com.sun.corba.se.impl.orbutil.StackImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   156
import com.sun.corba.se.impl.orbutil.threadpool.ThreadPoolImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   157
import com.sun.corba.se.impl.orbutil.threadpool.ThreadPoolManagerImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   158
import com.sun.corba.se.impl.protocol.RequestDispatcherRegistryImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   159
import com.sun.corba.se.impl.protocol.CorbaInvocationInfo;
02bb8761fcce Initial load
duke
parents:
diff changeset
   160
import com.sun.corba.se.impl.transport.CorbaTransportManagerImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   161
import com.sun.corba.se.impl.legacy.connection.LegacyServerSocketManagerImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   162
import com.sun.corba.se.impl.util.Utility;
02bb8761fcce Initial load
duke
parents:
diff changeset
   163
import com.sun.corba.se.impl.logging.ORBUtilSystemException;
02bb8761fcce Initial load
duke
parents:
diff changeset
   164
import com.sun.corba.se.impl.copyobject.CopierManagerImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   165
import com.sun.corba.se.impl.presentation.rmi.PresentationManagerImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
   166
02bb8761fcce Initial load
duke
parents:
diff changeset
   167
/**
02bb8761fcce Initial load
duke
parents:
diff changeset
   168
 * The JavaIDL ORB implementation.
02bb8761fcce Initial load
duke
parents:
diff changeset
   169
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
   170
public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
02bb8761fcce Initial load
duke
parents:
diff changeset
   171
{
02bb8761fcce Initial load
duke
parents:
diff changeset
   172
    protected TransportManager transportManager;
02bb8761fcce Initial load
duke
parents:
diff changeset
   173
    protected LegacyServerSocketManager legacyServerSocketManager;
02bb8761fcce Initial load
duke
parents:
diff changeset
   174
02bb8761fcce Initial load
duke
parents:
diff changeset
   175
    private ThreadLocal OAInvocationInfoStack ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   176
02bb8761fcce Initial load
duke
parents:
diff changeset
   177
    private ThreadLocal clientInvocationInfoStack ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   178
02bb8761fcce Initial load
duke
parents:
diff changeset
   179
    // pure java orb, caching the servant IOR per ORB
02bb8761fcce Initial load
duke
parents:
diff changeset
   180
    private static IOR codeBaseIOR ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   181
02bb8761fcce Initial load
duke
parents:
diff changeset
   182
    // Vector holding deferred Requests
02bb8761fcce Initial load
duke
parents:
diff changeset
   183
    private Vector            dynamicRequests ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   184
    private SynchVariable     svResponseReceived ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   185
02bb8761fcce Initial load
duke
parents:
diff changeset
   186
    private java.lang.Object runObj = new java.lang.Object();
02bb8761fcce Initial load
duke
parents:
diff changeset
   187
    private java.lang.Object shutdownObj = new java.lang.Object();
02bb8761fcce Initial load
duke
parents:
diff changeset
   188
    private static final byte STATUS_OPERATING = 1;
02bb8761fcce Initial load
duke
parents:
diff changeset
   189
    private static final byte STATUS_SHUTTING_DOWN = 2;
02bb8761fcce Initial load
duke
parents:
diff changeset
   190
    private static final byte STATUS_SHUTDOWN = 3;
02bb8761fcce Initial load
duke
parents:
diff changeset
   191
    private static final byte STATUS_DESTROYED = 4;
02bb8761fcce Initial load
duke
parents:
diff changeset
   192
    private byte status = STATUS_OPERATING;
02bb8761fcce Initial load
duke
parents:
diff changeset
   193
02bb8761fcce Initial load
duke
parents:
diff changeset
   194
    // XXX Should we move invocation tracking to the first level server dispatcher?
02bb8761fcce Initial load
duke
parents:
diff changeset
   195
    private java.lang.Object invocationObj = new java.lang.Object();
02bb8761fcce Initial load
duke
parents:
diff changeset
   196
02bb8761fcce Initial load
duke
parents:
diff changeset
   197
    // thread local variable to store a boolean to detect deadlock in
02bb8761fcce Initial load
duke
parents:
diff changeset
   198
    // ORB.shutdown(true).
02bb8761fcce Initial load
duke
parents:
diff changeset
   199
    private ThreadLocal isProcessingInvocation = new ThreadLocal () {
02bb8761fcce Initial load
duke
parents:
diff changeset
   200
        protected java.lang.Object initialValue() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   201
            return Boolean.FALSE;
02bb8761fcce Initial load
duke
parents:
diff changeset
   202
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   203
    };
02bb8761fcce Initial load
duke
parents:
diff changeset
   204
02bb8761fcce Initial load
duke
parents:
diff changeset
   205
    // This map is caching TypeCodes created for a certain class (key)
02bb8761fcce Initial load
duke
parents:
diff changeset
   206
    // and is used in Util.writeAny()
02bb8761fcce Initial load
duke
parents:
diff changeset
   207
    private Map typeCodeForClassMap ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   208
02bb8761fcce Initial load
duke
parents:
diff changeset
   209
    // Cache to hold ValueFactories (Helper classes) keyed on repository ids
02bb8761fcce Initial load
duke
parents:
diff changeset
   210
    private Hashtable valueFactoryCache = new Hashtable();
02bb8761fcce Initial load
duke
parents:
diff changeset
   211
02bb8761fcce Initial load
duke
parents:
diff changeset
   212
    // thread local variable to store the current ORB version.
02bb8761fcce Initial load
duke
parents:
diff changeset
   213
    // default ORB version is the version of ORB with correct Rep-id
02bb8761fcce Initial load
duke
parents:
diff changeset
   214
    // changes
02bb8761fcce Initial load
duke
parents:
diff changeset
   215
    private ThreadLocal orbVersionThreadLocal ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   216
02bb8761fcce Initial load
duke
parents:
diff changeset
   217
    private RequestDispatcherRegistry requestDispatcherRegistry ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   218
02bb8761fcce Initial load
duke
parents:
diff changeset
   219
    private CopierManager copierManager ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   220
02bb8761fcce Initial load
duke
parents:
diff changeset
   221
    private int transientServerId ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   222
02bb8761fcce Initial load
duke
parents:
diff changeset
   223
    private ThreadGroup threadGroup ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   224
02bb8761fcce Initial load
duke
parents:
diff changeset
   225
    private ServiceContextRegistry serviceContextRegistry ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   226
02bb8761fcce Initial load
duke
parents:
diff changeset
   227
    // Needed here to implement connect/disconnect
02bb8761fcce Initial load
duke
parents:
diff changeset
   228
    private TOAFactory toaFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   229
02bb8761fcce Initial load
duke
parents:
diff changeset
   230
    // Needed here for set_delegate
02bb8761fcce Initial load
duke
parents:
diff changeset
   231
    private POAFactory poaFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   232
02bb8761fcce Initial load
duke
parents:
diff changeset
   233
    // The interceptor handler, which provides portable interceptor services for
02bb8761fcce Initial load
duke
parents:
diff changeset
   234
    // subcontracts and object adapters.
02bb8761fcce Initial load
duke
parents:
diff changeset
   235
    private PIHandler pihandler ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   236
02bb8761fcce Initial load
duke
parents:
diff changeset
   237
    private ORBData configData ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   238
02bb8761fcce Initial load
duke
parents:
diff changeset
   239
    private BadServerIdHandler badServerIdHandler ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   240
02bb8761fcce Initial load
duke
parents:
diff changeset
   241
    private ClientDelegateFactory clientDelegateFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   242
02bb8761fcce Initial load
duke
parents:
diff changeset
   243
    private CorbaContactInfoListFactory corbaContactInfoListFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   244
02bb8761fcce Initial load
duke
parents:
diff changeset
   245
    // All access to resolver, localResolver, and urlOperation must be protected using
02bb8761fcce Initial load
duke
parents:
diff changeset
   246
    // resolverLock.  Do not hold the ORBImpl lock while accessing
02bb8761fcce Initial load
duke
parents:
diff changeset
   247
    // resolver, or deadlocks may occur.
02bb8761fcce Initial load
duke
parents:
diff changeset
   248
    private Object resolverLock ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   249
02bb8761fcce Initial load
duke
parents:
diff changeset
   250
    // Used for resolver_initial_references and list_initial_services
02bb8761fcce Initial load
duke
parents:
diff changeset
   251
    private Resolver resolver ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   252
02bb8761fcce Initial load
duke
parents:
diff changeset
   253
    // Used for register_initial_references
02bb8761fcce Initial load
duke
parents:
diff changeset
   254
    private LocalResolver localResolver ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   255
02bb8761fcce Initial load
duke
parents:
diff changeset
   256
    // Converts strings to object references for resolvers and string_to_object
02bb8761fcce Initial load
duke
parents:
diff changeset
   257
    private Operation urlOperation ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   258
02bb8761fcce Initial load
duke
parents:
diff changeset
   259
    private CorbaServerRequestDispatcher insNamingDelegate ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   260
02bb8761fcce Initial load
duke
parents:
diff changeset
   261
    private TaggedComponentFactoryFinder taggedComponentFactoryFinder ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   262
02bb8761fcce Initial load
duke
parents:
diff changeset
   263
    private IdentifiableFactoryFinder taggedProfileFactoryFinder ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   264
02bb8761fcce Initial load
duke
parents:
diff changeset
   265
    private IdentifiableFactoryFinder taggedProfileTemplateFactoryFinder ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   266
02bb8761fcce Initial load
duke
parents:
diff changeset
   267
    private ObjectKeyFactory objectKeyFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   268
02bb8761fcce Initial load
duke
parents:
diff changeset
   269
    private ThreadPoolManager threadpoolMgr;
02bb8761fcce Initial load
duke
parents:
diff changeset
   270
02bb8761fcce Initial load
duke
parents:
diff changeset
   271
    private void dprint( String msg )
02bb8761fcce Initial load
duke
parents:
diff changeset
   272
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   273
        ORBUtility.dprint( this, msg ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   274
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   275
02bb8761fcce Initial load
duke
parents:
diff changeset
   276
    ////////////////////////////////////////////////////
02bb8761fcce Initial load
duke
parents:
diff changeset
   277
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
   278
    // NOTE:
02bb8761fcce Initial load
duke
parents:
diff changeset
   279
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
   280
    // Methods that are synchronized MUST stay synchronized.
02bb8761fcce Initial load
duke
parents:
diff changeset
   281
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
   282
    // Methods that are NOT synchronized must stay that way to avoid deadlock.
02bb8761fcce Initial load
duke
parents:
diff changeset
   283
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
   284
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
   285
    // REVISIT:
02bb8761fcce Initial load
duke
parents:
diff changeset
   286
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
   287
    // checkShutDownState - lock on different object - and normalize usage.
02bb8761fcce Initial load
duke
parents:
diff changeset
   288
    // starting/FinishDispatch and Shutdown
02bb8761fcce Initial load
duke
parents:
diff changeset
   289
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
   290
02bb8761fcce Initial load
duke
parents:
diff changeset
   291
    public ORBData getORBData()
02bb8761fcce Initial load
duke
parents:
diff changeset
   292
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   293
        return configData ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   294
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   295
02bb8761fcce Initial load
duke
parents:
diff changeset
   296
    public PIHandler getPIHandler()
02bb8761fcce Initial load
duke
parents:
diff changeset
   297
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   298
        return pihandler ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   299
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   300
02bb8761fcce Initial load
duke
parents:
diff changeset
   301
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   302
     * Create a new ORB. Should be followed by the appropriate
02bb8761fcce Initial load
duke
parents:
diff changeset
   303
     * set_parameters() call.
02bb8761fcce Initial load
duke
parents:
diff changeset
   304
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   305
    public ORBImpl()
02bb8761fcce Initial load
duke
parents:
diff changeset
   306
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   307
        // All initialization is done through set_parameters().
02bb8761fcce Initial load
duke
parents:
diff changeset
   308
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   309
02bb8761fcce Initial load
duke
parents:
diff changeset
   310
    public ORBVersion getORBVersion()
02bb8761fcce Initial load
duke
parents:
diff changeset
   311
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   312
        return (ORBVersion)(orbVersionThreadLocal.get()) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   313
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   314
02bb8761fcce Initial load
duke
parents:
diff changeset
   315
    public void setORBVersion(ORBVersion verObj)
02bb8761fcce Initial load
duke
parents:
diff changeset
   316
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   317
        orbVersionThreadLocal.set(verObj);
02bb8761fcce Initial load
duke
parents:
diff changeset
   318
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   319
02bb8761fcce Initial load
duke
parents:
diff changeset
   320
/****************************************************************************
02bb8761fcce Initial load
duke
parents:
diff changeset
   321
 * The following methods are ORB initialization
02bb8761fcce Initial load
duke
parents:
diff changeset
   322
 ****************************************************************************/
02bb8761fcce Initial load
duke
parents:
diff changeset
   323
02bb8761fcce Initial load
duke
parents:
diff changeset
   324
    // preInit initializes all non-pluggable ORB data that is independent
02bb8761fcce Initial load
duke
parents:
diff changeset
   325
    // of the property parsing.
02bb8761fcce Initial load
duke
parents:
diff changeset
   326
    private void preInit( String[] params, Properties props )
02bb8761fcce Initial load
duke
parents:
diff changeset
   327
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   328
        // Before ORBConfiguration we need to set a PINoOpHandlerImpl,
02bb8761fcce Initial load
duke
parents:
diff changeset
   329
        // because PersisentServer Initialization inside configurator will
02bb8761fcce Initial load
duke
parents:
diff changeset
   330
        // invoke orb.resolve_initial_references( ) which will result in a
02bb8761fcce Initial load
duke
parents:
diff changeset
   331
        // check on piHandler to invoke Interceptors. We do not want any
02bb8761fcce Initial load
duke
parents:
diff changeset
   332
        // Interceptors to be invoked before the complete ORB initialization.
02bb8761fcce Initial load
duke
parents:
diff changeset
   333
        // piHandler will be replaced by a real PIHandler implementation at the
02bb8761fcce Initial load
duke
parents:
diff changeset
   334
        // end of this method.
02bb8761fcce Initial load
duke
parents:
diff changeset
   335
        pihandler = new PINoOpHandlerImpl( );
02bb8761fcce Initial load
duke
parents:
diff changeset
   336
02bb8761fcce Initial load
duke
parents:
diff changeset
   337
        // See bugs 4916766 and 4936203
02bb8761fcce Initial load
duke
parents:
diff changeset
   338
        // We intend to create new threads in a reliable thread group.
02bb8761fcce Initial load
duke
parents:
diff changeset
   339
        // This avoids problems if the application/applet
02bb8761fcce Initial load
duke
parents:
diff changeset
   340
        // creates a thread group, makes JavaIDL calls which create a new
02bb8761fcce Initial load
duke
parents:
diff changeset
   341
        // connection and ReaderThread, and then destroys the thread
02bb8761fcce Initial load
duke
parents:
diff changeset
   342
        // group. If our ReaderThreads were to be part of such destroyed thread
02bb8761fcce Initial load
duke
parents:
diff changeset
   343
        // group then it might get killed and cause other invoking threads
02bb8761fcce Initial load
duke
parents:
diff changeset
   344
        // sharing the same connection to get a non-restartable
02bb8761fcce Initial load
duke
parents:
diff changeset
   345
        // CommunicationFailure. We'd like to avoid that.
02bb8761fcce Initial load
duke
parents:
diff changeset
   346
        //
02bb8761fcce Initial load
duke
parents:
diff changeset
   347
        // Our solution is to create all of our threads in the highest thread
02bb8761fcce Initial load
duke
parents:
diff changeset
   348
        // group that we have access to, given our own security clearance.
02bb8761fcce Initial load
duke
parents:
diff changeset
   349
        //
02bb8761fcce Initial load
duke
parents:
diff changeset
   350
        try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   351
            // try to get a thread group that's as high in the threadgroup
02bb8761fcce Initial load
duke
parents:
diff changeset
   352
            // parent-child hierarchy, as we can get to.
02bb8761fcce Initial load
duke
parents:
diff changeset
   353
            // this will prevent an ORB thread created during applet-init from
02bb8761fcce Initial load
duke
parents:
diff changeset
   354
            // being killed when an applet dies.
02bb8761fcce Initial load
duke
parents:
diff changeset
   355
            threadGroup = (ThreadGroup) AccessController.doPrivileged(
02bb8761fcce Initial load
duke
parents:
diff changeset
   356
                new PrivilegedAction() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   357
                    public Object run() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   358
                        ThreadGroup tg = Thread.currentThread().getThreadGroup() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   359
                        ThreadGroup ptg = tg ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   360
                        try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   361
                            while (ptg != null) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   362
                                tg = ptg;
02bb8761fcce Initial load
duke
parents:
diff changeset
   363
                                ptg = tg.getParent();
02bb8761fcce Initial load
duke
parents:
diff changeset
   364
                            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   365
                        } catch (SecurityException se) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   366
                            // Discontinue going higher on a security exception.
02bb8761fcce Initial load
duke
parents:
diff changeset
   367
                        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   368
                        return new ThreadGroup(tg, "ORB ThreadGroup");
02bb8761fcce Initial load
duke
parents:
diff changeset
   369
                    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   370
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   371
            );
02bb8761fcce Initial load
duke
parents:
diff changeset
   372
        } catch (SecurityException e) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   373
            // something wrong, we go back to the original code
02bb8761fcce Initial load
duke
parents:
diff changeset
   374
            threadGroup = Thread.currentThread().getThreadGroup();
02bb8761fcce Initial load
duke
parents:
diff changeset
   375
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   376
02bb8761fcce Initial load
duke
parents:
diff changeset
   377
        // This is the unique id of this server (JVM). Multiple incarnations
02bb8761fcce Initial load
duke
parents:
diff changeset
   378
        // of this server will get different ids.
02bb8761fcce Initial load
duke
parents:
diff changeset
   379
        // Compute transientServerId = milliseconds since Jan 1, 1970
02bb8761fcce Initial load
duke
parents:
diff changeset
   380
        // Note: transientServerId will wrap in about 2^32 / 86400000 = 49.7 days.
02bb8761fcce Initial load
duke
parents:
diff changeset
   381
        // If two ORBS are started at the same time then there is a possibility
02bb8761fcce Initial load
duke
parents:
diff changeset
   382
        // of having the same transientServerId. This may result in collision
02bb8761fcce Initial load
duke
parents:
diff changeset
   383
        // and may be a problem in ior.isLocal() check to see if the object
02bb8761fcce Initial load
duke
parents:
diff changeset
   384
        // belongs to the current ORB. This problem is taken care of by checking
02bb8761fcce Initial load
duke
parents:
diff changeset
   385
        // to see if the IOR port matches ORB server port in legacyIsLocalServerPort()
02bb8761fcce Initial load
duke
parents:
diff changeset
   386
        // method.
02bb8761fcce Initial load
duke
parents:
diff changeset
   387
        //
02bb8761fcce Initial load
duke
parents:
diff changeset
   388
        // XXX need to move server ID to a string for CORBA 3.0.  At that point,
02bb8761fcce Initial load
duke
parents:
diff changeset
   389
        // make this more unique (possibly use java.rmi.server.UID).
02bb8761fcce Initial load
duke
parents:
diff changeset
   390
        transientServerId = (int)System.currentTimeMillis();
02bb8761fcce Initial load
duke
parents:
diff changeset
   391
02bb8761fcce Initial load
duke
parents:
diff changeset
   392
        orbVersionThreadLocal  = new ThreadLocal () {
02bb8761fcce Initial load
duke
parents:
diff changeset
   393
            protected java.lang.Object initialValue() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   394
                // set default to version of the ORB with correct Rep-ids
02bb8761fcce Initial load
duke
parents:
diff changeset
   395
                return ORBVersionFactory.getORBVersion() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   396
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   397
        };
02bb8761fcce Initial load
duke
parents:
diff changeset
   398
02bb8761fcce Initial load
duke
parents:
diff changeset
   399
        resolverLock = new java.lang.Object() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   400
02bb8761fcce Initial load
duke
parents:
diff changeset
   401
        requestDispatcherRegistry = new RequestDispatcherRegistryImpl(
02bb8761fcce Initial load
duke
parents:
diff changeset
   402
            this, ORBConstants.DEFAULT_SCID);
02bb8761fcce Initial load
duke
parents:
diff changeset
   403
        copierManager = new CopierManagerImpl( this ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   404
02bb8761fcce Initial load
duke
parents:
diff changeset
   405
        taggedComponentFactoryFinder =
02bb8761fcce Initial load
duke
parents:
diff changeset
   406
            new TaggedComponentFactoryFinderImpl(this) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   407
        taggedProfileFactoryFinder =
02bb8761fcce Initial load
duke
parents:
diff changeset
   408
            new TaggedProfileFactoryFinderImpl(this) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   409
        taggedProfileTemplateFactoryFinder =
02bb8761fcce Initial load
duke
parents:
diff changeset
   410
            new TaggedProfileTemplateFactoryFinderImpl(this) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   411
02bb8761fcce Initial load
duke
parents:
diff changeset
   412
        dynamicRequests = new Vector();
02bb8761fcce Initial load
duke
parents:
diff changeset
   413
        svResponseReceived = new SynchVariable();
02bb8761fcce Initial load
duke
parents:
diff changeset
   414
02bb8761fcce Initial load
duke
parents:
diff changeset
   415
        OAInvocationInfoStack =
02bb8761fcce Initial load
duke
parents:
diff changeset
   416
            new ThreadLocal () {
02bb8761fcce Initial load
duke
parents:
diff changeset
   417
                protected java.lang.Object initialValue()
02bb8761fcce Initial load
duke
parents:
diff changeset
   418
                {
02bb8761fcce Initial load
duke
parents:
diff changeset
   419
                    return new StackImpl();
02bb8761fcce Initial load
duke
parents:
diff changeset
   420
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   421
            };
02bb8761fcce Initial load
duke
parents:
diff changeset
   422
02bb8761fcce Initial load
duke
parents:
diff changeset
   423
        clientInvocationInfoStack =
02bb8761fcce Initial load
duke
parents:
diff changeset
   424
            new ThreadLocal() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   425
                protected java.lang.Object initialValue() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   426
                    return new StackImpl();
02bb8761fcce Initial load
duke
parents:
diff changeset
   427
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   428
            };
02bb8761fcce Initial load
duke
parents:
diff changeset
   429
02bb8761fcce Initial load
duke
parents:
diff changeset
   430
        serviceContextRegistry = new ServiceContextRegistry( this ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   431
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   432
02bb8761fcce Initial load
duke
parents:
diff changeset
   433
    protected void setDebugFlags( String[] args )
02bb8761fcce Initial load
duke
parents:
diff changeset
   434
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   435
        for (int ctr=0; ctr<args.length; ctr++ ) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   436
            String token = args[ctr] ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   437
02bb8761fcce Initial load
duke
parents:
diff changeset
   438
            // If there is a public boolean data member in this class
02bb8761fcce Initial load
duke
parents:
diff changeset
   439
            // named token + "DebugFlag", set it to true.
02bb8761fcce Initial load
duke
parents:
diff changeset
   440
            try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   441
                Field fld = this.getClass().getField( token + "DebugFlag" ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   442
                int mod = fld.getModifiers() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   443
                if (Modifier.isPublic( mod ) && !Modifier.isStatic( mod ))
02bb8761fcce Initial load
duke
parents:
diff changeset
   444
                    if (fld.getType() == boolean.class)
02bb8761fcce Initial load
duke
parents:
diff changeset
   445
                        fld.setBoolean( this, true ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   446
            } catch (Exception exc) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   447
                // ignore it XXX log this as info
02bb8761fcce Initial load
duke
parents:
diff changeset
   448
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   449
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   450
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   451
02bb8761fcce Initial load
duke
parents:
diff changeset
   452
    // Class that defines a parser that gets the name of the
02bb8761fcce Initial load
duke
parents:
diff changeset
   453
    // ORBConfigurator class.
02bb8761fcce Initial load
duke
parents:
diff changeset
   454
    private static class ConfigParser extends ParserImplBase {
02bb8761fcce Initial load
duke
parents:
diff changeset
   455
        // The default here is the ORBConfiguratorImpl that we define,
02bb8761fcce Initial load
duke
parents:
diff changeset
   456
        // but this can be replaced.
02bb8761fcce Initial load
duke
parents:
diff changeset
   457
        public Class configurator = ORBConfiguratorImpl.class ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   458
02bb8761fcce Initial load
duke
parents:
diff changeset
   459
        public PropertyParser makeParser()
02bb8761fcce Initial load
duke
parents:
diff changeset
   460
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
   461
            PropertyParser parser = new PropertyParser() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   462
            parser.add( ORBConstants.SUN_PREFIX + "ORBConfigurator",
02bb8761fcce Initial load
duke
parents:
diff changeset
   463
                OperationFactory.classAction(), "configurator" ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   464
            return parser ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   465
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   466
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   467
02bb8761fcce Initial load
duke
parents:
diff changeset
   468
    private void postInit( String[] params, DataCollector dataCollector )
02bb8761fcce Initial load
duke
parents:
diff changeset
   469
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   470
        // First, create the standard ORB config data.
02bb8761fcce Initial load
duke
parents:
diff changeset
   471
        // This must be initialized before the ORBConfigurator
02bb8761fcce Initial load
duke
parents:
diff changeset
   472
        // is executed.
02bb8761fcce Initial load
duke
parents:
diff changeset
   473
        configData = new ORBDataParserImpl( this, dataCollector) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   474
02bb8761fcce Initial load
duke
parents:
diff changeset
   475
        // Set the debug flags early so they can be used by other
02bb8761fcce Initial load
duke
parents:
diff changeset
   476
        // parts of the initialization.
02bb8761fcce Initial load
duke
parents:
diff changeset
   477
        setDebugFlags( configData.getORBDebugFlags() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   478
02bb8761fcce Initial load
duke
parents:
diff changeset
   479
        // REVISIT: this should go away after more transport init cleanup
02bb8761fcce Initial load
duke
parents:
diff changeset
   480
        // and going to ORT based ORBD.
02bb8761fcce Initial load
duke
parents:
diff changeset
   481
        getTransportManager();
02bb8761fcce Initial load
duke
parents:
diff changeset
   482
        getLegacyServerSocketManager();
02bb8761fcce Initial load
duke
parents:
diff changeset
   483
02bb8761fcce Initial load
duke
parents:
diff changeset
   484
        // Create a parser to get the configured ORBConfigurator.
02bb8761fcce Initial load
duke
parents:
diff changeset
   485
        ConfigParser parser = new ConfigParser() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   486
        parser.init( dataCollector ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   487
02bb8761fcce Initial load
duke
parents:
diff changeset
   488
        ORBConfigurator configurator =  null ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   489
        try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   490
            configurator =
02bb8761fcce Initial load
duke
parents:
diff changeset
   491
                (ORBConfigurator)(parser.configurator.newInstance()) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   492
        } catch (Exception iexc) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   493
            throw wrapper.badOrbConfigurator( iexc, parser.configurator.getName() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   494
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   495
02bb8761fcce Initial load
duke
parents:
diff changeset
   496
        // Finally, run the configurator.  Note that the default implementation allows
02bb8761fcce Initial load
duke
parents:
diff changeset
   497
        // other configurators with their own parsers to run,
02bb8761fcce Initial load
duke
parents:
diff changeset
   498
        // using the same DataCollector.
02bb8761fcce Initial load
duke
parents:
diff changeset
   499
        try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   500
            configurator.configure( dataCollector, this ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   501
        } catch (Exception exc) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   502
            throw wrapper.orbConfiguratorError( exc ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   503
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   504
02bb8761fcce Initial load
duke
parents:
diff changeset
   505
        // Last of all, create the PIHandler and run the ORB initializers.
02bb8761fcce Initial load
duke
parents:
diff changeset
   506
        pihandler = new PIHandlerImpl( this, params) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   507
        pihandler.initialize() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   508
02bb8761fcce Initial load
duke
parents:
diff changeset
   509
        // Initialize the thread manager pool and byte buffer pool
02bb8761fcce Initial load
duke
parents:
diff changeset
   510
        // so they may be initialized & accessed without synchronization
02bb8761fcce Initial load
duke
parents:
diff changeset
   511
        getThreadPoolManager();
02bb8761fcce Initial load
duke
parents:
diff changeset
   512
02bb8761fcce Initial load
duke
parents:
diff changeset
   513
        super.getByteBufferPool();
02bb8761fcce Initial load
duke
parents:
diff changeset
   514
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   515
02bb8761fcce Initial load
duke
parents:
diff changeset
   516
    private synchronized POAFactory getPOAFactory()
02bb8761fcce Initial load
duke
parents:
diff changeset
   517
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   518
        if (poaFactory == null) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   519
            poaFactory = (POAFactory)requestDispatcherRegistry.getObjectAdapterFactory(
02bb8761fcce Initial load
duke
parents:
diff changeset
   520
                ORBConstants.TRANSIENT_SCID ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   521
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   522
02bb8761fcce Initial load
duke
parents:
diff changeset
   523
        return poaFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   524
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   525
02bb8761fcce Initial load
duke
parents:
diff changeset
   526
    private synchronized TOAFactory getTOAFactory()
02bb8761fcce Initial load
duke
parents:
diff changeset
   527
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   528
        if (toaFactory == null) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   529
            toaFactory = (TOAFactory)requestDispatcherRegistry.getObjectAdapterFactory(
02bb8761fcce Initial load
duke
parents:
diff changeset
   530
                ORBConstants.TOA_SCID ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   531
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   532
02bb8761fcce Initial load
duke
parents:
diff changeset
   533
        return toaFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   534
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   535
02bb8761fcce Initial load
duke
parents:
diff changeset
   536
    public void set_parameters( Properties props )
02bb8761fcce Initial load
duke
parents:
diff changeset
   537
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   538
        preInit( null, props ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   539
        DataCollector dataCollector =
02bb8761fcce Initial load
duke
parents:
diff changeset
   540
            DataCollectorFactory.create( props, getLocalHostName() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   541
        postInit( null, dataCollector ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   542
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   543
02bb8761fcce Initial load
duke
parents:
diff changeset
   544
    protected void set_parameters(Applet app, Properties props)
02bb8761fcce Initial load
duke
parents:
diff changeset
   545
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   546
        preInit( null, props ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   547
        DataCollector dataCollector =
02bb8761fcce Initial load
duke
parents:
diff changeset
   548
            DataCollectorFactory.create( app, props, getLocalHostName() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   549
        postInit( null, dataCollector ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   550
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   551
02bb8761fcce Initial load
duke
parents:
diff changeset
   552
    protected void set_parameters (String[] params, Properties props)
02bb8761fcce Initial load
duke
parents:
diff changeset
   553
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   554
        preInit( params, props ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   555
        DataCollector dataCollector =
02bb8761fcce Initial load
duke
parents:
diff changeset
   556
            DataCollectorFactory.create( params, props, getLocalHostName() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   557
        postInit( params, dataCollector ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   558
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   559
02bb8761fcce Initial load
duke
parents:
diff changeset
   560
/****************************************************************************
02bb8761fcce Initial load
duke
parents:
diff changeset
   561
 * The following methods are standard public CORBA ORB APIs
02bb8761fcce Initial load
duke
parents:
diff changeset
   562
 ****************************************************************************/
02bb8761fcce Initial load
duke
parents:
diff changeset
   563
02bb8761fcce Initial load
duke
parents:
diff changeset
   564
    public synchronized org.omg.CORBA.portable.OutputStream create_output_stream()
02bb8761fcce Initial load
duke
parents:
diff changeset
   565
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   566
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   567
        return new EncapsOutputStream(this);
02bb8761fcce Initial load
duke
parents:
diff changeset
   568
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   569
02bb8761fcce Initial load
duke
parents:
diff changeset
   570
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   571
     * Get a Current pseudo-object.
02bb8761fcce Initial load
duke
parents:
diff changeset
   572
     * The Current interface is used to manage thread-specific
02bb8761fcce Initial load
duke
parents:
diff changeset
   573
     * information for use by the transactions, security and other
02bb8761fcce Initial load
duke
parents:
diff changeset
   574
     * services. This method is deprecated,
02bb8761fcce Initial load
duke
parents:
diff changeset
   575
     * and replaced by ORB.resolve_initial_references("NameOfCurrentObject");
02bb8761fcce Initial load
duke
parents:
diff changeset
   576
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   577
     * @return          a Current pseudo-object.
02bb8761fcce Initial load
duke
parents:
diff changeset
   578
     * @deprecated
02bb8761fcce Initial load
duke
parents:
diff changeset
   579
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   580
    public synchronized org.omg.CORBA.Current get_current()
02bb8761fcce Initial load
duke
parents:
diff changeset
   581
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   582
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   583
02bb8761fcce Initial load
duke
parents:
diff changeset
   584
        /* _REVISIT_
02bb8761fcce Initial load
duke
parents:
diff changeset
   585
           The implementation of get_current is not clear. How would
02bb8761fcce Initial load
duke
parents:
diff changeset
   586
           ORB know whether the caller wants a Current for transactions
02bb8761fcce Initial load
duke
parents:
diff changeset
   587
           or security ?? Or is it assumed that there is just one
02bb8761fcce Initial load
duke
parents:
diff changeset
   588
           implementation for both ? If Current is thread-specific,
02bb8761fcce Initial load
duke
parents:
diff changeset
   589
           then it should not be instantiated; so where does the
02bb8761fcce Initial load
duke
parents:
diff changeset
   590
           ORB get a Current ?
02bb8761fcce Initial load
duke
parents:
diff changeset
   591
02bb8761fcce Initial load
duke
parents:
diff changeset
   592
           This should probably be deprecated. */
02bb8761fcce Initial load
duke
parents:
diff changeset
   593
02bb8761fcce Initial load
duke
parents:
diff changeset
   594
        throw wrapper.genericNoImpl() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   595
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   596
02bb8761fcce Initial load
duke
parents:
diff changeset
   597
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   598
     * Create an NVList
02bb8761fcce Initial load
duke
parents:
diff changeset
   599
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   600
     * @param count     size of list to create
02bb8761fcce Initial load
duke
parents:
diff changeset
   601
     * @result          NVList created
02bb8761fcce Initial load
duke
parents:
diff changeset
   602
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   603
     * @see NVList
02bb8761fcce Initial load
duke
parents:
diff changeset
   604
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   605
    public synchronized NVList create_list(int count)
02bb8761fcce Initial load
duke
parents:
diff changeset
   606
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   607
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   608
        return new NVListImpl(this, count);
02bb8761fcce Initial load
duke
parents:
diff changeset
   609
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   610
02bb8761fcce Initial load
duke
parents:
diff changeset
   611
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   612
     * Create an NVList corresponding to an OperationDef
02bb8761fcce Initial load
duke
parents:
diff changeset
   613
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   614
     * @param oper      operation def to use to create list
02bb8761fcce Initial load
duke
parents:
diff changeset
   615
     * @result          NVList created
02bb8761fcce Initial load
duke
parents:
diff changeset
   616
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   617
     * @see NVList
02bb8761fcce Initial load
duke
parents:
diff changeset
   618
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   619
    public synchronized NVList create_operation_list(org.omg.CORBA.Object oper)
02bb8761fcce Initial load
duke
parents:
diff changeset
   620
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   621
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   622
        throw wrapper.genericNoImpl() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   623
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   624
02bb8761fcce Initial load
duke
parents:
diff changeset
   625
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   626
     * Create a NamedValue
02bb8761fcce Initial load
duke
parents:
diff changeset
   627
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   628
     * @result          NamedValue created
02bb8761fcce Initial load
duke
parents:
diff changeset
   629
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   630
    public synchronized NamedValue create_named_value(String s, Any any, int flags)
02bb8761fcce Initial load
duke
parents:
diff changeset
   631
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   632
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   633
        return new NamedValueImpl(this, s, any, flags);
02bb8761fcce Initial load
duke
parents:
diff changeset
   634
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   635
02bb8761fcce Initial load
duke
parents:
diff changeset
   636
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   637
     * Create an ExceptionList
02bb8761fcce Initial load
duke
parents:
diff changeset
   638
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   639
     * @result          ExceptionList created
02bb8761fcce Initial load
duke
parents:
diff changeset
   640
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   641
    public synchronized org.omg.CORBA.ExceptionList create_exception_list()
02bb8761fcce Initial load
duke
parents:
diff changeset
   642
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   643
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   644
        return new ExceptionListImpl();
02bb8761fcce Initial load
duke
parents:
diff changeset
   645
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   646
02bb8761fcce Initial load
duke
parents:
diff changeset
   647
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   648
     * Create a ContextList
02bb8761fcce Initial load
duke
parents:
diff changeset
   649
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   650
     * @result          ContextList created
02bb8761fcce Initial load
duke
parents:
diff changeset
   651
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   652
    public synchronized org.omg.CORBA.ContextList create_context_list()
02bb8761fcce Initial load
duke
parents:
diff changeset
   653
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   654
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   655
        return new ContextListImpl(this);
02bb8761fcce Initial load
duke
parents:
diff changeset
   656
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   657
02bb8761fcce Initial load
duke
parents:
diff changeset
   658
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   659
     * Get the default Context object
02bb8761fcce Initial load
duke
parents:
diff changeset
   660
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   661
     * @result          the default Context object
02bb8761fcce Initial load
duke
parents:
diff changeset
   662
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   663
    public synchronized org.omg.CORBA.Context get_default_context()
02bb8761fcce Initial load
duke
parents:
diff changeset
   664
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   665
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   666
        throw wrapper.genericNoImpl() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   667
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   668
02bb8761fcce Initial load
duke
parents:
diff changeset
   669
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   670
     * Create an Environment
02bb8761fcce Initial load
duke
parents:
diff changeset
   671
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   672
     * @result          Environment created
02bb8761fcce Initial load
duke
parents:
diff changeset
   673
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   674
    public synchronized org.omg.CORBA.Environment create_environment()
02bb8761fcce Initial load
duke
parents:
diff changeset
   675
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   676
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   677
        return new EnvironmentImpl();
02bb8761fcce Initial load
duke
parents:
diff changeset
   678
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   679
02bb8761fcce Initial load
duke
parents:
diff changeset
   680
    public synchronized void send_multiple_requests_oneway(Request[] req)
02bb8761fcce Initial load
duke
parents:
diff changeset
   681
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   682
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   683
02bb8761fcce Initial load
duke
parents:
diff changeset
   684
        // Invoke the send_oneway on each new Request
02bb8761fcce Initial load
duke
parents:
diff changeset
   685
        for (int i = 0; i < req.length; i++) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   686
            req[i].send_oneway();
02bb8761fcce Initial load
duke
parents:
diff changeset
   687
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   688
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   689
02bb8761fcce Initial load
duke
parents:
diff changeset
   690
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   691
     * Send multiple dynamic requests asynchronously.
02bb8761fcce Initial load
duke
parents:
diff changeset
   692
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   693
     * @param req         an array of request objects.
02bb8761fcce Initial load
duke
parents:
diff changeset
   694
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   695
    public synchronized void send_multiple_requests_deferred(Request[] req)
02bb8761fcce Initial load
duke
parents:
diff changeset
   696
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   697
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   698
02bb8761fcce Initial load
duke
parents:
diff changeset
   699
        // add the new Requests to pending dynamic Requests
02bb8761fcce Initial load
duke
parents:
diff changeset
   700
        for (int i = 0; i < req.length; i++) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   701
            dynamicRequests.addElement(req[i]);
02bb8761fcce Initial load
duke
parents:
diff changeset
   702
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   703
02bb8761fcce Initial load
duke
parents:
diff changeset
   704
        // Invoke the send_deferred on each new Request
02bb8761fcce Initial load
duke
parents:
diff changeset
   705
        for (int i = 0; i < req.length; i++) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   706
            AsynchInvoke invokeObject = new AsynchInvoke( this,
02bb8761fcce Initial load
duke
parents:
diff changeset
   707
                (com.sun.corba.se.impl.corba.RequestImpl)req[i], true);
02bb8761fcce Initial load
duke
parents:
diff changeset
   708
            new Thread(invokeObject).start();
02bb8761fcce Initial load
duke
parents:
diff changeset
   709
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   710
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   711
02bb8761fcce Initial load
duke
parents:
diff changeset
   712
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   713
     * Find out if any of the deferred invocations have a response yet.
02bb8761fcce Initial load
duke
parents:
diff changeset
   714
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   715
    public synchronized boolean poll_next_response()
02bb8761fcce Initial load
duke
parents:
diff changeset
   716
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   717
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   718
02bb8761fcce Initial load
duke
parents:
diff changeset
   719
        Request currRequest;
02bb8761fcce Initial load
duke
parents:
diff changeset
   720
02bb8761fcce Initial load
duke
parents:
diff changeset
   721
        // poll on each pending request
02bb8761fcce Initial load
duke
parents:
diff changeset
   722
        Enumeration ve = dynamicRequests.elements();
02bb8761fcce Initial load
duke
parents:
diff changeset
   723
        while (ve.hasMoreElements() == true) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   724
            currRequest = (Request)ve.nextElement();
02bb8761fcce Initial load
duke
parents:
diff changeset
   725
            if (currRequest.poll_response() == true) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   726
                return true;
02bb8761fcce Initial load
duke
parents:
diff changeset
   727
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   728
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   729
        return false;
02bb8761fcce Initial load
duke
parents:
diff changeset
   730
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   731
02bb8761fcce Initial load
duke
parents:
diff changeset
   732
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   733
     * Get the next request that has gotten a response.
02bb8761fcce Initial load
duke
parents:
diff changeset
   734
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   735
     * @result            the next request ready with a response.
02bb8761fcce Initial load
duke
parents:
diff changeset
   736
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   737
    public org.omg.CORBA.Request get_next_response()
02bb8761fcce Initial load
duke
parents:
diff changeset
   738
        throws org.omg.CORBA.WrongTransaction
02bb8761fcce Initial load
duke
parents:
diff changeset
   739
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   740
        synchronized( this ) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   741
            checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   742
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   743
02bb8761fcce Initial load
duke
parents:
diff changeset
   744
        while (true) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   745
            // check if there already is a response
02bb8761fcce Initial load
duke
parents:
diff changeset
   746
            synchronized ( dynamicRequests ) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   747
                Enumeration elems = dynamicRequests.elements();
02bb8761fcce Initial load
duke
parents:
diff changeset
   748
                while ( elems.hasMoreElements() ) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   749
                    Request currRequest = (Request)elems.nextElement();
02bb8761fcce Initial load
duke
parents:
diff changeset
   750
                    if ( currRequest.poll_response() ) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   751
                        // get the response for this successfully polled Request
02bb8761fcce Initial load
duke
parents:
diff changeset
   752
                        currRequest.get_response();
02bb8761fcce Initial load
duke
parents:
diff changeset
   753
                        dynamicRequests.removeElement(currRequest);
02bb8761fcce Initial load
duke
parents:
diff changeset
   754
                        return currRequest;
02bb8761fcce Initial load
duke
parents:
diff changeset
   755
                    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   756
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   757
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   758
02bb8761fcce Initial load
duke
parents:
diff changeset
   759
            // wait for a response
02bb8761fcce Initial load
duke
parents:
diff changeset
   760
            synchronized(this.svResponseReceived) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   761
                while (!this.svResponseReceived.value()) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   762
                    try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   763
                        this.svResponseReceived.wait();
02bb8761fcce Initial load
duke
parents:
diff changeset
   764
                    } catch(java.lang.InterruptedException ex) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   765
                        // NO-OP
02bb8761fcce Initial load
duke
parents:
diff changeset
   766
                    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   767
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   768
                // reinitialize the response flag
02bb8761fcce Initial load
duke
parents:
diff changeset
   769
                this.svResponseReceived.reset();
02bb8761fcce Initial load
duke
parents:
diff changeset
   770
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
   771
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   772
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   773
02bb8761fcce Initial load
duke
parents:
diff changeset
   774
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   775
     * Notify response to ORB for get_next_response
02bb8761fcce Initial load
duke
parents:
diff changeset
   776
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   777
    public void notifyORB()
02bb8761fcce Initial load
duke
parents:
diff changeset
   778
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   779
        synchronized (this.svResponseReceived) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   780
            this.svResponseReceived.set();
02bb8761fcce Initial load
duke
parents:
diff changeset
   781
            this.svResponseReceived.notify();
02bb8761fcce Initial load
duke
parents:
diff changeset
   782
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   783
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   784
02bb8761fcce Initial load
duke
parents:
diff changeset
   785
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   786
     * Convert an object ref to a string.
02bb8761fcce Initial load
duke
parents:
diff changeset
   787
     * @param obj The object to stringify.
02bb8761fcce Initial load
duke
parents:
diff changeset
   788
     * @return A stringified object reference.
02bb8761fcce Initial load
duke
parents:
diff changeset
   789
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   790
    public synchronized String object_to_string(org.omg.CORBA.Object obj)
02bb8761fcce Initial load
duke
parents:
diff changeset
   791
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   792
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   793
02bb8761fcce Initial load
duke
parents:
diff changeset
   794
        // Handle the null objref case
02bb8761fcce Initial load
duke
parents:
diff changeset
   795
        if (obj == null) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   796
            IOR nullIOR = IORFactories.makeIOR( this ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   797
            return nullIOR.stringify();
02bb8761fcce Initial load
duke
parents:
diff changeset
   798
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   799
02bb8761fcce Initial load
duke
parents:
diff changeset
   800
        IOR ior = null ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   801
02bb8761fcce Initial load
duke
parents:
diff changeset
   802
        try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   803
            ior = ORBUtility.connectAndGetIOR( this, obj ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   804
        } catch (BAD_PARAM bp) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   805
            // Throw MARSHAL instead if this is a LOCAL_OBJECT_NOT_ALLOWED error.
02bb8761fcce Initial load
duke
parents:
diff changeset
   806
            if (bp.minor == ORBUtilSystemException.LOCAL_OBJECT_NOT_ALLOWED) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   807
                throw omgWrapper.notAnObjectImpl( bp ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   808
            } else
02bb8761fcce Initial load
duke
parents:
diff changeset
   809
                // Not a local object problem: just rethrow the exception.
02bb8761fcce Initial load
duke
parents:
diff changeset
   810
                // Do not wrap and log this, since it was already logged at its
02bb8761fcce Initial load
duke
parents:
diff changeset
   811
                // point of origin.
02bb8761fcce Initial load
duke
parents:
diff changeset
   812
                throw bp ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   813
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   814
02bb8761fcce Initial load
duke
parents:
diff changeset
   815
        return ior.stringify() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   816
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   817
02bb8761fcce Initial load
duke
parents:
diff changeset
   818
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   819
     * Convert a stringified object reference to the object it represents.
02bb8761fcce Initial load
duke
parents:
diff changeset
   820
     * @param str The stringified object reference.
02bb8761fcce Initial load
duke
parents:
diff changeset
   821
     * @return The unstringified object reference.
02bb8761fcce Initial load
duke
parents:
diff changeset
   822
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   823
    public org.omg.CORBA.Object string_to_object(String str)
02bb8761fcce Initial load
duke
parents:
diff changeset
   824
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   825
        Operation op ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   826
02bb8761fcce Initial load
duke
parents:
diff changeset
   827
        synchronized (this) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   828
            checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   829
            op = urlOperation ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   830
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   831
02bb8761fcce Initial load
duke
parents:
diff changeset
   832
        if (str == null)
02bb8761fcce Initial load
duke
parents:
diff changeset
   833
            throw wrapper.nullParam() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   834
02bb8761fcce Initial load
duke
parents:
diff changeset
   835
        synchronized (resolverLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   836
            org.omg.CORBA.Object obj = (org.omg.CORBA.Object)op.operate( str ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   837
            return obj ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   838
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   839
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   840
02bb8761fcce Initial load
duke
parents:
diff changeset
   841
    // pure java orb support, moved this method from FVDCodeBaseImpl.
02bb8761fcce Initial load
duke
parents:
diff changeset
   842
    // Note that we connect this if we have not already done so.
02bb8761fcce Initial load
duke
parents:
diff changeset
   843
    public synchronized IOR getFVDCodeBaseIOR()
02bb8761fcce Initial load
duke
parents:
diff changeset
   844
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   845
        if (codeBaseIOR != null) // i.e. We are already connected to it
02bb8761fcce Initial load
duke
parents:
diff changeset
   846
            return codeBaseIOR;
02bb8761fcce Initial load
duke
parents:
diff changeset
   847
02bb8761fcce Initial load
duke
parents:
diff changeset
   848
        // backward compatability 4365188
02bb8761fcce Initial load
duke
parents:
diff changeset
   849
        CodeBase cb;
02bb8761fcce Initial load
duke
parents:
diff changeset
   850
02bb8761fcce Initial load
duke
parents:
diff changeset
   851
        ValueHandler vh = ORBUtility.createValueHandler(this);
02bb8761fcce Initial load
duke
parents:
diff changeset
   852
02bb8761fcce Initial load
duke
parents:
diff changeset
   853
        cb = (CodeBase)vh.getRunTimeCodeBase();
02bb8761fcce Initial load
duke
parents:
diff changeset
   854
        return ORBUtility.connectAndGetIOR( this, cb ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   855
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   856
02bb8761fcce Initial load
duke
parents:
diff changeset
   857
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   858
     * Get the TypeCode for a primitive type.
02bb8761fcce Initial load
duke
parents:
diff changeset
   859
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   860
     * @param tcKind    the integer kind for the primitive type
02bb8761fcce Initial load
duke
parents:
diff changeset
   861
     * @return          the requested TypeCode
02bb8761fcce Initial load
duke
parents:
diff changeset
   862
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   863
    public synchronized TypeCode get_primitive_tc(TCKind tcKind)
02bb8761fcce Initial load
duke
parents:
diff changeset
   864
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   865
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   866
        return get_primitive_tc( tcKind.value() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   867
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   868
02bb8761fcce Initial load
duke
parents:
diff changeset
   869
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   870
     * Create a TypeCode for a structure.
02bb8761fcce Initial load
duke
parents:
diff changeset
   871
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   872
     * @param id                the logical id for the typecode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   873
     * @param name      the name for the typecode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   874
     * @param members   an array describing the members of the TypeCode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   875
     * @return          the requested TypeCode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   876
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   877
    public synchronized TypeCode create_struct_tc(String id,
02bb8761fcce Initial load
duke
parents:
diff changeset
   878
                                     String name,
02bb8761fcce Initial load
duke
parents:
diff changeset
   879
                                     StructMember[] members)
02bb8761fcce Initial load
duke
parents:
diff changeset
   880
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   881
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   882
        return new TypeCodeImpl(this, TCKind._tk_struct, id, name, members);
02bb8761fcce Initial load
duke
parents:
diff changeset
   883
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   884
02bb8761fcce Initial load
duke
parents:
diff changeset
   885
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   886
     * Create a TypeCode for a union.
02bb8761fcce Initial load
duke
parents:
diff changeset
   887
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   888
     * @param id                the logical id for the typecode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   889
     * @param name      the name for the typecode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   890
     * @param discriminator_type
02bb8761fcce Initial load
duke
parents:
diff changeset
   891
     *                  the type of the union discriminator.
02bb8761fcce Initial load
duke
parents:
diff changeset
   892
     * @param members   an array describing the members of the TypeCode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   893
     * @return          the requested TypeCode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   894
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   895
    public synchronized TypeCode create_union_tc(String id,
02bb8761fcce Initial load
duke
parents:
diff changeset
   896
                                    String name,
02bb8761fcce Initial load
duke
parents:
diff changeset
   897
                                    TypeCode discriminator_type,
02bb8761fcce Initial load
duke
parents:
diff changeset
   898
                                    UnionMember[] members)
02bb8761fcce Initial load
duke
parents:
diff changeset
   899
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   900
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   901
        return new TypeCodeImpl(this,
02bb8761fcce Initial load
duke
parents:
diff changeset
   902
                                TCKind._tk_union,
02bb8761fcce Initial load
duke
parents:
diff changeset
   903
                                id,
02bb8761fcce Initial load
duke
parents:
diff changeset
   904
                                name,
02bb8761fcce Initial load
duke
parents:
diff changeset
   905
                                discriminator_type,
02bb8761fcce Initial load
duke
parents:
diff changeset
   906
                                members);
02bb8761fcce Initial load
duke
parents:
diff changeset
   907
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   908
02bb8761fcce Initial load
duke
parents:
diff changeset
   909
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   910
     * Create a TypeCode for an enum.
02bb8761fcce Initial load
duke
parents:
diff changeset
   911
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   912
     * @param id                the logical id for the typecode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   913
     * @param name      the name for the typecode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   914
     * @param members   an array describing the members of the TypeCode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   915
     * @return          the requested TypeCode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   916
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   917
    public synchronized TypeCode create_enum_tc(String id,
02bb8761fcce Initial load
duke
parents:
diff changeset
   918
                                   String name,
02bb8761fcce Initial load
duke
parents:
diff changeset
   919
                                   String[] members)
02bb8761fcce Initial load
duke
parents:
diff changeset
   920
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   921
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   922
        return new TypeCodeImpl(this, TCKind._tk_enum, id, name, members);
02bb8761fcce Initial load
duke
parents:
diff changeset
   923
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   924
02bb8761fcce Initial load
duke
parents:
diff changeset
   925
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   926
     * Create a TypeCode for an alias.
02bb8761fcce Initial load
duke
parents:
diff changeset
   927
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   928
     * @param id                the logical id for the typecode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   929
     * @param name      the name for the typecode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   930
     * @param original_type
02bb8761fcce Initial load
duke
parents:
diff changeset
   931
     *                  the type this is an alias for.
02bb8761fcce Initial load
duke
parents:
diff changeset
   932
     * @return          the requested TypeCode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   933
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   934
    public synchronized TypeCode create_alias_tc(String id,
02bb8761fcce Initial load
duke
parents:
diff changeset
   935
                                    String name,
02bb8761fcce Initial load
duke
parents:
diff changeset
   936
                                    TypeCode original_type)
02bb8761fcce Initial load
duke
parents:
diff changeset
   937
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   938
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   939
        return new TypeCodeImpl(this, TCKind._tk_alias, id, name, original_type);
02bb8761fcce Initial load
duke
parents:
diff changeset
   940
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   941
02bb8761fcce Initial load
duke
parents:
diff changeset
   942
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   943
     * Create a TypeCode for an exception.
02bb8761fcce Initial load
duke
parents:
diff changeset
   944
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   945
     * @param id                the logical id for the typecode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   946
     * @param name      the name for the typecode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   947
     * @param members   an array describing the members of the TypeCode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   948
     * @return          the requested TypeCode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   949
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   950
    public synchronized TypeCode create_exception_tc(String id,
02bb8761fcce Initial load
duke
parents:
diff changeset
   951
                                        String name,
02bb8761fcce Initial load
duke
parents:
diff changeset
   952
                                        StructMember[] members)
02bb8761fcce Initial load
duke
parents:
diff changeset
   953
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   954
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   955
        return new TypeCodeImpl(this, TCKind._tk_except, id, name, members);
02bb8761fcce Initial load
duke
parents:
diff changeset
   956
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   957
02bb8761fcce Initial load
duke
parents:
diff changeset
   958
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   959
     * Create a TypeCode for an interface.
02bb8761fcce Initial load
duke
parents:
diff changeset
   960
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   961
     * @param id                the logical id for the typecode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   962
     * @param name      the name for the typecode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   963
     * @return          the requested TypeCode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   964
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   965
    public synchronized TypeCode create_interface_tc(String id,
02bb8761fcce Initial load
duke
parents:
diff changeset
   966
                                        String name)
02bb8761fcce Initial load
duke
parents:
diff changeset
   967
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   968
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   969
        return new TypeCodeImpl(this, TCKind._tk_objref, id, name);
02bb8761fcce Initial load
duke
parents:
diff changeset
   970
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   971
02bb8761fcce Initial load
duke
parents:
diff changeset
   972
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   973
     * Create a TypeCode for a string.
02bb8761fcce Initial load
duke
parents:
diff changeset
   974
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   975
     * @param bound     the bound for the string.
02bb8761fcce Initial load
duke
parents:
diff changeset
   976
     * @return          the requested TypeCode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   977
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   978
    public synchronized TypeCode create_string_tc(int bound)
02bb8761fcce Initial load
duke
parents:
diff changeset
   979
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   980
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   981
        return new TypeCodeImpl(this, TCKind._tk_string, bound);
02bb8761fcce Initial load
duke
parents:
diff changeset
   982
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   983
02bb8761fcce Initial load
duke
parents:
diff changeset
   984
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   985
     * Create a TypeCode for a wide string.
02bb8761fcce Initial load
duke
parents:
diff changeset
   986
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   987
     * @param bound     the bound for the string.
02bb8761fcce Initial load
duke
parents:
diff changeset
   988
     * @return          the requested TypeCode.
02bb8761fcce Initial load
duke
parents:
diff changeset
   989
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   990
    public synchronized TypeCode create_wstring_tc(int bound)
02bb8761fcce Initial load
duke
parents:
diff changeset
   991
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   992
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   993
        return new TypeCodeImpl(this, TCKind._tk_wstring, bound);
02bb8761fcce Initial load
duke
parents:
diff changeset
   994
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   995
02bb8761fcce Initial load
duke
parents:
diff changeset
   996
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   997
     * Create a TypeCode for a sequence.
02bb8761fcce Initial load
duke
parents:
diff changeset
   998
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
   999
     * @param bound     the bound for the sequence.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1000
     * @param element_type
02bb8761fcce Initial load
duke
parents:
diff changeset
  1001
     *                  the type of elements of the sequence.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1002
     * @return          the requested TypeCode.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1003
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1004
    public synchronized TypeCode create_sequence_tc(int bound,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1005
                                       TypeCode element_type)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1006
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1007
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1008
        return new TypeCodeImpl(this, TCKind._tk_sequence, bound, element_type);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1009
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1010
02bb8761fcce Initial load
duke
parents:
diff changeset
  1011
02bb8761fcce Initial load
duke
parents:
diff changeset
  1012
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
  1013
     * Create a recursive TypeCode in a sequence.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1014
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
  1015
     * @param bound     the bound for the sequence.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1016
     * @param offset    the index to the enclosing TypeCode that is
02bb8761fcce Initial load
duke
parents:
diff changeset
  1017
     *                  being referenced.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1018
     * @return          the requested TypeCode.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1019
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1020
    public synchronized TypeCode create_recursive_sequence_tc(int bound,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1021
                                                 int offset)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1022
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1023
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1024
        return new TypeCodeImpl(this, TCKind._tk_sequence, bound, offset);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1025
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1026
02bb8761fcce Initial load
duke
parents:
diff changeset
  1027
02bb8761fcce Initial load
duke
parents:
diff changeset
  1028
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
  1029
     * Create a TypeCode for an array.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1030
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
  1031
     * @param length    the length of the array.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1032
     * @param element_type
02bb8761fcce Initial load
duke
parents:
diff changeset
  1033
     *                  the type of elements of the array.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1034
     * @return          the requested TypeCode.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1035
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1036
    public synchronized TypeCode create_array_tc(int length,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1037
                                    TypeCode element_type)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1038
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1039
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1040
        return new TypeCodeImpl(this, TCKind._tk_array, length, element_type);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1041
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1042
02bb8761fcce Initial load
duke
parents:
diff changeset
  1043
02bb8761fcce Initial load
duke
parents:
diff changeset
  1044
    public synchronized org.omg.CORBA.TypeCode create_native_tc(String id,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1045
                                                   String name)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1046
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1047
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1048
        return new TypeCodeImpl(this, TCKind._tk_native, id, name);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1049
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1050
02bb8761fcce Initial load
duke
parents:
diff changeset
  1051
    public synchronized org.omg.CORBA.TypeCode create_abstract_interface_tc(
02bb8761fcce Initial load
duke
parents:
diff changeset
  1052
                                                               String id,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1053
                                                               String name)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1054
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1055
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1056
        return new TypeCodeImpl(this, TCKind._tk_abstract_interface, id, name);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1057
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1058
02bb8761fcce Initial load
duke
parents:
diff changeset
  1059
    public synchronized org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1060
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1061
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1062
        return new TypeCodeImpl(this, TCKind._tk_fixed, digits, scale);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1063
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1064
02bb8761fcce Initial load
duke
parents:
diff changeset
  1065
    public synchronized org.omg.CORBA.TypeCode create_value_tc(String id,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1066
                                                  String name,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1067
                                                  short type_modifier,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1068
                                                  TypeCode concrete_base,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1069
                                                  ValueMember[] members)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1070
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1071
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1072
        return new TypeCodeImpl(this, TCKind._tk_value, id, name,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1073
                                type_modifier, concrete_base, members);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1074
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1075
02bb8761fcce Initial load
duke
parents:
diff changeset
  1076
    public synchronized org.omg.CORBA.TypeCode create_recursive_tc(String id) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1077
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1078
        return new TypeCodeImpl(this, id);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1079
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1080
02bb8761fcce Initial load
duke
parents:
diff changeset
  1081
    public synchronized org.omg.CORBA.TypeCode create_value_box_tc(String id,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1082
                                                      String name,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1083
                                                      TypeCode boxed_type)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1084
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1085
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1086
        return new TypeCodeImpl(this, TCKind._tk_value_box, id, name,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1087
            boxed_type);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1088
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1089
02bb8761fcce Initial load
duke
parents:
diff changeset
  1090
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
  1091
     * Create a new Any
02bb8761fcce Initial load
duke
parents:
diff changeset
  1092
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
  1093
     * @return          the new Any created.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1094
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1095
    public synchronized Any create_any()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1096
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1097
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1098
        return new AnyImpl(this);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1099
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1100
02bb8761fcce Initial load
duke
parents:
diff changeset
  1101
    // TypeCodeFactory interface methods.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1102
    // Keeping track of type codes by repository id.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1103
02bb8761fcce Initial load
duke
parents:
diff changeset
  1104
    // Keeping a cache of TypeCodes associated with the class
02bb8761fcce Initial load
duke
parents:
diff changeset
  1105
    // they got created from in Util.writeAny().
02bb8761fcce Initial load
duke
parents:
diff changeset
  1106
02bb8761fcce Initial load
duke
parents:
diff changeset
  1107
    public synchronized void setTypeCodeForClass(Class c, TypeCodeImpl tci)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1108
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1109
        if (typeCodeForClassMap == null)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1110
            typeCodeForClassMap = Collections.synchronizedMap(
02bb8761fcce Initial load
duke
parents:
diff changeset
  1111
                new WeakHashMap(64));
02bb8761fcce Initial load
duke
parents:
diff changeset
  1112
        // Store only one TypeCode per class.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1113
        if ( ! typeCodeForClassMap.containsKey(c))
02bb8761fcce Initial load
duke
parents:
diff changeset
  1114
            typeCodeForClassMap.put(c, tci);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1115
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1116
02bb8761fcce Initial load
duke
parents:
diff changeset
  1117
    public synchronized TypeCodeImpl getTypeCodeForClass(Class c)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1118
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1119
        if (typeCodeForClassMap == null)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1120
            return null;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1121
        return (TypeCodeImpl)typeCodeForClassMap.get(c);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1122
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1123
02bb8761fcce Initial load
duke
parents:
diff changeset
  1124
/****************************************************************************
02bb8761fcce Initial load
duke
parents:
diff changeset
  1125
 * The following methods deal with listing and resolving the initial
02bb8761fcce Initial load
duke
parents:
diff changeset
  1126
 * (bootstrap) object references such as "NameService".
02bb8761fcce Initial load
duke
parents:
diff changeset
  1127
 ****************************************************************************/
02bb8761fcce Initial load
duke
parents:
diff changeset
  1128
02bb8761fcce Initial load
duke
parents:
diff changeset
  1129
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
  1130
     * Get a list of the initially available CORBA services.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1131
     * This does not work unless an ORBInitialHost is specified during
02bb8761fcce Initial load
duke
parents:
diff changeset
  1132
     * initialization (or unless there is an ORB running on the AppletHost)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1133
     * since the localhostname
02bb8761fcce Initial load
duke
parents:
diff changeset
  1134
     * is inaccessible to applets. If a service properties URL was specified,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1135
     * then it is used, otherwise the bootstrapping protocol is used.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1136
     * @return A list of the initial services available.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1137
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1138
    public String[] list_initial_services()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1139
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1140
        Resolver res ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1141
02bb8761fcce Initial load
duke
parents:
diff changeset
  1142
        synchronized( this ) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1143
            checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1144
            res = resolver ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1145
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1146
02bb8761fcce Initial load
duke
parents:
diff changeset
  1147
        synchronized (resolverLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1148
            java.util.Set keys = res.list() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1149
            return (String[])keys.toArray( new String[keys.size()] ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1150
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1151
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1152
02bb8761fcce Initial load
duke
parents:
diff changeset
  1153
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
  1154
     * Resolve the stringified reference of one of the initially
02bb8761fcce Initial load
duke
parents:
diff changeset
  1155
     * available CORBA services.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1156
     * @param identifier The stringified object reference of the
02bb8761fcce Initial load
duke
parents:
diff changeset
  1157
     * desired service.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1158
     * @return An object reference for the desired service.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1159
     * @exception InvalidName The supplied identifier is not associated
02bb8761fcce Initial load
duke
parents:
diff changeset
  1160
     * with a known service.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1161
     * @exception SystemException One of a fixed set of Corba system exceptions.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1162
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1163
    public org.omg.CORBA.Object resolve_initial_references(
02bb8761fcce Initial load
duke
parents:
diff changeset
  1164
        String identifier) throws InvalidName
02bb8761fcce Initial load
duke
parents:
diff changeset
  1165
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1166
        Resolver res ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1167
02bb8761fcce Initial load
duke
parents:
diff changeset
  1168
        synchronized( this ) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1169
            checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1170
            res = resolver ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1171
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1172
02bb8761fcce Initial load
duke
parents:
diff changeset
  1173
        synchronized (resolverLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1174
            org.omg.CORBA.Object result = res.resolve( identifier ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1175
02bb8761fcce Initial load
duke
parents:
diff changeset
  1176
            if (result == null)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1177
                throw new InvalidName() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1178
            else
02bb8761fcce Initial load
duke
parents:
diff changeset
  1179
                return result ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1180
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1181
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1182
02bb8761fcce Initial load
duke
parents:
diff changeset
  1183
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
  1184
     * If this operation is called with an id, <code>"Y"</code>, and an
02bb8761fcce Initial load
duke
parents:
diff changeset
  1185
     * object, <code>YY</code>, then a subsequent call to
02bb8761fcce Initial load
duke
parents:
diff changeset
  1186
     * <code>ORB.resolve_initial_references( "Y" )</code> will
02bb8761fcce Initial load
duke
parents:
diff changeset
  1187
     * return object <code>YY</code>.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1188
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
  1189
     * @param id The ID by which the initial reference will be known.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1190
     * @param obj The initial reference itself.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1191
     * @throws InvalidName if this operation is called with an empty string id
02bb8761fcce Initial load
duke
parents:
diff changeset
  1192
     *     or this operation is called with an id that is already registered,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1193
     *     including the default names defined by OMG.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1194
     * @throws BAD_PARAM if the obj parameter is null.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1195
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1196
    public void register_initial_reference(
02bb8761fcce Initial load
duke
parents:
diff changeset
  1197
        String id, org.omg.CORBA.Object obj ) throws InvalidName
02bb8761fcce Initial load
duke
parents:
diff changeset
  1198
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1199
        CorbaServerRequestDispatcher insnd ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1200
02bb8761fcce Initial load
duke
parents:
diff changeset
  1201
        if ((id == null) || (id.length() == 0))
02bb8761fcce Initial load
duke
parents:
diff changeset
  1202
            throw new InvalidName() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1203
02bb8761fcce Initial load
duke
parents:
diff changeset
  1204
        synchronized (this) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1205
            checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1206
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1207
02bb8761fcce Initial load
duke
parents:
diff changeset
  1208
        synchronized (resolverLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1209
            insnd = insNamingDelegate ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1210
02bb8761fcce Initial load
duke
parents:
diff changeset
  1211
            java.lang.Object obj2 = localResolver.resolve( id ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1212
            if (obj2 != null)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1213
                throw new InvalidName(id + " already registered") ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1214
02bb8761fcce Initial load
duke
parents:
diff changeset
  1215
            localResolver.register( id, ClosureFactory.makeConstant( obj )) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1216
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1217
02bb8761fcce Initial load
duke
parents:
diff changeset
  1218
        synchronized (this) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1219
            if (StubAdapter.isStub(obj))
02bb8761fcce Initial load
duke
parents:
diff changeset
  1220
                // Make all remote object references available for INS.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1221
                requestDispatcherRegistry.registerServerRequestDispatcher(
02bb8761fcce Initial load
duke
parents:
diff changeset
  1222
                    insnd, id ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1223
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1224
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1225
02bb8761fcce Initial load
duke
parents:
diff changeset
  1226
/****************************************************************************
02bb8761fcce Initial load
duke
parents:
diff changeset
  1227
 * The following methods (introduced in POA / CORBA2.1) deal with
02bb8761fcce Initial load
duke
parents:
diff changeset
  1228
 * shutdown / single threading.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1229
 ****************************************************************************/
02bb8761fcce Initial load
duke
parents:
diff changeset
  1230
02bb8761fcce Initial load
duke
parents:
diff changeset
  1231
    public void run()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1232
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1233
        synchronized (this) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1234
            checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1235
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1236
02bb8761fcce Initial load
duke
parents:
diff changeset
  1237
        synchronized (runObj) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1238
            try {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1239
                runObj.wait();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1240
            } catch ( InterruptedException ex ) {}
02bb8761fcce Initial load
duke
parents:
diff changeset
  1241
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1242
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1243
02bb8761fcce Initial load
duke
parents:
diff changeset
  1244
    public void shutdown(boolean wait_for_completion)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1245
    {
2664
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1246
        // to wait for completion, we would deadlock, so throw a standard
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1247
        // OMG exception.
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1248
        if (wait_for_completion && ((Boolean)isProcessingInvocation.get()).booleanValue()) {
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1249
            throw omgWrapper.shutdownWaitForCompletionDeadlock() ;
4
02bb8761fcce Initial load
duke
parents:
diff changeset
  1250
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1251
2664
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1252
        boolean doShutdown = false ;
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1253
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1254
        synchronized (this) {
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1255
            checkShutdownState() ;
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1256
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1257
            if (status == STATUS_SHUTTING_DOWN) {
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1258
                if (!wait_for_completion)
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1259
                // If we are already shutting down and don't want
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1260
                // to wait, nothing to do: return.
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1261
                return ;
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1262
            } else {
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1263
                // The ORB status was STATUS_OPERATING, so start the shutdown.
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1264
                status = STATUS_SHUTTING_DOWN ;
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1265
                doShutdown = true ;
4
02bb8761fcce Initial load
duke
parents:
diff changeset
  1266
            }
2664
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1267
        }
4
02bb8761fcce Initial load
duke
parents:
diff changeset
  1268
2664
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1269
        // At this point, status is SHUTTING_DOWN.
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1270
        // All shutdown calls with wait_for_completion == true must synchronize
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1271
        // here.  Only the first call will be made with doShutdown == true.
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1272
        synchronized (shutdownObj) {
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1273
            if (doShutdown) {
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1274
                // shutdownServants will set all POAManagers into the
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1275
                // INACTIVE state, causing request to be rejected.
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1276
                // If wait_for_completion is true, this will not return until
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1277
                // all invocations have completed.
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1278
                shutdownServants(wait_for_completion);
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1279
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1280
                synchronized (runObj) {
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1281
                    runObj.notifyAll();
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1282
                }
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1283
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1284
                synchronized (this) {
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1285
                    status = STATUS_SHUTDOWN;
4
02bb8761fcce Initial load
duke
parents:
diff changeset
  1286
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1287
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1288
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1289
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1290
02bb8761fcce Initial load
duke
parents:
diff changeset
  1291
    /** This method shuts down the ORB and causes orb.run() to return.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1292
     *  It will cause all POAManagers to be deactivated, which in turn
02bb8761fcce Initial load
duke
parents:
diff changeset
  1293
     *  will cause all POAs to be deactivated.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1294
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1295
    protected void shutdownServants(boolean wait_for_completion) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1296
        Iterator iter = requestDispatcherRegistry.getObjectAdapterFactories().iterator() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1297
        while (iter.hasNext()) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1298
            ObjectAdapterFactory oaf = (ObjectAdapterFactory)iter.next() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1299
            oaf.shutdown( wait_for_completion ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1300
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1301
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1302
02bb8761fcce Initial load
duke
parents:
diff changeset
  1303
    // REVISIT: was protected - made public for framework
02bb8761fcce Initial load
duke
parents:
diff changeset
  1304
    // Note that the caller must hold the ORBImpl lock.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1305
    public void checkShutdownState()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1306
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1307
        if (status == STATUS_DESTROYED) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1308
            throw wrapper.orbDestroyed() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1309
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1310
02bb8761fcce Initial load
duke
parents:
diff changeset
  1311
        if (status == STATUS_SHUTDOWN) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1312
            throw omgWrapper.badOperationAfterShutdown() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1313
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1314
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1315
02bb8761fcce Initial load
duke
parents:
diff changeset
  1316
    public boolean isDuringDispatch()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1317
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1318
        Boolean value = (Boolean)(isProcessingInvocation.get()) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1319
        return value.booleanValue() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1320
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1321
02bb8761fcce Initial load
duke
parents:
diff changeset
  1322
    public void startingDispatch()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1323
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1324
        synchronized (invocationObj) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1325
            isProcessingInvocation.set(Boolean.TRUE);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1326
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1327
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1328
02bb8761fcce Initial load
duke
parents:
diff changeset
  1329
    public void finishedDispatch()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1330
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1331
        synchronized (invocationObj) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1332
            isProcessingInvocation.set(Boolean.FALSE);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1333
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1334
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1335
02bb8761fcce Initial load
duke
parents:
diff changeset
  1336
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
  1337
     *  formal/99-10-07 p 159: "If destroy is called on an ORB that has
02bb8761fcce Initial load
duke
parents:
diff changeset
  1338
     *  not been shut down, it will start the shutdown process and block until
02bb8761fcce Initial load
duke
parents:
diff changeset
  1339
     *  the ORB has shut down before it destroys the ORB."
02bb8761fcce Initial load
duke
parents:
diff changeset
  1340
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1341
    public synchronized void destroy()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1342
    {
2664
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1343
        boolean shutdownFirst = false ;
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1344
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1345
        synchronized (this) {
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1346
            shutdownFirst = (status == STATUS_OPERATING) ;
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1347
        }
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1348
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1349
        if (shutdownFirst) {
4
02bb8761fcce Initial load
duke
parents:
diff changeset
  1350
            shutdown(true);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1351
        }
2664
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1352
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1353
        synchronized (this) {
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1354
            if (status < STATUS_DESTROYED) {
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1355
                getCorbaTransportManager().close();
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1356
                getPIHandler().destroyInterceptors() ;
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1357
                status = STATUS_DESTROYED;
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1358
            }
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1359
        }
a0a22a8f16bd 6372405: Server thread hangs when fragments don't complete because of connection abort
tbell
parents: 4
diff changeset
  1360
4
02bb8761fcce Initial load
duke
parents:
diff changeset
  1361
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1362
02bb8761fcce Initial load
duke
parents:
diff changeset
  1363
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
  1364
     * Registers a value factory for a particular repository ID.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1365
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
  1366
     * @param repositoryID the repository ID.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1367
     * @param factory the factory.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1368
     * @return the previously registered factory for the given repository ID,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1369
     * or null if no such factory was previously registered.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1370
     * @exception org.omg.CORBA.BAD_PARAM if the registration fails.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1371
     **/
02bb8761fcce Initial load
duke
parents:
diff changeset
  1372
    public synchronized ValueFactory register_value_factory(String repositoryID,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1373
        ValueFactory factory)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1374
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1375
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1376
02bb8761fcce Initial load
duke
parents:
diff changeset
  1377
        if ((repositoryID == null) || (factory == null))
02bb8761fcce Initial load
duke
parents:
diff changeset
  1378
            throw omgWrapper.unableRegisterValueFactory() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1379
02bb8761fcce Initial load
duke
parents:
diff changeset
  1380
        return (ValueFactory)valueFactoryCache.put(repositoryID, factory);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1381
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1382
02bb8761fcce Initial load
duke
parents:
diff changeset
  1383
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
  1384
     * Unregisters a value factory for a particular repository ID.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1385
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
  1386
     * @param repositoryID the repository ID.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1387
     **/
02bb8761fcce Initial load
duke
parents:
diff changeset
  1388
    public synchronized void unregister_value_factory(String repositoryID)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1389
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1390
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1391
02bb8761fcce Initial load
duke
parents:
diff changeset
  1392
        if (valueFactoryCache.remove(repositoryID) == null)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1393
            throw wrapper.nullParam() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1394
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1395
02bb8761fcce Initial load
duke
parents:
diff changeset
  1396
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
  1397
     * Finds and returns a value factory for the given repository ID.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1398
     * The value factory returned was previously registered by a call to
02bb8761fcce Initial load
duke
parents:
diff changeset
  1399
     * {@link #register_value_factory} or is the default factory.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1400
     *
02bb8761fcce Initial load
duke
parents:
diff changeset
  1401
     * @param repositoryID the repository ID.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1402
     * @return the value factory.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1403
     * @exception org.omg.CORBA.BAD_PARAM if unable to locate a factory.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1404
     **/
02bb8761fcce Initial load
duke
parents:
diff changeset
  1405
    public synchronized ValueFactory lookup_value_factory(String repositoryID)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1406
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1407
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1408
02bb8761fcce Initial load
duke
parents:
diff changeset
  1409
        ValueFactory factory =
02bb8761fcce Initial load
duke
parents:
diff changeset
  1410
            (ValueFactory)valueFactoryCache.get(repositoryID);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1411
02bb8761fcce Initial load
duke
parents:
diff changeset
  1412
        if (factory == null) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1413
            try {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1414
                factory = Utility.getFactory(null, null, null, repositoryID);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1415
            } catch(org.omg.CORBA.MARSHAL ex) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1416
                throw wrapper.unableFindValueFactory( ex ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1417
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1418
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1419
02bb8761fcce Initial load
duke
parents:
diff changeset
  1420
        return factory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1421
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1422
02bb8761fcce Initial load
duke
parents:
diff changeset
  1423
    public OAInvocationInfo peekInvocationInfo()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1424
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1425
        StackImpl stack = (StackImpl)(OAInvocationInfoStack.get()) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1426
        return (OAInvocationInfo)(stack.peek()) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1427
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1428
02bb8761fcce Initial load
duke
parents:
diff changeset
  1429
    public void pushInvocationInfo( OAInvocationInfo info )
02bb8761fcce Initial load
duke
parents:
diff changeset
  1430
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1431
        StackImpl stack = (StackImpl)(OAInvocationInfoStack.get()) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1432
        stack.push( info ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1433
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1434
02bb8761fcce Initial load
duke
parents:
diff changeset
  1435
    public OAInvocationInfo popInvocationInfo()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1436
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1437
        StackImpl stack = (StackImpl)(OAInvocationInfoStack.get()) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1438
        return (OAInvocationInfo)(stack.pop()) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1439
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1440
02bb8761fcce Initial load
duke
parents:
diff changeset
  1441
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
  1442
     * The bad server id handler is used by the Locator to
02bb8761fcce Initial load
duke
parents:
diff changeset
  1443
     * send back the location of a persistant server to the client.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1444
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1445
02bb8761fcce Initial load
duke
parents:
diff changeset
  1446
    private Object badServerIdHandlerAccessLock = new Object();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1447
02bb8761fcce Initial load
duke
parents:
diff changeset
  1448
    public void initBadServerIdHandler()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1449
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1450
        synchronized (badServerIdHandlerAccessLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1451
            Class cls = configData.getBadServerIdHandler() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1452
            if (cls != null) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1453
                try {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1454
                    Class[] params = new Class[] { org.omg.CORBA.ORB.class };
02bb8761fcce Initial load
duke
parents:
diff changeset
  1455
                    java.lang.Object[] args = new java.lang.Object[]{this};
02bb8761fcce Initial load
duke
parents:
diff changeset
  1456
                    Constructor cons = cls.getConstructor(params);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1457
                    badServerIdHandler =
02bb8761fcce Initial load
duke
parents:
diff changeset
  1458
                        (BadServerIdHandler) cons.newInstance(args);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1459
                } catch (Exception e) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1460
                    throw wrapper.errorInitBadserveridhandler( e ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1461
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1462
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1463
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1464
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1465
02bb8761fcce Initial load
duke
parents:
diff changeset
  1466
    public void setBadServerIdHandler( BadServerIdHandler handler )
02bb8761fcce Initial load
duke
parents:
diff changeset
  1467
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1468
        synchronized (badServerIdHandlerAccessLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1469
            badServerIdHandler = handler;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1470
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1471
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1472
02bb8761fcce Initial load
duke
parents:
diff changeset
  1473
    public void handleBadServerId( ObjectKey okey )
02bb8761fcce Initial load
duke
parents:
diff changeset
  1474
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1475
        synchronized (badServerIdHandlerAccessLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1476
            if (badServerIdHandler == null)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1477
                throw wrapper.badServerId() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1478
            else
02bb8761fcce Initial load
duke
parents:
diff changeset
  1479
                badServerIdHandler.handle( okey ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1480
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1481
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1482
02bb8761fcce Initial load
duke
parents:
diff changeset
  1483
    public synchronized org.omg.CORBA.Policy create_policy( int type,
02bb8761fcce Initial load
duke
parents:
diff changeset
  1484
        org.omg.CORBA.Any val ) throws org.omg.CORBA.PolicyError
02bb8761fcce Initial load
duke
parents:
diff changeset
  1485
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1486
        checkShutdownState() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1487
02bb8761fcce Initial load
duke
parents:
diff changeset
  1488
        return pihandler.create_policy( type, val ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1489
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1490
02bb8761fcce Initial load
duke
parents:
diff changeset
  1491
    /** This is the implementation of the public API used to connect
02bb8761fcce Initial load
duke
parents:
diff changeset
  1492
     *  a servant-skeleton to the ORB.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1493
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1494
    public synchronized void connect(org.omg.CORBA.Object servant)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1495
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1496
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1497
        if (getTOAFactory() == null)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1498
            throw wrapper.noToa() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1499
02bb8761fcce Initial load
duke
parents:
diff changeset
  1500
        try {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1501
            String codebase = javax.rmi.CORBA.Util.getCodebase( servant.getClass() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1502
            getTOAFactory().getTOA( codebase ).connect( servant ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1503
        } catch ( Exception ex ) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1504
            throw wrapper.orbConnectError( ex ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1505
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1506
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1507
02bb8761fcce Initial load
duke
parents:
diff changeset
  1508
    public synchronized void disconnect(org.omg.CORBA.Object obj)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1509
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1510
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1511
        if (getTOAFactory() == null)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1512
            throw wrapper.noToa() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1513
02bb8761fcce Initial load
duke
parents:
diff changeset
  1514
        try {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1515
            getTOAFactory().getTOA().disconnect( obj ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1516
        } catch ( Exception ex ) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1517
            throw wrapper.orbConnectError( ex ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1518
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1519
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1520
02bb8761fcce Initial load
duke
parents:
diff changeset
  1521
    public int getTransientServerId()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1522
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1523
        if( configData.getORBServerIdPropertySpecified( ) ) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1524
            // ORBServerId is specified then use that value
02bb8761fcce Initial load
duke
parents:
diff changeset
  1525
            return configData.getPersistentServerId( );
02bb8761fcce Initial load
duke
parents:
diff changeset
  1526
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1527
        return transientServerId;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1528
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1529
02bb8761fcce Initial load
duke
parents:
diff changeset
  1530
    public RequestDispatcherRegistry getRequestDispatcherRegistry()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1531
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1532
        return requestDispatcherRegistry;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1533
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1534
02bb8761fcce Initial load
duke
parents:
diff changeset
  1535
    public ServiceContextRegistry getServiceContextRegistry()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1536
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1537
        return serviceContextRegistry ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1538
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1539
02bb8761fcce Initial load
duke
parents:
diff changeset
  1540
    // XXX All of the isLocalXXX checking needs to be revisited.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1541
    // First of all, all three of these methods are called from
02bb8761fcce Initial load
duke
parents:
diff changeset
  1542
    // only one place in impl.ior.IORImpl.  Second, we have problems
02bb8761fcce Initial load
duke
parents:
diff changeset
  1543
    // both with multi-homed hosts and with multi-profile IORs.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1544
    // A possible strategy: like the LocalClientRequestDispatcher, we need
02bb8761fcce Initial load
duke
parents:
diff changeset
  1545
    // to determine this more abstractly at the ContactInfo level.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1546
    // This level should probably just get the CorbaContactInfoList from
02bb8761fcce Initial load
duke
parents:
diff changeset
  1547
    // the IOR, then iterator over ContactInfo.  If any ContactInfo is
02bb8761fcce Initial load
duke
parents:
diff changeset
  1548
    // local, the IOR is local, and we can pick one to create the
02bb8761fcce Initial load
duke
parents:
diff changeset
  1549
    // LocalClientRequestDispatcher as well.  Bottom line: this code needs to move.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1550
02bb8761fcce Initial load
duke
parents:
diff changeset
  1551
    // XXX What about multi-homed host?
02bb8761fcce Initial load
duke
parents:
diff changeset
  1552
    public boolean isLocalHost( String hostName )
02bb8761fcce Initial load
duke
parents:
diff changeset
  1553
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1554
        return hostName.equals( configData.getORBServerHost() ) ||
02bb8761fcce Initial load
duke
parents:
diff changeset
  1555
            hostName.equals( getLocalHostName() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1556
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1557
02bb8761fcce Initial load
duke
parents:
diff changeset
  1558
    public boolean isLocalServerId( int subcontractId, int serverId )
02bb8761fcce Initial load
duke
parents:
diff changeset
  1559
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1560
        if ((subcontractId < ORBConstants.FIRST_POA_SCID) ||
02bb8761fcce Initial load
duke
parents:
diff changeset
  1561
            (subcontractId > ORBConstants.MAX_POA_SCID))
02bb8761fcce Initial load
duke
parents:
diff changeset
  1562
            return serverId == getTransientServerId( ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1563
02bb8761fcce Initial load
duke
parents:
diff changeset
  1564
        // XXX isTransient info should be stored in subcontract registry
02bb8761fcce Initial load
duke
parents:
diff changeset
  1565
        if (ORBConstants.isTransient( subcontractId ))
02bb8761fcce Initial load
duke
parents:
diff changeset
  1566
            return (serverId == getTransientServerId()) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1567
        else if (configData.getPersistentServerIdInitialized())
02bb8761fcce Initial load
duke
parents:
diff changeset
  1568
            return (serverId == configData.getPersistentServerId()) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1569
        else
02bb8761fcce Initial load
duke
parents:
diff changeset
  1570
            return false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1571
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1572
02bb8761fcce Initial load
duke
parents:
diff changeset
  1573
    /*************************************************************************
02bb8761fcce Initial load
duke
parents:
diff changeset
  1574
     *  The following public methods are for ORB shutdown.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1575
     *************************************************************************/
02bb8761fcce Initial load
duke
parents:
diff changeset
  1576
02bb8761fcce Initial load
duke
parents:
diff changeset
  1577
    private String getHostName(String host)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1578
        throws java.net.UnknownHostException
02bb8761fcce Initial load
duke
parents:
diff changeset
  1579
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1580
        return InetAddress.getByName( host ).getHostAddress();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1581
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1582
02bb8761fcce Initial load
duke
parents:
diff changeset
  1583
    /* keeping a copy of the getLocalHostName so that it can only be called
02bb8761fcce Initial load
duke
parents:
diff changeset
  1584
     * internally and the unauthorized clients cannot have access to the
02bb8761fcce Initial load
duke
parents:
diff changeset
  1585
     * localHost information, originally, the above code was calling
02bb8761fcce Initial load
duke
parents:
diff changeset
  1586
     * getLocalHostName from Connection.java.  If the hostname is cached in
02bb8761fcce Initial load
duke
parents:
diff changeset
  1587
     * Connection.java, then
02bb8761fcce Initial load
duke
parents:
diff changeset
  1588
     * it is a security hole, since any unauthorized client has access to
02bb8761fcce Initial load
duke
parents:
diff changeset
  1589
     * the host information.  With this change it is used internally so the
02bb8761fcce Initial load
duke
parents:
diff changeset
  1590
     * security problem is resolved.  Also in Connection.java, the
02bb8761fcce Initial load
duke
parents:
diff changeset
  1591
     * getLocalHost() implementation has changed to always call the
02bb8761fcce Initial load
duke
parents:
diff changeset
  1592
     * InetAddress.getLocalHost().getHostAddress()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1593
     * The above mentioned method has been removed from the connection class
02bb8761fcce Initial load
duke
parents:
diff changeset
  1594
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1595
02bb8761fcce Initial load
duke
parents:
diff changeset
  1596
    private static String localHostString = null;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1597
02bb8761fcce Initial load
duke
parents:
diff changeset
  1598
    private synchronized String getLocalHostName()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1599
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1600
        if (localHostString == null) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1601
            try {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1602
                localHostString = InetAddress.getLocalHost().getHostAddress();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1603
            } catch (Exception ex) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1604
                throw wrapper.getLocalHostFailed( ex ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1605
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1606
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1607
        return localHostString ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1608
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1609
02bb8761fcce Initial load
duke
parents:
diff changeset
  1610
 /******************************************************************************
02bb8761fcce Initial load
duke
parents:
diff changeset
  1611
 *  The following public methods are for ORB shutdown.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1612
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
  1613
 ******************************************************************************/
02bb8761fcce Initial load
duke
parents:
diff changeset
  1614
02bb8761fcce Initial load
duke
parents:
diff changeset
  1615
    /** This method always returns false because the ORB never needs the
02bb8761fcce Initial load
duke
parents:
diff changeset
  1616
     *  main thread to do work.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1617
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1618
    public synchronized boolean work_pending()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1619
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1620
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1621
        throw wrapper.genericNoImpl() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1622
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1623
02bb8761fcce Initial load
duke
parents:
diff changeset
  1624
    /** This method does nothing. It is not required by the spec to do anything!
02bb8761fcce Initial load
duke
parents:
diff changeset
  1625
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1626
    public synchronized void perform_work()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1627
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1628
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1629
        throw wrapper.genericNoImpl() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1630
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1631
02bb8761fcce Initial load
duke
parents:
diff changeset
  1632
    public synchronized void set_delegate(java.lang.Object servant){
02bb8761fcce Initial load
duke
parents:
diff changeset
  1633
        checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1634
02bb8761fcce Initial load
duke
parents:
diff changeset
  1635
        POAFactory poaFactory = getPOAFactory() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1636
        if (poaFactory != null)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1637
            ((org.omg.PortableServer.Servant)servant)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1638
                ._set_delegate( poaFactory.getDelegateImpl() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1639
        else
02bb8761fcce Initial load
duke
parents:
diff changeset
  1640
            throw wrapper.noPoa() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1641
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1642
02bb8761fcce Initial load
duke
parents:
diff changeset
  1643
    ////////////////////////////////////////////////////
02bb8761fcce Initial load
duke
parents:
diff changeset
  1644
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
  1645
    // pept.broker.Broker
02bb8761fcce Initial load
duke
parents:
diff changeset
  1646
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
  1647
02bb8761fcce Initial load
duke
parents:
diff changeset
  1648
    public ClientInvocationInfo createOrIncrementInvocationInfo()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1649
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1650
        StackImpl invocationInfoStack =
02bb8761fcce Initial load
duke
parents:
diff changeset
  1651
            (StackImpl) clientInvocationInfoStack.get();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1652
        ClientInvocationInfo clientInvocationInfo = null;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1653
        if (!invocationInfoStack.empty()) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1654
            clientInvocationInfo =
02bb8761fcce Initial load
duke
parents:
diff changeset
  1655
                (ClientInvocationInfo) invocationInfoStack.peek();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1656
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1657
        if ((clientInvocationInfo == null) ||
02bb8761fcce Initial load
duke
parents:
diff changeset
  1658
            (!clientInvocationInfo.isRetryInvocation()))
02bb8761fcce Initial load
duke
parents:
diff changeset
  1659
        {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1660
            // This is a new call - not a retry.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1661
            clientInvocationInfo = new CorbaInvocationInfo(this);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1662
            startingDispatch();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1663
            invocationInfoStack.push(clientInvocationInfo);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1664
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1665
        // Reset retry so recursive calls will get a new info object.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1666
        clientInvocationInfo.setIsRetryInvocation(false);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1667
        clientInvocationInfo.incrementEntryCount();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1668
        return clientInvocationInfo;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1669
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1670
02bb8761fcce Initial load
duke
parents:
diff changeset
  1671
    public void releaseOrDecrementInvocationInfo()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1672
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1673
        StackImpl invocationInfoStack =
02bb8761fcce Initial load
duke
parents:
diff changeset
  1674
            (StackImpl)clientInvocationInfoStack.get();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1675
        ClientInvocationInfo clientInvocationInfo = null;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1676
        if (!invocationInfoStack.empty()) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1677
            clientInvocationInfo =
02bb8761fcce Initial load
duke
parents:
diff changeset
  1678
                (ClientInvocationInfo)invocationInfoStack.peek();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1679
        } else {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1680
            throw wrapper.invocationInfoStackEmpty() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1681
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1682
        clientInvocationInfo.decrementEntryCount();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1683
        if (clientInvocationInfo.getEntryCount() == 0) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1684
            invocationInfoStack.pop();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1685
            finishedDispatch();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1686
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1687
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1688
02bb8761fcce Initial load
duke
parents:
diff changeset
  1689
    public ClientInvocationInfo getInvocationInfo()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1690
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1691
        StackImpl invocationInfoStack =
02bb8761fcce Initial load
duke
parents:
diff changeset
  1692
            (StackImpl) clientInvocationInfoStack.get();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1693
        return (ClientInvocationInfo) invocationInfoStack.peek();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1694
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1695
02bb8761fcce Initial load
duke
parents:
diff changeset
  1696
    ////////////////////////////////////////////////////
02bb8761fcce Initial load
duke
parents:
diff changeset
  1697
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
  1698
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
  1699
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
  1700
02bb8761fcce Initial load
duke
parents:
diff changeset
  1701
    private Object clientDelegateFactoryAccessorLock = new Object();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1702
02bb8761fcce Initial load
duke
parents:
diff changeset
  1703
    public void setClientDelegateFactory( ClientDelegateFactory factory )
02bb8761fcce Initial load
duke
parents:
diff changeset
  1704
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1705
        synchronized (clientDelegateFactoryAccessorLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1706
            clientDelegateFactory = factory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1707
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1708
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1709
02bb8761fcce Initial load
duke
parents:
diff changeset
  1710
    public ClientDelegateFactory getClientDelegateFactory()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1711
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1712
        synchronized (clientDelegateFactoryAccessorLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1713
            return clientDelegateFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1714
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1715
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1716
02bb8761fcce Initial load
duke
parents:
diff changeset
  1717
    private Object corbaContactInfoListFactoryAccessLock = new Object();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1718
02bb8761fcce Initial load
duke
parents:
diff changeset
  1719
    public void setCorbaContactInfoListFactory( CorbaContactInfoListFactory factory )
02bb8761fcce Initial load
duke
parents:
diff changeset
  1720
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1721
        synchronized (corbaContactInfoListFactoryAccessLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1722
            corbaContactInfoListFactory = factory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1723
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1724
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1725
02bb8761fcce Initial load
duke
parents:
diff changeset
  1726
    public synchronized CorbaContactInfoListFactory getCorbaContactInfoListFactory()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1727
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1728
        return corbaContactInfoListFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1729
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1730
02bb8761fcce Initial load
duke
parents:
diff changeset
  1731
    /** Set the resolver used in this ORB.  This resolver will be used for list_initial_services
02bb8761fcce Initial load
duke
parents:
diff changeset
  1732
     * and resolve_initial_references.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1733
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1734
    public void setResolver( Resolver resolver )
02bb8761fcce Initial load
duke
parents:
diff changeset
  1735
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1736
        synchronized (resolverLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1737
            this.resolver = resolver ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1738
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1739
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1740
02bb8761fcce Initial load
duke
parents:
diff changeset
  1741
    /** Get the resolver used in this ORB.  This resolver will be used for list_initial_services
02bb8761fcce Initial load
duke
parents:
diff changeset
  1742
     * and resolve_initial_references.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1743
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1744
    public Resolver getResolver()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1745
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1746
        synchronized (resolverLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1747
            return resolver ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1748
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1749
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1750
02bb8761fcce Initial load
duke
parents:
diff changeset
  1751
    /** Set the LocalResolver used in this ORB.  This LocalResolver is used for
02bb8761fcce Initial load
duke
parents:
diff changeset
  1752
     * register_initial_reference only.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1753
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1754
    public void setLocalResolver( LocalResolver resolver )
02bb8761fcce Initial load
duke
parents:
diff changeset
  1755
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1756
        synchronized (resolverLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1757
            this.localResolver = resolver ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1758
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1759
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1760
02bb8761fcce Initial load
duke
parents:
diff changeset
  1761
    /** Get the LocalResolver used in this ORB.  This LocalResolver is used for
02bb8761fcce Initial load
duke
parents:
diff changeset
  1762
     * register_initial_reference only.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1763
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1764
    public LocalResolver getLocalResolver()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1765
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1766
        synchronized (resolverLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1767
            return localResolver ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1768
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1769
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1770
02bb8761fcce Initial load
duke
parents:
diff changeset
  1771
    /** Set the operation used in string_to_object calls.  The Operation must expect a
02bb8761fcce Initial load
duke
parents:
diff changeset
  1772
     * String and return an org.omg.CORBA.Object.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1773
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1774
    public void setURLOperation( Operation stringToObject )
02bb8761fcce Initial load
duke
parents:
diff changeset
  1775
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1776
        synchronized (resolverLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1777
            urlOperation = stringToObject ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1778
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1779
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1780
02bb8761fcce Initial load
duke
parents:
diff changeset
  1781
    /** Get the operation used in string_to_object calls.  The Operation must expect a
02bb8761fcce Initial load
duke
parents:
diff changeset
  1782
     * String and return an org.omg.CORBA.Object.
02bb8761fcce Initial load
duke
parents:
diff changeset
  1783
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
  1784
    public Operation getURLOperation()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1785
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1786
        synchronized (resolverLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1787
            return urlOperation ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1788
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1789
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1790
02bb8761fcce Initial load
duke
parents:
diff changeset
  1791
    public void setINSDelegate( CorbaServerRequestDispatcher sdel )
02bb8761fcce Initial load
duke
parents:
diff changeset
  1792
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1793
        synchronized (resolverLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1794
            insNamingDelegate = sdel ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1795
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1796
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1797
02bb8761fcce Initial load
duke
parents:
diff changeset
  1798
    public TaggedComponentFactoryFinder getTaggedComponentFactoryFinder()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1799
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1800
        return taggedComponentFactoryFinder ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1801
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1802
02bb8761fcce Initial load
duke
parents:
diff changeset
  1803
    public IdentifiableFactoryFinder getTaggedProfileFactoryFinder()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1804
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1805
        return taggedProfileFactoryFinder ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1806
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1807
02bb8761fcce Initial load
duke
parents:
diff changeset
  1808
    public IdentifiableFactoryFinder getTaggedProfileTemplateFactoryFinder()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1809
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1810
        return taggedProfileTemplateFactoryFinder ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1811
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1812
02bb8761fcce Initial load
duke
parents:
diff changeset
  1813
    private Object objectKeyFactoryAccessLock = new Object();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1814
02bb8761fcce Initial load
duke
parents:
diff changeset
  1815
    public ObjectKeyFactory getObjectKeyFactory()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1816
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1817
        synchronized (objectKeyFactoryAccessLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1818
            return objectKeyFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1819
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1820
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1821
02bb8761fcce Initial load
duke
parents:
diff changeset
  1822
    public void setObjectKeyFactory( ObjectKeyFactory factory )
02bb8761fcce Initial load
duke
parents:
diff changeset
  1823
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1824
        synchronized (objectKeyFactoryAccessLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1825
            objectKeyFactory = factory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1826
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1827
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1828
02bb8761fcce Initial load
duke
parents:
diff changeset
  1829
    private Object transportManagerAccessorLock = new Object();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1830
02bb8761fcce Initial load
duke
parents:
diff changeset
  1831
    public TransportManager getTransportManager()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1832
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1833
        synchronized (transportManagerAccessorLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1834
            if (transportManager == null) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1835
                transportManager = new CorbaTransportManagerImpl(this);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1836
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1837
            return transportManager;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1838
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1839
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1840
02bb8761fcce Initial load
duke
parents:
diff changeset
  1841
    public CorbaTransportManager getCorbaTransportManager()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1842
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1843
        return (CorbaTransportManager) getTransportManager();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1844
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1845
02bb8761fcce Initial load
duke
parents:
diff changeset
  1846
    private Object legacyServerSocketManagerAccessLock = new Object();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1847
02bb8761fcce Initial load
duke
parents:
diff changeset
  1848
    public LegacyServerSocketManager getLegacyServerSocketManager()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1849
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1850
        synchronized (legacyServerSocketManagerAccessLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1851
            if (legacyServerSocketManager == null) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1852
                legacyServerSocketManager = new LegacyServerSocketManagerImpl(this);
02bb8761fcce Initial load
duke
parents:
diff changeset
  1853
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1854
            return legacyServerSocketManager;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1855
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1856
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1857
02bb8761fcce Initial load
duke
parents:
diff changeset
  1858
    private Object threadPoolManagerAccessLock = new Object();
02bb8761fcce Initial load
duke
parents:
diff changeset
  1859
02bb8761fcce Initial load
duke
parents:
diff changeset
  1860
    public void setThreadPoolManager(ThreadPoolManager mgr)
02bb8761fcce Initial load
duke
parents:
diff changeset
  1861
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1862
        synchronized (threadPoolManagerAccessLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1863
            threadpoolMgr = mgr;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1864
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1865
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1866
02bb8761fcce Initial load
duke
parents:
diff changeset
  1867
    public ThreadPoolManager getThreadPoolManager()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1868
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1869
        synchronized (threadPoolManagerAccessLock) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1870
            if (threadpoolMgr == null) {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1871
                threadpoolMgr = new ThreadPoolManagerImpl( threadGroup );
02bb8761fcce Initial load
duke
parents:
diff changeset
  1872
            }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1873
            return threadpoolMgr;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1874
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1875
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1876
02bb8761fcce Initial load
duke
parents:
diff changeset
  1877
    public CopierManager getCopierManager()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1878
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1879
        return copierManager ;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1880
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1881
} // Class ORBImpl
02bb8761fcce Initial load
duke
parents:
diff changeset
  1882
02bb8761fcce Initial load
duke
parents:
diff changeset
  1883
////////////////////////////////////////////////////////////////////////
02bb8761fcce Initial load
duke
parents:
diff changeset
  1884
/// Helper class for a Synchronization Variable
02bb8761fcce Initial load
duke
parents:
diff changeset
  1885
////////////////////////////////////////////////////////////////////////
02bb8761fcce Initial load
duke
parents:
diff changeset
  1886
02bb8761fcce Initial load
duke
parents:
diff changeset
  1887
class SynchVariable
02bb8761fcce Initial load
duke
parents:
diff changeset
  1888
{
02bb8761fcce Initial load
duke
parents:
diff changeset
  1889
    // Synchronization Variable
02bb8761fcce Initial load
duke
parents:
diff changeset
  1890
    public boolean _flag;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1891
02bb8761fcce Initial load
duke
parents:
diff changeset
  1892
    // Constructor
02bb8761fcce Initial load
duke
parents:
diff changeset
  1893
    SynchVariable()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1894
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1895
        _flag = false;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1896
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1897
02bb8761fcce Initial load
duke
parents:
diff changeset
  1898
    // set Flag to true
02bb8761fcce Initial load
duke
parents:
diff changeset
  1899
    public void set()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1900
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1901
        _flag = true;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1902
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1903
02bb8761fcce Initial load
duke
parents:
diff changeset
  1904
        // get value
02bb8761fcce Initial load
duke
parents:
diff changeset
  1905
    public boolean value()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1906
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1907
        return _flag;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1908
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1909
02bb8761fcce Initial load
duke
parents:
diff changeset
  1910
    // reset Flag to true
02bb8761fcce Initial load
duke
parents:
diff changeset
  1911
    public void reset()
02bb8761fcce Initial load
duke
parents:
diff changeset
  1912
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
  1913
        _flag = false;
02bb8761fcce Initial load
duke
parents:
diff changeset
  1914
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
  1915
}
02bb8761fcce Initial load
duke
parents:
diff changeset
  1916
02bb8761fcce Initial load
duke
parents:
diff changeset
  1917
// End of file.