corba/src/share/classes/com/sun/corba/se/spi/orb/ORB.java
author coffeys
Wed, 27 Jun 2012 21:09:29 +0100
changeset 13171 1ac5e9a54a6e
parent 5555 b2b5ed3f0d0d
child 16138 0caa305dbb46
permissions -rw-r--r--
7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8 Reviewed-by: lancea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     1
/*
13171
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
     2
 * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
02bb8761fcce Initial load
duke
parents:
diff changeset
     4
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
02bb8761fcce Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    10
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
02bb8761fcce Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
02bb8761fcce Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
02bb8761fcce Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
02bb8761fcce Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
02bb8761fcce Initial load
duke
parents:
diff changeset
    16
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
02bb8761fcce Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
02bb8761fcce Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
02bb8761fcce Initial load
duke
parents:
diff changeset
    20
 *
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    23
 * questions.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    24
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    25
02bb8761fcce Initial load
duke
parents:
diff changeset
    26
package com.sun.corba.se.spi.orb;
02bb8761fcce Initial load
duke
parents:
diff changeset
    27
02bb8761fcce Initial load
duke
parents:
diff changeset
    28
import java.util.Map ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    29
import java.util.HashMap ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    30
import java.util.Properties ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    31
import java.util.concurrent.ConcurrentHashMap;
02bb8761fcce Initial load
duke
parents:
diff changeset
    32
import java.util.logging.Logger ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    33
02bb8761fcce Initial load
duke
parents:
diff changeset
    34
import java.security.AccessController ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
import java.security.PrivilegedAction ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
02bb8761fcce Initial load
duke
parents:
diff changeset
    37
import org.omg.CORBA.TCKind ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
import com.sun.corba.se.pept.broker.Broker ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
import com.sun.corba.se.pept.transport.ByteBufferPool;
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    43
import com.sun.corba.se.spi.protocol.ClientDelegateFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
import com.sun.corba.se.spi.protocol.CorbaMessageMediator ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    46
import com.sun.corba.se.spi.protocol.PIHandler ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
import com.sun.corba.se.spi.resolver.LocalResolver ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
import com.sun.corba.se.spi.resolver.Resolver ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    49
import com.sun.corba.se.spi.transport.CorbaContactInfoListFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    50
import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfo;
02bb8761fcce Initial load
duke
parents:
diff changeset
    51
import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketManager;
02bb8761fcce Initial load
duke
parents:
diff changeset
    52
import com.sun.corba.se.spi.monitoring.MonitoringConstants;
02bb8761fcce Initial load
duke
parents:
diff changeset
    53
import com.sun.corba.se.spi.monitoring.MonitoringManager;
02bb8761fcce Initial load
duke
parents:
diff changeset
    54
import com.sun.corba.se.spi.monitoring.MonitoringManagerFactory;
02bb8761fcce Initial load
duke
parents:
diff changeset
    55
import com.sun.corba.se.spi.monitoring.MonitoringFactories;
02bb8761fcce Initial load
duke
parents:
diff changeset
    56
02bb8761fcce Initial load
duke
parents:
diff changeset
    57
import com.sun.corba.se.spi.ior.IdentifiableFactoryFinder ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    58
import com.sun.corba.se.spi.ior.TaggedComponentFactoryFinder ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    59
import com.sun.corba.se.spi.ior.ObjectKey ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    60
import com.sun.corba.se.spi.ior.ObjectKeyFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    61
import com.sun.corba.se.spi.ior.IOR ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    62
02bb8761fcce Initial load
duke
parents:
diff changeset
    63
import com.sun.corba.se.spi.orbutil.closure.Closure ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    64
02bb8761fcce Initial load
duke
parents:
diff changeset
    65
import com.sun.corba.se.spi.orb.Operation ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    66
import com.sun.corba.se.spi.orb.ORBData ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    67
import com.sun.corba.se.spi.orb.ORBVersion ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    68
import com.sun.corba.se.spi.orbutil.threadpool.ThreadPoolManager;
02bb8761fcce Initial load
duke
parents:
diff changeset
    69
02bb8761fcce Initial load
duke
parents:
diff changeset
    70
import com.sun.corba.se.spi.oa.OAInvocationInfo ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    71
import com.sun.corba.se.spi.transport.CorbaTransportManager;
02bb8761fcce Initial load
duke
parents:
diff changeset
    72
02bb8761fcce Initial load
duke
parents:
diff changeset
    73
import com.sun.corba.se.spi.logging.LogWrapperFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    74
import com.sun.corba.se.spi.logging.LogWrapperBase ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    75
import com.sun.corba.se.spi.logging.CORBALogDomains ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    76
02bb8761fcce Initial load
duke
parents:
diff changeset
    77
import com.sun.corba.se.spi.copyobject.CopierManager ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    78
02bb8761fcce Initial load
duke
parents:
diff changeset
    79
import com.sun.corba.se.spi.presentation.rmi.PresentationManager ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    80
import com.sun.corba.se.spi.presentation.rmi.PresentationDefaults ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    81
02bb8761fcce Initial load
duke
parents:
diff changeset
    82
import com.sun.corba.se.spi.servicecontext.ServiceContextRegistry ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    83
02bb8761fcce Initial load
duke
parents:
diff changeset
    84
// XXX needs an SPI or else it does not belong here
02bb8761fcce Initial load
duke
parents:
diff changeset
    85
import com.sun.corba.se.impl.corba.TypeCodeImpl ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    86
import com.sun.corba.se.impl.corba.TypeCodeFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    87
02bb8761fcce Initial load
duke
parents:
diff changeset
    88
// XXX Should there be a SPI level constants ?
02bb8761fcce Initial load
duke
parents:
diff changeset
    89
import com.sun.corba.se.impl.orbutil.ORBConstants ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    90
02bb8761fcce Initial load
duke
parents:
diff changeset
    91
import com.sun.corba.se.impl.oa.poa.BadServerIdHandler ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    92
02bb8761fcce Initial load
duke
parents:
diff changeset
    93
import com.sun.corba.se.impl.transport.ByteBufferPoolImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
    94
02bb8761fcce Initial load
duke
parents:
diff changeset
    95
import com.sun.corba.se.impl.logging.ORBUtilSystemException ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    96
import com.sun.corba.se.impl.logging.OMGSystemException ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    97
02bb8761fcce Initial load
duke
parents:
diff changeset
    98
import com.sun.corba.se.impl.presentation.rmi.PresentationManagerImpl ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    99
02bb8761fcce Initial load
duke
parents:
diff changeset
   100
import com.sun.corba.se.impl.orbutil.ORBClassLoader ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   101
02bb8761fcce Initial load
duke
parents:
diff changeset
   102
public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
02bb8761fcce Initial load
duke
parents:
diff changeset
   103
    implements Broker, TypeCodeFactory
02bb8761fcce Initial load
duke
parents:
diff changeset
   104
{
02bb8761fcce Initial load
duke
parents:
diff changeset
   105
    // As much as possible, this class should be stateless.  However,
02bb8761fcce Initial load
duke
parents:
diff changeset
   106
    // there are a few reasons why it is not:
02bb8761fcce Initial load
duke
parents:
diff changeset
   107
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
   108
    // 1. The ORB debug flags are defined here because they are accessed
02bb8761fcce Initial load
duke
parents:
diff changeset
   109
    //    frequently, and we do not want a cast to the impl just for that.
02bb8761fcce Initial load
duke
parents:
diff changeset
   110
    // 2. typeCodeMap and primitiveTypeCodeConstants are here because they
02bb8761fcce Initial load
duke
parents:
diff changeset
   111
    //    are needed in both ORBImpl and ORBSingleton.
02bb8761fcce Initial load
duke
parents:
diff changeset
   112
    // 3. Logging support is here so that we can avoid problems with
02bb8761fcce Initial load
duke
parents:
diff changeset
   113
    //    incompletely initialized ORBs that need to perform logging.
02bb8761fcce Initial load
duke
parents:
diff changeset
   114
02bb8761fcce Initial load
duke
parents:
diff changeset
   115
    // Flag set at compile time to debug flag processing: this can't
02bb8761fcce Initial load
duke
parents:
diff changeset
   116
    // be one of the xxxDebugFlags because it is used to debug the mechanism
02bb8761fcce Initial load
duke
parents:
diff changeset
   117
    // that sets the xxxDebugFlags!
02bb8761fcce Initial load
duke
parents:
diff changeset
   118
    public static boolean ORBInitDebug = false;
02bb8761fcce Initial load
duke
parents:
diff changeset
   119
02bb8761fcce Initial load
duke
parents:
diff changeset
   120
    // Currently defined debug flags.  Any additions must be called xxxDebugFlag.
02bb8761fcce Initial load
duke
parents:
diff changeset
   121
    // All debug flags must be public boolean types.
02bb8761fcce Initial load
duke
parents:
diff changeset
   122
    // These are set by passing the flag -ORBDebug x,y,z in the ORB init args.
02bb8761fcce Initial load
duke
parents:
diff changeset
   123
    // Note that x,y,z must not contain spaces.
02bb8761fcce Initial load
duke
parents:
diff changeset
   124
    public boolean transportDebugFlag = false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   125
    public boolean subcontractDebugFlag = false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   126
    public boolean poaDebugFlag = false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   127
    public boolean poaConcurrencyDebugFlag = false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   128
    public boolean poaFSMDebugFlag = false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   129
    public boolean orbdDebugFlag = false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   130
    public boolean namingDebugFlag = false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   131
    public boolean serviceContextDebugFlag = false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   132
    public boolean transientObjectManagerDebugFlag = false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   133
    public boolean giopVersionDebugFlag = false;
02bb8761fcce Initial load
duke
parents:
diff changeset
   134
    public boolean shutdownDebugFlag = false;
02bb8761fcce Initial load
duke
parents:
diff changeset
   135
    public boolean giopDebugFlag = false;
02bb8761fcce Initial load
duke
parents:
diff changeset
   136
    public boolean invocationTimingDebugFlag = false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   137
02bb8761fcce Initial load
duke
parents:
diff changeset
   138
    // SystemException log wrappers.  Protected so that they can be used in
02bb8761fcce Initial load
duke
parents:
diff changeset
   139
    // subclasses.
02bb8761fcce Initial load
duke
parents:
diff changeset
   140
    protected static ORBUtilSystemException staticWrapper ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   141
    protected ORBUtilSystemException wrapper ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   142
    protected OMGSystemException omgWrapper ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   143
02bb8761fcce Initial load
duke
parents:
diff changeset
   144
    // This map is needed for resolving recursive type code placeholders
02bb8761fcce Initial load
duke
parents:
diff changeset
   145
    // based on the unique repository id.
02bb8761fcce Initial load
duke
parents:
diff changeset
   146
    // XXX Should this be a WeakHashMap for GC?
02bb8761fcce Initial load
duke
parents:
diff changeset
   147
    private Map typeCodeMap ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   148
02bb8761fcce Initial load
duke
parents:
diff changeset
   149
    private TypeCodeImpl[] primitiveTypeCodeConstants ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   150
02bb8761fcce Initial load
duke
parents:
diff changeset
   151
    // ByteBufferPool - needed by both ORBImpl and ORBSingleton
02bb8761fcce Initial load
duke
parents:
diff changeset
   152
    ByteBufferPool byteBufferPool;
02bb8761fcce Initial load
duke
parents:
diff changeset
   153
02bb8761fcce Initial load
duke
parents:
diff changeset
   154
    // Local testing
02bb8761fcce Initial load
duke
parents:
diff changeset
   155
    // XXX clean this up, probably remove these
02bb8761fcce Initial load
duke
parents:
diff changeset
   156
    public abstract boolean isLocalHost( String hostName ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   157
    public abstract boolean isLocalServerId( int subcontractId, int serverId ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   158
02bb8761fcce Initial load
duke
parents:
diff changeset
   159
    // Invocation stack manipulation
02bb8761fcce Initial load
duke
parents:
diff changeset
   160
    public abstract OAInvocationInfo peekInvocationInfo() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   161
    public abstract void pushInvocationInfo( OAInvocationInfo info ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   162
    public abstract OAInvocationInfo popInvocationInfo() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   163
02bb8761fcce Initial load
duke
parents:
diff changeset
   164
    public abstract CorbaTransportManager getCorbaTransportManager();
02bb8761fcce Initial load
duke
parents:
diff changeset
   165
    public abstract LegacyServerSocketManager getLegacyServerSocketManager();
02bb8761fcce Initial load
duke
parents:
diff changeset
   166
02bb8761fcce Initial load
duke
parents:
diff changeset
   167
    // wrapperMap maintains a table of LogWrapper instances used by
02bb8761fcce Initial load
duke
parents:
diff changeset
   168
    // different classes to log exceptions.  The key is a StringPair
02bb8761fcce Initial load
duke
parents:
diff changeset
   169
    // representing LogDomain and ExceptionGroup.
02bb8761fcce Initial load
duke
parents:
diff changeset
   170
    private Map wrapperMap ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   171
02bb8761fcce Initial load
duke
parents:
diff changeset
   172
    private static Map staticWrapperMap = new ConcurrentHashMap();
02bb8761fcce Initial load
duke
parents:
diff changeset
   173
13171
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   174
    protected MonitoringManager monitoringManager;
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   175
02bb8761fcce Initial load
duke
parents:
diff changeset
   176
    // There is only one instance of the PresentationManager
02bb8761fcce Initial load
duke
parents:
diff changeset
   177
    // that is shared between all ORBs.  This is necessary
02bb8761fcce Initial load
duke
parents:
diff changeset
   178
    // because RMI-IIOP requires the PresentationManager in
02bb8761fcce Initial load
duke
parents:
diff changeset
   179
    // places where no ORB is available, so the PresentationManager
02bb8761fcce Initial load
duke
parents:
diff changeset
   180
    // must be global.  It is initialized here as well.
02bb8761fcce Initial load
duke
parents:
diff changeset
   181
    protected static PresentationManager globalPM = null ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   182
02bb8761fcce Initial load
duke
parents:
diff changeset
   183
    static {
02bb8761fcce Initial load
duke
parents:
diff changeset
   184
        staticWrapper = ORBUtilSystemException.get(
02bb8761fcce Initial load
duke
parents:
diff changeset
   185
            CORBALogDomains.RPC_PRESENTATION ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   186
02bb8761fcce Initial load
duke
parents:
diff changeset
   187
        boolean useDynamicStub =
02bb8761fcce Initial load
duke
parents:
diff changeset
   188
            ((Boolean)AccessController.doPrivileged(
02bb8761fcce Initial load
duke
parents:
diff changeset
   189
                new PrivilegedAction() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   190
                    public java.lang.Object run() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   191
                        return Boolean.valueOf( Boolean.getBoolean (
02bb8761fcce Initial load
duke
parents:
diff changeset
   192
                            ORBConstants.USE_DYNAMIC_STUB_PROPERTY ) ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   193
                    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   194
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   195
            )).booleanValue() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   196
02bb8761fcce Initial load
duke
parents:
diff changeset
   197
        PresentationManager.StubFactoryFactory dynamicStubFactoryFactory =
02bb8761fcce Initial load
duke
parents:
diff changeset
   198
            (PresentationManager.StubFactoryFactory)AccessController.doPrivileged(
02bb8761fcce Initial load
duke
parents:
diff changeset
   199
                new PrivilegedAction() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   200
                    public java.lang.Object run() {
02bb8761fcce Initial load
duke
parents:
diff changeset
   201
                        PresentationManager.StubFactoryFactory sff =
02bb8761fcce Initial load
duke
parents:
diff changeset
   202
                            PresentationDefaults.getProxyStubFactoryFactory() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   203
02bb8761fcce Initial load
duke
parents:
diff changeset
   204
                        String className = System.getProperty(
02bb8761fcce Initial load
duke
parents:
diff changeset
   205
                            ORBConstants.DYNAMIC_STUB_FACTORY_FACTORY_CLASS,
02bb8761fcce Initial load
duke
parents:
diff changeset
   206
                            "com.sun.corba.se.impl.presentation.rmi.bcel.StubFactoryFactoryBCELImpl" ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   207
02bb8761fcce Initial load
duke
parents:
diff changeset
   208
                        try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   209
                            // First try the configured class name, if any
02bb8761fcce Initial load
duke
parents:
diff changeset
   210
                            Class cls = ORBClassLoader.loadClass( className ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   211
                            sff = (PresentationManager.StubFactoryFactory)cls.newInstance() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   212
                        } catch (Exception exc) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   213
                            // Use the default. Log the error as a warning.
02bb8761fcce Initial load
duke
parents:
diff changeset
   214
                            staticWrapper.errorInSettingDynamicStubFactoryFactory(
02bb8761fcce Initial load
duke
parents:
diff changeset
   215
                                exc, className ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   216
                        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   217
02bb8761fcce Initial load
duke
parents:
diff changeset
   218
                        return sff ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   219
                    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   220
                }
02bb8761fcce Initial load
duke
parents:
diff changeset
   221
            ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   222
02bb8761fcce Initial load
duke
parents:
diff changeset
   223
        globalPM = new PresentationManagerImpl( useDynamicStub ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   224
        globalPM.setStubFactoryFactory( false,
02bb8761fcce Initial load
duke
parents:
diff changeset
   225
            PresentationDefaults.getStaticStubFactoryFactory() ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   226
        globalPM.setStubFactoryFactory( true, dynamicStubFactoryFactory ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   227
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   228
13171
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   229
    public void destroy() {
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   230
        wrapper = null;
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   231
        omgWrapper = null;
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   232
        typeCodeMap = null;
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   233
        primitiveTypeCodeConstants = null;
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   234
        byteBufferPool = null;
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   235
    }
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   236
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   237
    /** Get the single instance of the PresentationManager
02bb8761fcce Initial load
duke
parents:
diff changeset
   238
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   239
    public static PresentationManager getPresentationManager()
02bb8761fcce Initial load
duke
parents:
diff changeset
   240
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   241
        return globalPM ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   242
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   243
02bb8761fcce Initial load
duke
parents:
diff changeset
   244
    /** Get the appropriate StubFactoryFactory.  This
02bb8761fcce Initial load
duke
parents:
diff changeset
   245
     * will be dynamic or static depending on whether
02bb8761fcce Initial load
duke
parents:
diff changeset
   246
     * com.sun.CORBA.ORBUseDynamicStub is true or false.
02bb8761fcce Initial load
duke
parents:
diff changeset
   247
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   248
    public static PresentationManager.StubFactoryFactory
02bb8761fcce Initial load
duke
parents:
diff changeset
   249
        getStubFactoryFactory()
02bb8761fcce Initial load
duke
parents:
diff changeset
   250
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   251
        boolean useDynamicStubs = globalPM.useDynamicStubs() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   252
        return globalPM.getStubFactoryFactory( useDynamicStubs ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   253
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   254
02bb8761fcce Initial load
duke
parents:
diff changeset
   255
    protected ORB()
02bb8761fcce Initial load
duke
parents:
diff changeset
   256
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   257
        // Initialize logging first, since it is needed nearly
02bb8761fcce Initial load
duke
parents:
diff changeset
   258
        // everywhere (for example, in TypeCodeImpl).
02bb8761fcce Initial load
duke
parents:
diff changeset
   259
        wrapperMap = new ConcurrentHashMap();
02bb8761fcce Initial load
duke
parents:
diff changeset
   260
        wrapper = ORBUtilSystemException.get( this,
02bb8761fcce Initial load
duke
parents:
diff changeset
   261
            CORBALogDomains.RPC_PRESENTATION ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   262
        omgWrapper = OMGSystemException.get( this,
02bb8761fcce Initial load
duke
parents:
diff changeset
   263
            CORBALogDomains.RPC_PRESENTATION ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   264
02bb8761fcce Initial load
duke
parents:
diff changeset
   265
        typeCodeMap = new HashMap();
02bb8761fcce Initial load
duke
parents:
diff changeset
   266
02bb8761fcce Initial load
duke
parents:
diff changeset
   267
        primitiveTypeCodeConstants = new TypeCodeImpl[] {
02bb8761fcce Initial load
duke
parents:
diff changeset
   268
            new TypeCodeImpl(this, TCKind._tk_null),
02bb8761fcce Initial load
duke
parents:
diff changeset
   269
            new TypeCodeImpl(this, TCKind._tk_void),
02bb8761fcce Initial load
duke
parents:
diff changeset
   270
            new TypeCodeImpl(this, TCKind._tk_short),
02bb8761fcce Initial load
duke
parents:
diff changeset
   271
            new TypeCodeImpl(this, TCKind._tk_long),
02bb8761fcce Initial load
duke
parents:
diff changeset
   272
            new TypeCodeImpl(this, TCKind._tk_ushort),
02bb8761fcce Initial load
duke
parents:
diff changeset
   273
            new TypeCodeImpl(this, TCKind._tk_ulong),
02bb8761fcce Initial load
duke
parents:
diff changeset
   274
            new TypeCodeImpl(this, TCKind._tk_float),
02bb8761fcce Initial load
duke
parents:
diff changeset
   275
            new TypeCodeImpl(this, TCKind._tk_double),
02bb8761fcce Initial load
duke
parents:
diff changeset
   276
            new TypeCodeImpl(this, TCKind._tk_boolean),
02bb8761fcce Initial load
duke
parents:
diff changeset
   277
            new TypeCodeImpl(this, TCKind._tk_char),
02bb8761fcce Initial load
duke
parents:
diff changeset
   278
            new TypeCodeImpl(this, TCKind._tk_octet),
02bb8761fcce Initial load
duke
parents:
diff changeset
   279
            new TypeCodeImpl(this, TCKind._tk_any),
02bb8761fcce Initial load
duke
parents:
diff changeset
   280
            new TypeCodeImpl(this, TCKind._tk_TypeCode),
02bb8761fcce Initial load
duke
parents:
diff changeset
   281
            new TypeCodeImpl(this, TCKind._tk_Principal),
02bb8761fcce Initial load
duke
parents:
diff changeset
   282
            new TypeCodeImpl(this, TCKind._tk_objref),
02bb8761fcce Initial load
duke
parents:
diff changeset
   283
            null,       // tk_struct
02bb8761fcce Initial load
duke
parents:
diff changeset
   284
            null,       // tk_union
02bb8761fcce Initial load
duke
parents:
diff changeset
   285
            null,       // tk_enum
02bb8761fcce Initial load
duke
parents:
diff changeset
   286
            new TypeCodeImpl(this, TCKind._tk_string),
02bb8761fcce Initial load
duke
parents:
diff changeset
   287
            null,       // tk_sequence
02bb8761fcce Initial load
duke
parents:
diff changeset
   288
            null,       // tk_array
02bb8761fcce Initial load
duke
parents:
diff changeset
   289
            null,       // tk_alias
02bb8761fcce Initial load
duke
parents:
diff changeset
   290
            null,       // tk_except
02bb8761fcce Initial load
duke
parents:
diff changeset
   291
            new TypeCodeImpl(this, TCKind._tk_longlong),
02bb8761fcce Initial load
duke
parents:
diff changeset
   292
            new TypeCodeImpl(this, TCKind._tk_ulonglong),
02bb8761fcce Initial load
duke
parents:
diff changeset
   293
            new TypeCodeImpl(this, TCKind._tk_longdouble),
02bb8761fcce Initial load
duke
parents:
diff changeset
   294
            new TypeCodeImpl(this, TCKind._tk_wchar),
02bb8761fcce Initial load
duke
parents:
diff changeset
   295
            new TypeCodeImpl(this, TCKind._tk_wstring),
02bb8761fcce Initial load
duke
parents:
diff changeset
   296
            new TypeCodeImpl(this, TCKind._tk_fixed),
02bb8761fcce Initial load
duke
parents:
diff changeset
   297
            new TypeCodeImpl(this, TCKind._tk_value),
02bb8761fcce Initial load
duke
parents:
diff changeset
   298
            new TypeCodeImpl(this, TCKind._tk_value_box),
02bb8761fcce Initial load
duke
parents:
diff changeset
   299
            new TypeCodeImpl(this, TCKind._tk_native),
02bb8761fcce Initial load
duke
parents:
diff changeset
   300
            new TypeCodeImpl(this, TCKind._tk_abstract_interface)
02bb8761fcce Initial load
duke
parents:
diff changeset
   301
        } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   302
02bb8761fcce Initial load
duke
parents:
diff changeset
   303
        monitoringManager =
02bb8761fcce Initial load
duke
parents:
diff changeset
   304
            MonitoringFactories.getMonitoringManagerFactory( ).
02bb8761fcce Initial load
duke
parents:
diff changeset
   305
                createMonitoringManager(
02bb8761fcce Initial load
duke
parents:
diff changeset
   306
                MonitoringConstants.DEFAULT_MONITORING_ROOT,
02bb8761fcce Initial load
duke
parents:
diff changeset
   307
                MonitoringConstants.DEFAULT_MONITORING_ROOT_DESCRIPTION);
02bb8761fcce Initial load
duke
parents:
diff changeset
   308
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   309
02bb8761fcce Initial load
duke
parents:
diff changeset
   310
    // Typecode support: needed in both ORBImpl and ORBSingleton
02bb8761fcce Initial load
duke
parents:
diff changeset
   311
    public TypeCodeImpl get_primitive_tc(int kind)
02bb8761fcce Initial load
duke
parents:
diff changeset
   312
    {
13171
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   313
        synchronized (this) {
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   314
            checkShutdownState();
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   315
        }
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   316
        try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   317
            return primitiveTypeCodeConstants[kind] ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   318
        } catch (Throwable t) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   319
            throw wrapper.invalidTypecodeKind( t, new Integer(kind) ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   320
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   321
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   322
02bb8761fcce Initial load
duke
parents:
diff changeset
   323
    public synchronized void setTypeCode(String id, TypeCodeImpl code)
02bb8761fcce Initial load
duke
parents:
diff changeset
   324
    {
13171
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   325
        checkShutdownState();
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   326
        typeCodeMap.put(id, code);
02bb8761fcce Initial load
duke
parents:
diff changeset
   327
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   328
02bb8761fcce Initial load
duke
parents:
diff changeset
   329
    public synchronized TypeCodeImpl getTypeCode(String id)
02bb8761fcce Initial load
duke
parents:
diff changeset
   330
    {
13171
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   331
        checkShutdownState();
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   332
        return (TypeCodeImpl)typeCodeMap.get(id);
02bb8761fcce Initial load
duke
parents:
diff changeset
   333
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   334
02bb8761fcce Initial load
duke
parents:
diff changeset
   335
    public MonitoringManager getMonitoringManager( ) {
13171
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   336
        synchronized (this) {
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   337
            checkShutdownState();
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   338
        }
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   339
        return monitoringManager;
02bb8761fcce Initial load
duke
parents:
diff changeset
   340
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   341
02bb8761fcce Initial load
duke
parents:
diff changeset
   342
    // Special non-standard set_parameters method for
02bb8761fcce Initial load
duke
parents:
diff changeset
   343
    // creating a precisely controlled ORB instance.
02bb8761fcce Initial load
duke
parents:
diff changeset
   344
    // An ORB created by this call is affected only by
02bb8761fcce Initial load
duke
parents:
diff changeset
   345
    // those properties passes explicitly in props, not by
02bb8761fcce Initial load
duke
parents:
diff changeset
   346
    // the system properties and orb.properties files as
02bb8761fcce Initial load
duke
parents:
diff changeset
   347
    // with the standard ORB.init methods.
02bb8761fcce Initial load
duke
parents:
diff changeset
   348
    public abstract void set_parameters( Properties props ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   349
02bb8761fcce Initial load
duke
parents:
diff changeset
   350
    // ORB versioning
02bb8761fcce Initial load
duke
parents:
diff changeset
   351
    public abstract ORBVersion getORBVersion() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   352
    public abstract void setORBVersion( ORBVersion version ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   353
02bb8761fcce Initial load
duke
parents:
diff changeset
   354
    // XXX This needs a better name
02bb8761fcce Initial load
duke
parents:
diff changeset
   355
    public abstract IOR getFVDCodeBaseIOR() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   356
02bb8761fcce Initial load
duke
parents:
diff changeset
   357
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   358
     * Handle a bad server id for the given object key.  This should
02bb8761fcce Initial load
duke
parents:
diff changeset
   359
     * always through an exception: either a ForwardException to
02bb8761fcce Initial load
duke
parents:
diff changeset
   360
     * allow another server to handle the request, or else an error
02bb8761fcce Initial load
duke
parents:
diff changeset
   361
     * indication.  XXX Remove after ORT for ORBD work is integrated.
02bb8761fcce Initial load
duke
parents:
diff changeset
   362
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   363
    public abstract void handleBadServerId( ObjectKey okey ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   364
    public abstract void setBadServerIdHandler( BadServerIdHandler handler ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   365
    public abstract void initBadServerIdHandler() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   366
02bb8761fcce Initial load
duke
parents:
diff changeset
   367
    public abstract void notifyORB() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   368
02bb8761fcce Initial load
duke
parents:
diff changeset
   369
    public abstract PIHandler getPIHandler() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   370
02bb8761fcce Initial load
duke
parents:
diff changeset
   371
    public abstract void checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   372
02bb8761fcce Initial load
duke
parents:
diff changeset
   373
    // Dispatch support: in the ORB because it is needed for shutdown.
02bb8761fcce Initial load
duke
parents:
diff changeset
   374
    // This is used by the first level server side subcontract.
02bb8761fcce Initial load
duke
parents:
diff changeset
   375
    public abstract boolean isDuringDispatch() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   376
    public abstract void startingDispatch();
02bb8761fcce Initial load
duke
parents:
diff changeset
   377
    public abstract void finishedDispatch();
02bb8761fcce Initial load
duke
parents:
diff changeset
   378
02bb8761fcce Initial load
duke
parents:
diff changeset
   379
    /** Return this ORB's transient server ID.  This is needed for
02bb8761fcce Initial load
duke
parents:
diff changeset
   380
     * initializing object adapters.
02bb8761fcce Initial load
duke
parents:
diff changeset
   381
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   382
    public abstract int getTransientServerId();
02bb8761fcce Initial load
duke
parents:
diff changeset
   383
02bb8761fcce Initial load
duke
parents:
diff changeset
   384
    public abstract ServiceContextRegistry getServiceContextRegistry() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   385
02bb8761fcce Initial load
duke
parents:
diff changeset
   386
    public abstract RequestDispatcherRegistry getRequestDispatcherRegistry();
02bb8761fcce Initial load
duke
parents:
diff changeset
   387
02bb8761fcce Initial load
duke
parents:
diff changeset
   388
    public abstract ORBData getORBData() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   389
02bb8761fcce Initial load
duke
parents:
diff changeset
   390
    public abstract void setClientDelegateFactory( ClientDelegateFactory factory ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   391
02bb8761fcce Initial load
duke
parents:
diff changeset
   392
    public abstract ClientDelegateFactory getClientDelegateFactory() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   393
02bb8761fcce Initial load
duke
parents:
diff changeset
   394
    public abstract void setCorbaContactInfoListFactory( CorbaContactInfoListFactory factory ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   395
02bb8761fcce Initial load
duke
parents:
diff changeset
   396
    public abstract CorbaContactInfoListFactory getCorbaContactInfoListFactory() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   397
02bb8761fcce Initial load
duke
parents:
diff changeset
   398
    // XXX These next 7 methods should be moved to a ResolverManager.
02bb8761fcce Initial load
duke
parents:
diff changeset
   399
02bb8761fcce Initial load
duke
parents:
diff changeset
   400
    /** Set the resolver used in this ORB.  This resolver will be used for list_initial_services
02bb8761fcce Initial load
duke
parents:
diff changeset
   401
     * and resolve_initial_references.
02bb8761fcce Initial load
duke
parents:
diff changeset
   402
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   403
    public abstract void setResolver( Resolver resolver ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   404
02bb8761fcce Initial load
duke
parents:
diff changeset
   405
    /** Get the resolver used in this ORB.  This resolver will be used for list_initial_services
02bb8761fcce Initial load
duke
parents:
diff changeset
   406
     * and resolve_initial_references.
02bb8761fcce Initial load
duke
parents:
diff changeset
   407
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   408
    public abstract Resolver getResolver() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   409
02bb8761fcce Initial load
duke
parents:
diff changeset
   410
    /** Set the LocalResolver used in this ORB.  This LocalResolver is used for
02bb8761fcce Initial load
duke
parents:
diff changeset
   411
     * register_initial_reference only.
02bb8761fcce Initial load
duke
parents:
diff changeset
   412
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   413
    public abstract void setLocalResolver( LocalResolver resolver ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   414
02bb8761fcce Initial load
duke
parents:
diff changeset
   415
    /** Get the LocalResolver used in this ORB.  This LocalResolver is used for
02bb8761fcce Initial load
duke
parents:
diff changeset
   416
     * register_initial_reference only.
02bb8761fcce Initial load
duke
parents:
diff changeset
   417
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   418
    public abstract LocalResolver getLocalResolver() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   419
02bb8761fcce Initial load
duke
parents:
diff changeset
   420
    /** Set the operation used in string_to_object calls.  The Operation must expect a
02bb8761fcce Initial load
duke
parents:
diff changeset
   421
     * String and return an org.omg.CORBA.Object.
02bb8761fcce Initial load
duke
parents:
diff changeset
   422
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   423
    public abstract void setURLOperation( Operation stringToObject ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   424
02bb8761fcce Initial load
duke
parents:
diff changeset
   425
    /** Get the operation used in string_to_object calls.  The Operation must expect a
02bb8761fcce Initial load
duke
parents:
diff changeset
   426
     * String and return an org.omg.CORBA.Object.
02bb8761fcce Initial load
duke
parents:
diff changeset
   427
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   428
    public abstract Operation getURLOperation() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   429
02bb8761fcce Initial load
duke
parents:
diff changeset
   430
    /** Set the ServerRequestDispatcher that should be used for handling INS requests.
02bb8761fcce Initial load
duke
parents:
diff changeset
   431
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   432
    public abstract void setINSDelegate( CorbaServerRequestDispatcher insDelegate ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   433
02bb8761fcce Initial load
duke
parents:
diff changeset
   434
    // XXX The next 5 operations should be moved to an IORManager.
02bb8761fcce Initial load
duke
parents:
diff changeset
   435
02bb8761fcce Initial load
duke
parents:
diff changeset
   436
    /** Factory finders for the various parts of the IOR: tagged components, tagged
02bb8761fcce Initial load
duke
parents:
diff changeset
   437
     * profiles, and tagged profile templates.
02bb8761fcce Initial load
duke
parents:
diff changeset
   438
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   439
    public abstract TaggedComponentFactoryFinder getTaggedComponentFactoryFinder() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   440
    public abstract IdentifiableFactoryFinder getTaggedProfileFactoryFinder() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   441
    public abstract IdentifiableFactoryFinder getTaggedProfileTemplateFactoryFinder() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   442
02bb8761fcce Initial load
duke
parents:
diff changeset
   443
    public abstract ObjectKeyFactory getObjectKeyFactory() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   444
    public abstract void setObjectKeyFactory( ObjectKeyFactory factory ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   445
02bb8761fcce Initial load
duke
parents:
diff changeset
   446
    // Logging SPI
02bb8761fcce Initial load
duke
parents:
diff changeset
   447
02bb8761fcce Initial load
duke
parents:
diff changeset
   448
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   449
     * Returns the logger based on the category.
02bb8761fcce Initial load
duke
parents:
diff changeset
   450
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   451
    public Logger getLogger( String domain )
02bb8761fcce Initial load
duke
parents:
diff changeset
   452
    {
13171
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   453
        synchronized (this) {
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   454
            checkShutdownState();
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   455
        }
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   456
        ORBData odata = getORBData() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   457
02bb8761fcce Initial load
duke
parents:
diff changeset
   458
        // Determine the correct ORBId.  There are 3 cases:
02bb8761fcce Initial load
duke
parents:
diff changeset
   459
        // 1. odata is null, which happens if we are getting a logger before
02bb8761fcce Initial load
duke
parents:
diff changeset
   460
        //    ORB initialization is complete.  In this case we cannot determine
02bb8761fcce Initial load
duke
parents:
diff changeset
   461
        //    the ORB ID (it's not known yet), so we set the ORBId to
02bb8761fcce Initial load
duke
parents:
diff changeset
   462
        //    _INITIALIZING_.
02bb8761fcce Initial load
duke
parents:
diff changeset
   463
        // 2. odata is not null, so initialization is complete, but ORBId is set to
02bb8761fcce Initial load
duke
parents:
diff changeset
   464
        //    the default "".  To avoid a ".." in
02bb8761fcce Initial load
duke
parents:
diff changeset
   465
        //    the log domain, we simply use _DEFAULT_ in this case.
02bb8761fcce Initial load
duke
parents:
diff changeset
   466
        // 3. odata is not null, ORBId is not "": just use the ORBId.
02bb8761fcce Initial load
duke
parents:
diff changeset
   467
        String ORBId ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   468
        if (odata == null)
02bb8761fcce Initial load
duke
parents:
diff changeset
   469
            ORBId = "_INITIALIZING_" ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   470
        else {
02bb8761fcce Initial load
duke
parents:
diff changeset
   471
            ORBId = odata.getORBId() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   472
            if (ORBId.equals(""))
02bb8761fcce Initial load
duke
parents:
diff changeset
   473
                ORBId = "_DEFAULT_" ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   474
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   475
02bb8761fcce Initial load
duke
parents:
diff changeset
   476
        return getCORBALogger( ORBId, domain ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   477
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   478
02bb8761fcce Initial load
duke
parents:
diff changeset
   479
    public static Logger staticGetLogger( String domain )
02bb8761fcce Initial load
duke
parents:
diff changeset
   480
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   481
        return getCORBALogger( "_CORBA_", domain ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   482
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   483
02bb8761fcce Initial load
duke
parents:
diff changeset
   484
    private static Logger getCORBALogger( String ORBId, String domain )
02bb8761fcce Initial load
duke
parents:
diff changeset
   485
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   486
        String fqLogDomain = CORBALogDomains.TOP_LEVEL_DOMAIN + "." +
02bb8761fcce Initial load
duke
parents:
diff changeset
   487
            ORBId + "." + domain;
02bb8761fcce Initial load
duke
parents:
diff changeset
   488
02bb8761fcce Initial load
duke
parents:
diff changeset
   489
        return Logger.getLogger( fqLogDomain, ORBConstants.LOG_RESOURCE_FILE );
02bb8761fcce Initial load
duke
parents:
diff changeset
   490
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   491
02bb8761fcce Initial load
duke
parents:
diff changeset
   492
    /** get the log wrapper class (its type is dependent on the exceptionGroup) for the
02bb8761fcce Initial load
duke
parents:
diff changeset
   493
     * given log domain and exception group in this ORB instance.
02bb8761fcce Initial load
duke
parents:
diff changeset
   494
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   495
    public LogWrapperBase getLogWrapper( String logDomain,
02bb8761fcce Initial load
duke
parents:
diff changeset
   496
        String exceptionGroup, LogWrapperFactory factory )
02bb8761fcce Initial load
duke
parents:
diff changeset
   497
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   498
        StringPair key = new StringPair( logDomain, exceptionGroup ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   499
02bb8761fcce Initial load
duke
parents:
diff changeset
   500
        LogWrapperBase logWrapper = (LogWrapperBase)wrapperMap.get( key );
02bb8761fcce Initial load
duke
parents:
diff changeset
   501
        if (logWrapper == null) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   502
            logWrapper = factory.create( getLogger( logDomain ) );
02bb8761fcce Initial load
duke
parents:
diff changeset
   503
            wrapperMap.put( key, logWrapper );
02bb8761fcce Initial load
duke
parents:
diff changeset
   504
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   505
02bb8761fcce Initial load
duke
parents:
diff changeset
   506
        return logWrapper;
02bb8761fcce Initial load
duke
parents:
diff changeset
   507
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   508
02bb8761fcce Initial load
duke
parents:
diff changeset
   509
    /** get the log wrapper class (its type is dependent on the exceptionGroup) for the
02bb8761fcce Initial load
duke
parents:
diff changeset
   510
     * given log domain and exception group in this ORB instance.
02bb8761fcce Initial load
duke
parents:
diff changeset
   511
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   512
    public static LogWrapperBase staticGetLogWrapper( String logDomain,
02bb8761fcce Initial load
duke
parents:
diff changeset
   513
        String exceptionGroup, LogWrapperFactory factory )
02bb8761fcce Initial load
duke
parents:
diff changeset
   514
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   515
        StringPair key = new StringPair( logDomain, exceptionGroup ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   516
02bb8761fcce Initial load
duke
parents:
diff changeset
   517
        LogWrapperBase logWrapper = (LogWrapperBase)staticWrapperMap.get( key );
02bb8761fcce Initial load
duke
parents:
diff changeset
   518
        if (logWrapper == null) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   519
            logWrapper = factory.create( staticGetLogger( logDomain ) );
02bb8761fcce Initial load
duke
parents:
diff changeset
   520
            staticWrapperMap.put( key, logWrapper );
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 logWrapper;
02bb8761fcce Initial load
duke
parents:
diff changeset
   524
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   525
02bb8761fcce Initial load
duke
parents:
diff changeset
   526
    // get a reference to a ByteBufferPool, a pool of NIO ByteBuffers
02bb8761fcce Initial load
duke
parents:
diff changeset
   527
    // NOTE: ByteBuffer pool must be unique per ORB, not per process.
02bb8761fcce Initial load
duke
parents:
diff changeset
   528
    //       There can be more than one ORB per process.
02bb8761fcce Initial load
duke
parents:
diff changeset
   529
    //       This method must also be inherited by both ORB and ORBSingleton.
02bb8761fcce Initial load
duke
parents:
diff changeset
   530
    public ByteBufferPool getByteBufferPool()
02bb8761fcce Initial load
duke
parents:
diff changeset
   531
    {
13171
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   532
        synchronized (this) {
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   533
            checkShutdownState();
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   534
        }
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   535
        if (byteBufferPool == null)
02bb8761fcce Initial load
duke
parents:
diff changeset
   536
            byteBufferPool = new ByteBufferPoolImpl(this);
02bb8761fcce Initial load
duke
parents:
diff changeset
   537
02bb8761fcce Initial load
duke
parents:
diff changeset
   538
        return byteBufferPool;
02bb8761fcce Initial load
duke
parents:
diff changeset
   539
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   540
02bb8761fcce Initial load
duke
parents:
diff changeset
   541
    public abstract void setThreadPoolManager(ThreadPoolManager mgr);
02bb8761fcce Initial load
duke
parents:
diff changeset
   542
02bb8761fcce Initial load
duke
parents:
diff changeset
   543
    public abstract ThreadPoolManager getThreadPoolManager();
02bb8761fcce Initial load
duke
parents:
diff changeset
   544
02bb8761fcce Initial load
duke
parents:
diff changeset
   545
    public abstract CopierManager getCopierManager() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   546
}
02bb8761fcce Initial load
duke
parents:
diff changeset
   547
02bb8761fcce Initial load
duke
parents:
diff changeset
   548
// End of file.