src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORB.java
author msheppar
Sun, 03 Sep 2017 16:08:13 +0100
changeset 48554 592e22777742
parent 47216 71c04702a3d5
permissions -rw-r--r--
8160104: CORBA communication improvements Reviewed-by: rriggs, dfuchs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     1
/*
48554
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
     2
 * Copyright (c) 2002, 2017, 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 org.omg.CORBA.TCKind ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
import com.sun.corba.se.pept.broker.Broker ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    37
import com.sun.corba.se.pept.transport.ByteBufferPool;
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
import com.sun.corba.se.spi.protocol.ClientDelegateFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
import com.sun.corba.se.spi.protocol.PIHandler ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    43
import com.sun.corba.se.spi.resolver.LocalResolver ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
import com.sun.corba.se.spi.resolver.Resolver ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
import com.sun.corba.se.spi.transport.CorbaContactInfoListFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    46
import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketManager;
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
import com.sun.corba.se.spi.monitoring.MonitoringConstants;
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
import com.sun.corba.se.spi.monitoring.MonitoringManager;
02bb8761fcce Initial load
duke
parents:
diff changeset
    49
import com.sun.corba.se.spi.monitoring.MonitoringFactories;
02bb8761fcce Initial load
duke
parents:
diff changeset
    50
02bb8761fcce Initial load
duke
parents:
diff changeset
    51
import com.sun.corba.se.spi.ior.IdentifiableFactoryFinder ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    52
import com.sun.corba.se.spi.ior.TaggedComponentFactoryFinder ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    53
import com.sun.corba.se.spi.ior.ObjectKey ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    54
import com.sun.corba.se.spi.ior.ObjectKeyFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    55
import com.sun.corba.se.spi.ior.IOR ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    56
02bb8761fcce Initial load
duke
parents:
diff changeset
    57
import com.sun.corba.se.spi.orbutil.threadpool.ThreadPoolManager;
02bb8761fcce Initial load
duke
parents:
diff changeset
    58
02bb8761fcce Initial load
duke
parents:
diff changeset
    59
import com.sun.corba.se.spi.oa.OAInvocationInfo ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    60
import com.sun.corba.se.spi.transport.CorbaTransportManager;
02bb8761fcce Initial load
duke
parents:
diff changeset
    61
02bb8761fcce Initial load
duke
parents:
diff changeset
    62
import com.sun.corba.se.spi.logging.LogWrapperFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    63
import com.sun.corba.se.spi.logging.LogWrapperBase ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    64
import com.sun.corba.se.spi.logging.CORBALogDomains ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    65
02bb8761fcce Initial load
duke
parents:
diff changeset
    66
import com.sun.corba.se.spi.copyobject.CopierManager ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    67
02bb8761fcce Initial load
duke
parents:
diff changeset
    68
import com.sun.corba.se.spi.presentation.rmi.PresentationManager ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    69
import com.sun.corba.se.spi.presentation.rmi.PresentationDefaults ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    70
02bb8761fcce Initial load
duke
parents:
diff changeset
    71
import com.sun.corba.se.spi.servicecontext.ServiceContextRegistry ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    72
02bb8761fcce Initial load
duke
parents:
diff changeset
    73
// XXX needs an SPI or else it does not belong here
02bb8761fcce Initial load
duke
parents:
diff changeset
    74
import com.sun.corba.se.impl.corba.TypeCodeImpl ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    75
import com.sun.corba.se.impl.corba.TypeCodeFactory ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    76
02bb8761fcce Initial load
duke
parents:
diff changeset
    77
// XXX Should there be a SPI level constants ?
02bb8761fcce Initial load
duke
parents:
diff changeset
    78
import com.sun.corba.se.impl.orbutil.ORBConstants ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    79
02bb8761fcce Initial load
duke
parents:
diff changeset
    80
import com.sun.corba.se.impl.oa.poa.BadServerIdHandler ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    81
02bb8761fcce Initial load
duke
parents:
diff changeset
    82
import com.sun.corba.se.impl.transport.ByteBufferPoolImpl;
02bb8761fcce Initial load
duke
parents:
diff changeset
    83
02bb8761fcce Initial load
duke
parents:
diff changeset
    84
import com.sun.corba.se.impl.logging.ORBUtilSystemException ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    85
import com.sun.corba.se.impl.logging.OMGSystemException ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    86
02bb8761fcce Initial load
duke
parents:
diff changeset
    87
import com.sun.corba.se.impl.presentation.rmi.PresentationManagerImpl ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    88
02bb8761fcce Initial load
duke
parents:
diff changeset
    89
public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
02bb8761fcce Initial load
duke
parents:
diff changeset
    90
    implements Broker, TypeCodeFactory
02bb8761fcce Initial load
duke
parents:
diff changeset
    91
{
02bb8761fcce Initial load
duke
parents:
diff changeset
    92
    // As much as possible, this class should be stateless.  However,
02bb8761fcce Initial load
duke
parents:
diff changeset
    93
    // there are a few reasons why it is not:
02bb8761fcce Initial load
duke
parents:
diff changeset
    94
    //
02bb8761fcce Initial load
duke
parents:
diff changeset
    95
    // 1. The ORB debug flags are defined here because they are accessed
02bb8761fcce Initial load
duke
parents:
diff changeset
    96
    //    frequently, and we do not want a cast to the impl just for that.
02bb8761fcce Initial load
duke
parents:
diff changeset
    97
    // 2. typeCodeMap and primitiveTypeCodeConstants are here because they
02bb8761fcce Initial load
duke
parents:
diff changeset
    98
    //    are needed in both ORBImpl and ORBSingleton.
02bb8761fcce Initial load
duke
parents:
diff changeset
    99
    // 3. Logging support is here so that we can avoid problems with
02bb8761fcce Initial load
duke
parents:
diff changeset
   100
    //    incompletely initialized ORBs that need to perform logging.
02bb8761fcce Initial load
duke
parents:
diff changeset
   101
02bb8761fcce Initial load
duke
parents:
diff changeset
   102
    // Flag set at compile time to debug flag processing: this can't
02bb8761fcce Initial load
duke
parents:
diff changeset
   103
    // be one of the xxxDebugFlags because it is used to debug the mechanism
02bb8761fcce Initial load
duke
parents:
diff changeset
   104
    // that sets the xxxDebugFlags!
02bb8761fcce Initial load
duke
parents:
diff changeset
   105
    public static boolean ORBInitDebug = false;
02bb8761fcce Initial load
duke
parents:
diff changeset
   106
02bb8761fcce Initial load
duke
parents:
diff changeset
   107
    // Currently defined debug flags.  Any additions must be called xxxDebugFlag.
02bb8761fcce Initial load
duke
parents:
diff changeset
   108
    // All debug flags must be public boolean types.
02bb8761fcce Initial load
duke
parents:
diff changeset
   109
    // These are set by passing the flag -ORBDebug x,y,z in the ORB init args.
02bb8761fcce Initial load
duke
parents:
diff changeset
   110
    // Note that x,y,z must not contain spaces.
02bb8761fcce Initial load
duke
parents:
diff changeset
   111
    public boolean transportDebugFlag = false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   112
    public boolean subcontractDebugFlag = false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   113
    public boolean poaDebugFlag = false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   114
    public boolean poaConcurrencyDebugFlag = false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   115
    public boolean poaFSMDebugFlag = false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   116
    public boolean orbdDebugFlag = false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   117
    public boolean namingDebugFlag = false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   118
    public boolean serviceContextDebugFlag = false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   119
    public boolean transientObjectManagerDebugFlag = false ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   120
    public boolean giopVersionDebugFlag = false;
02bb8761fcce Initial load
duke
parents:
diff changeset
   121
    public boolean shutdownDebugFlag = false;
02bb8761fcce Initial load
duke
parents:
diff changeset
   122
    public boolean giopDebugFlag = false;
02bb8761fcce Initial load
duke
parents:
diff changeset
   123
    public boolean invocationTimingDebugFlag = false ;
48554
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
   124
    public boolean orbInitDebugFlag = false ;
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   125
02bb8761fcce Initial load
duke
parents:
diff changeset
   126
    // SystemException log wrappers.  Protected so that they can be used in
02bb8761fcce Initial load
duke
parents:
diff changeset
   127
    // subclasses.
02bb8761fcce Initial load
duke
parents:
diff changeset
   128
    protected static ORBUtilSystemException staticWrapper ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   129
    protected ORBUtilSystemException wrapper ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   130
    protected OMGSystemException omgWrapper ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   131
02bb8761fcce Initial load
duke
parents:
diff changeset
   132
    // This map is needed for resolving recursive type code placeholders
02bb8761fcce Initial load
duke
parents:
diff changeset
   133
    // based on the unique repository id.
02bb8761fcce Initial load
duke
parents:
diff changeset
   134
    // XXX Should this be a WeakHashMap for GC?
24380
1c91e3a7752d 8042906: Remove use of reflection in ORB
coffeys
parents: 23754
diff changeset
   135
    private Map<String, TypeCodeImpl> typeCodeMap;
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   136
24380
1c91e3a7752d 8042906: Remove use of reflection in ORB
coffeys
parents: 23754
diff changeset
   137
    private TypeCodeImpl[] primitiveTypeCodeConstants;
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   138
02bb8761fcce Initial load
duke
parents:
diff changeset
   139
    // ByteBufferPool - needed by both ORBImpl and ORBSingleton
02bb8761fcce Initial load
duke
parents:
diff changeset
   140
    ByteBufferPool byteBufferPool;
02bb8761fcce Initial load
duke
parents:
diff changeset
   141
02bb8761fcce Initial load
duke
parents:
diff changeset
   142
    // Local testing
02bb8761fcce Initial load
duke
parents:
diff changeset
   143
    // XXX clean this up, probably remove these
02bb8761fcce Initial load
duke
parents:
diff changeset
   144
    public abstract boolean isLocalHost( String hostName ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   145
    public abstract boolean isLocalServerId( int subcontractId, int serverId ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   146
02bb8761fcce Initial load
duke
parents:
diff changeset
   147
    // Invocation stack manipulation
02bb8761fcce Initial load
duke
parents:
diff changeset
   148
    public abstract OAInvocationInfo peekInvocationInfo() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   149
    public abstract void pushInvocationInfo( OAInvocationInfo info ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   150
    public abstract OAInvocationInfo popInvocationInfo() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   151
02bb8761fcce Initial load
duke
parents:
diff changeset
   152
    public abstract CorbaTransportManager getCorbaTransportManager();
02bb8761fcce Initial load
duke
parents:
diff changeset
   153
    public abstract LegacyServerSocketManager getLegacyServerSocketManager();
02bb8761fcce Initial load
duke
parents:
diff changeset
   154
02bb8761fcce Initial load
duke
parents:
diff changeset
   155
    // wrapperMap maintains a table of LogWrapper instances used by
02bb8761fcce Initial load
duke
parents:
diff changeset
   156
    // different classes to log exceptions.  The key is a StringPair
02bb8761fcce Initial load
duke
parents:
diff changeset
   157
    // representing LogDomain and ExceptionGroup.
24380
1c91e3a7752d 8042906: Remove use of reflection in ORB
coffeys
parents: 23754
diff changeset
   158
    private Map<StringPair, LogWrapperBase> wrapperMap;
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   159
23752
edf6d51900f2 8035618: Four api/org_omg/CORBA TCK tests fail under plugin only
coffeys
parents: 18304
diff changeset
   160
    static class Holder {
edf6d51900f2 8035618: Four api/org_omg/CORBA TCK tests fail under plugin only
coffeys
parents: 18304
diff changeset
   161
        static final PresentationManager defaultPresentationManager =
43345
a3460624dc33 8170116: Remove qualified exports from java.base to java.corba
prappo
parents: 32884
diff changeset
   162
                                         setupPresentationManager();
23752
edf6d51900f2 8035618: Four api/org_omg/CORBA TCK tests fail under plugin only
coffeys
parents: 18304
diff changeset
   163
    }
edf6d51900f2 8035618: Four api/org_omg/CORBA TCK tests fail under plugin only
coffeys
parents: 18304
diff changeset
   164
24380
1c91e3a7752d 8042906: Remove use of reflection in ORB
coffeys
parents: 23754
diff changeset
   165
    private static Map<StringPair, LogWrapperBase> staticWrapperMap =
1c91e3a7752d 8042906: Remove use of reflection in ORB
coffeys
parents: 23754
diff changeset
   166
            new ConcurrentHashMap<>();
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   167
13171
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   168
    protected MonitoringManager monitoringManager;
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   169
16138
0caa305dbb46 7141694: Improving CORBA internals
mbankal
parents: 13171
diff changeset
   170
    private static PresentationManager setupPresentationManager() {
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   171
        staticWrapper = ORBUtilSystemException.get(
02bb8761fcce Initial load
duke
parents:
diff changeset
   172
            CORBALogDomains.RPC_PRESENTATION ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   173
29040
1db7d75a0f5a 8068682: Deprivilege/move java.corba to the ext class loader
msheppar
parents: 25862
diff changeset
   174
        boolean useDynamicStub = false;
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   175
29040
1db7d75a0f5a 8068682: Deprivilege/move java.corba to the ext class loader
msheppar
parents: 25862
diff changeset
   176
        PresentationManager.StubFactoryFactory dynamicStubFactoryFactory = null;
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   177
16138
0caa305dbb46 7141694: Improving CORBA internals
mbankal
parents: 13171
diff changeset
   178
        PresentationManager pm = new PresentationManagerImpl( useDynamicStub ) ;
0caa305dbb46 7141694: Improving CORBA internals
mbankal
parents: 13171
diff changeset
   179
        pm.setStubFactoryFactory( false,
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   180
            PresentationDefaults.getStaticStubFactoryFactory() ) ;
16138
0caa305dbb46 7141694: Improving CORBA internals
mbankal
parents: 13171
diff changeset
   181
        pm.setStubFactoryFactory( true, dynamicStubFactoryFactory ) ;
0caa305dbb46 7141694: Improving CORBA internals
mbankal
parents: 13171
diff changeset
   182
        return pm;
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   183
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   184
13171
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   185
    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
   186
        wrapper = null;
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   187
        omgWrapper = null;
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   188
        typeCodeMap = null;
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   189
        primitiveTypeCodeConstants = null;
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   190
        byteBufferPool = null;
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   191
    }
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   192
43345
a3460624dc33 8170116: Remove qualified exports from java.base to java.corba
prappo
parents: 32884
diff changeset
   193
    /** Get the single instance of the PresentationManager
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   194
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   195
    public static PresentationManager getPresentationManager()
02bb8761fcce Initial load
duke
parents:
diff changeset
   196
    {
23752
edf6d51900f2 8035618: Four api/org_omg/CORBA TCK tests fail under plugin only
coffeys
parents: 18304
diff changeset
   197
        return Holder.defaultPresentationManager;
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   198
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   199
02bb8761fcce Initial load
duke
parents:
diff changeset
   200
    /** Get the appropriate StubFactoryFactory.  This
02bb8761fcce Initial load
duke
parents:
diff changeset
   201
     * will be dynamic or static depending on whether
02bb8761fcce Initial load
duke
parents:
diff changeset
   202
     * com.sun.CORBA.ORBUseDynamicStub is true or false.
02bb8761fcce Initial load
duke
parents:
diff changeset
   203
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   204
    public static PresentationManager.StubFactoryFactory
02bb8761fcce Initial load
duke
parents:
diff changeset
   205
        getStubFactoryFactory()
02bb8761fcce Initial load
duke
parents:
diff changeset
   206
    {
16138
0caa305dbb46 7141694: Improving CORBA internals
mbankal
parents: 13171
diff changeset
   207
        PresentationManager gPM = getPresentationManager();
0caa305dbb46 7141694: Improving CORBA internals
mbankal
parents: 13171
diff changeset
   208
        boolean useDynamicStubs = gPM.useDynamicStubs() ;
0caa305dbb46 7141694: Improving CORBA internals
mbankal
parents: 13171
diff changeset
   209
        return gPM.getStubFactoryFactory( useDynamicStubs ) ;
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   210
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   211
02bb8761fcce Initial load
duke
parents:
diff changeset
   212
    protected ORB()
02bb8761fcce Initial load
duke
parents:
diff changeset
   213
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   214
        // Initialize logging first, since it is needed nearly
02bb8761fcce Initial load
duke
parents:
diff changeset
   215
        // everywhere (for example, in TypeCodeImpl).
24380
1c91e3a7752d 8042906: Remove use of reflection in ORB
coffeys
parents: 23754
diff changeset
   216
        wrapperMap = new ConcurrentHashMap<>();
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   217
        wrapper = ORBUtilSystemException.get( this,
02bb8761fcce Initial load
duke
parents:
diff changeset
   218
            CORBALogDomains.RPC_PRESENTATION ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   219
        omgWrapper = OMGSystemException.get( this,
02bb8761fcce Initial load
duke
parents:
diff changeset
   220
            CORBALogDomains.RPC_PRESENTATION ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   221
24380
1c91e3a7752d 8042906: Remove use of reflection in ORB
coffeys
parents: 23754
diff changeset
   222
        typeCodeMap = new HashMap<>();
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   223
02bb8761fcce Initial load
duke
parents:
diff changeset
   224
        primitiveTypeCodeConstants = new TypeCodeImpl[] {
02bb8761fcce Initial load
duke
parents:
diff changeset
   225
            new TypeCodeImpl(this, TCKind._tk_null),
02bb8761fcce Initial load
duke
parents:
diff changeset
   226
            new TypeCodeImpl(this, TCKind._tk_void),
02bb8761fcce Initial load
duke
parents:
diff changeset
   227
            new TypeCodeImpl(this, TCKind._tk_short),
02bb8761fcce Initial load
duke
parents:
diff changeset
   228
            new TypeCodeImpl(this, TCKind._tk_long),
02bb8761fcce Initial load
duke
parents:
diff changeset
   229
            new TypeCodeImpl(this, TCKind._tk_ushort),
02bb8761fcce Initial load
duke
parents:
diff changeset
   230
            new TypeCodeImpl(this, TCKind._tk_ulong),
02bb8761fcce Initial load
duke
parents:
diff changeset
   231
            new TypeCodeImpl(this, TCKind._tk_float),
02bb8761fcce Initial load
duke
parents:
diff changeset
   232
            new TypeCodeImpl(this, TCKind._tk_double),
02bb8761fcce Initial load
duke
parents:
diff changeset
   233
            new TypeCodeImpl(this, TCKind._tk_boolean),
02bb8761fcce Initial load
duke
parents:
diff changeset
   234
            new TypeCodeImpl(this, TCKind._tk_char),
02bb8761fcce Initial load
duke
parents:
diff changeset
   235
            new TypeCodeImpl(this, TCKind._tk_octet),
02bb8761fcce Initial load
duke
parents:
diff changeset
   236
            new TypeCodeImpl(this, TCKind._tk_any),
02bb8761fcce Initial load
duke
parents:
diff changeset
   237
            new TypeCodeImpl(this, TCKind._tk_TypeCode),
02bb8761fcce Initial load
duke
parents:
diff changeset
   238
            new TypeCodeImpl(this, TCKind._tk_Principal),
02bb8761fcce Initial load
duke
parents:
diff changeset
   239
            new TypeCodeImpl(this, TCKind._tk_objref),
02bb8761fcce Initial load
duke
parents:
diff changeset
   240
            null,       // tk_struct
02bb8761fcce Initial load
duke
parents:
diff changeset
   241
            null,       // tk_union
02bb8761fcce Initial load
duke
parents:
diff changeset
   242
            null,       // tk_enum
02bb8761fcce Initial load
duke
parents:
diff changeset
   243
            new TypeCodeImpl(this, TCKind._tk_string),
02bb8761fcce Initial load
duke
parents:
diff changeset
   244
            null,       // tk_sequence
02bb8761fcce Initial load
duke
parents:
diff changeset
   245
            null,       // tk_array
02bb8761fcce Initial load
duke
parents:
diff changeset
   246
            null,       // tk_alias
02bb8761fcce Initial load
duke
parents:
diff changeset
   247
            null,       // tk_except
02bb8761fcce Initial load
duke
parents:
diff changeset
   248
            new TypeCodeImpl(this, TCKind._tk_longlong),
02bb8761fcce Initial load
duke
parents:
diff changeset
   249
            new TypeCodeImpl(this, TCKind._tk_ulonglong),
02bb8761fcce Initial load
duke
parents:
diff changeset
   250
            new TypeCodeImpl(this, TCKind._tk_longdouble),
02bb8761fcce Initial load
duke
parents:
diff changeset
   251
            new TypeCodeImpl(this, TCKind._tk_wchar),
02bb8761fcce Initial load
duke
parents:
diff changeset
   252
            new TypeCodeImpl(this, TCKind._tk_wstring),
02bb8761fcce Initial load
duke
parents:
diff changeset
   253
            new TypeCodeImpl(this, TCKind._tk_fixed),
02bb8761fcce Initial load
duke
parents:
diff changeset
   254
            new TypeCodeImpl(this, TCKind._tk_value),
02bb8761fcce Initial load
duke
parents:
diff changeset
   255
            new TypeCodeImpl(this, TCKind._tk_value_box),
02bb8761fcce Initial load
duke
parents:
diff changeset
   256
            new TypeCodeImpl(this, TCKind._tk_native),
02bb8761fcce Initial load
duke
parents:
diff changeset
   257
            new TypeCodeImpl(this, TCKind._tk_abstract_interface)
02bb8761fcce Initial load
duke
parents:
diff changeset
   258
        } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   259
02bb8761fcce Initial load
duke
parents:
diff changeset
   260
        monitoringManager =
02bb8761fcce Initial load
duke
parents:
diff changeset
   261
            MonitoringFactories.getMonitoringManagerFactory( ).
02bb8761fcce Initial load
duke
parents:
diff changeset
   262
                createMonitoringManager(
02bb8761fcce Initial load
duke
parents:
diff changeset
   263
                MonitoringConstants.DEFAULT_MONITORING_ROOT,
02bb8761fcce Initial load
duke
parents:
diff changeset
   264
                MonitoringConstants.DEFAULT_MONITORING_ROOT_DESCRIPTION);
02bb8761fcce Initial load
duke
parents:
diff changeset
   265
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   266
02bb8761fcce Initial load
duke
parents:
diff changeset
   267
    // Typecode support: needed in both ORBImpl and ORBSingleton
02bb8761fcce Initial load
duke
parents:
diff changeset
   268
    public TypeCodeImpl get_primitive_tc(int kind)
02bb8761fcce Initial load
duke
parents:
diff changeset
   269
    {
13171
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   270
        synchronized (this) {
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   271
            checkShutdownState();
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   272
        }
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   273
        try {
02bb8761fcce Initial load
duke
parents:
diff changeset
   274
            return primitiveTypeCodeConstants[kind] ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   275
        } catch (Throwable t) {
02bb8761fcce Initial load
duke
parents:
diff changeset
   276
            throw wrapper.invalidTypecodeKind( t, new Integer(kind) ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   277
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   278
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   279
02bb8761fcce Initial load
duke
parents:
diff changeset
   280
    public synchronized void setTypeCode(String id, TypeCodeImpl code)
02bb8761fcce Initial load
duke
parents:
diff changeset
   281
    {
13171
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   282
        checkShutdownState();
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   283
        typeCodeMap.put(id, code);
02bb8761fcce Initial load
duke
parents:
diff changeset
   284
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   285
02bb8761fcce Initial load
duke
parents:
diff changeset
   286
    public synchronized TypeCodeImpl getTypeCode(String id)
02bb8761fcce Initial load
duke
parents:
diff changeset
   287
    {
13171
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   288
        checkShutdownState();
24380
1c91e3a7752d 8042906: Remove use of reflection in ORB
coffeys
parents: 23754
diff changeset
   289
        return typeCodeMap.get(id);
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   290
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   291
02bb8761fcce Initial load
duke
parents:
diff changeset
   292
    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
   293
        synchronized (this) {
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   294
            checkShutdownState();
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   295
        }
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   296
        return monitoringManager;
02bb8761fcce Initial load
duke
parents:
diff changeset
   297
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   298
02bb8761fcce Initial load
duke
parents:
diff changeset
   299
    // Special non-standard set_parameters method for
02bb8761fcce Initial load
duke
parents:
diff changeset
   300
    // creating a precisely controlled ORB instance.
02bb8761fcce Initial load
duke
parents:
diff changeset
   301
    // An ORB created by this call is affected only by
02bb8761fcce Initial load
duke
parents:
diff changeset
   302
    // those properties passes explicitly in props, not by
02bb8761fcce Initial load
duke
parents:
diff changeset
   303
    // the system properties and orb.properties files as
02bb8761fcce Initial load
duke
parents:
diff changeset
   304
    // with the standard ORB.init methods.
02bb8761fcce Initial load
duke
parents:
diff changeset
   305
    public abstract void set_parameters( Properties props ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   306
02bb8761fcce Initial load
duke
parents:
diff changeset
   307
    // ORB versioning
02bb8761fcce Initial load
duke
parents:
diff changeset
   308
    public abstract ORBVersion getORBVersion() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   309
    public abstract void setORBVersion( ORBVersion version ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   310
02bb8761fcce Initial load
duke
parents:
diff changeset
   311
    // XXX This needs a better name
02bb8761fcce Initial load
duke
parents:
diff changeset
   312
    public abstract IOR getFVDCodeBaseIOR() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   313
02bb8761fcce Initial load
duke
parents:
diff changeset
   314
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   315
     * Handle a bad server id for the given object key.  This should
02bb8761fcce Initial load
duke
parents:
diff changeset
   316
     * always through an exception: either a ForwardException to
02bb8761fcce Initial load
duke
parents:
diff changeset
   317
     * allow another server to handle the request, or else an error
02bb8761fcce Initial load
duke
parents:
diff changeset
   318
     * indication.  XXX Remove after ORT for ORBD work is integrated.
02bb8761fcce Initial load
duke
parents:
diff changeset
   319
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   320
    public abstract void handleBadServerId( ObjectKey okey ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   321
    public abstract void setBadServerIdHandler( BadServerIdHandler handler ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   322
    public abstract void initBadServerIdHandler() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   323
02bb8761fcce Initial load
duke
parents:
diff changeset
   324
    public abstract void notifyORB() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   325
02bb8761fcce Initial load
duke
parents:
diff changeset
   326
    public abstract PIHandler getPIHandler() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   327
02bb8761fcce Initial load
duke
parents:
diff changeset
   328
    public abstract void checkShutdownState();
02bb8761fcce Initial load
duke
parents:
diff changeset
   329
02bb8761fcce Initial load
duke
parents:
diff changeset
   330
    // Dispatch support: in the ORB because it is needed for shutdown.
02bb8761fcce Initial load
duke
parents:
diff changeset
   331
    // This is used by the first level server side subcontract.
02bb8761fcce Initial load
duke
parents:
diff changeset
   332
    public abstract boolean isDuringDispatch() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   333
    public abstract void startingDispatch();
02bb8761fcce Initial load
duke
parents:
diff changeset
   334
    public abstract void finishedDispatch();
02bb8761fcce Initial load
duke
parents:
diff changeset
   335
02bb8761fcce Initial load
duke
parents:
diff changeset
   336
    /** Return this ORB's transient server ID.  This is needed for
02bb8761fcce Initial load
duke
parents:
diff changeset
   337
     * initializing object adapters.
02bb8761fcce Initial load
duke
parents:
diff changeset
   338
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   339
    public abstract int getTransientServerId();
02bb8761fcce Initial load
duke
parents:
diff changeset
   340
02bb8761fcce Initial load
duke
parents:
diff changeset
   341
    public abstract ServiceContextRegistry getServiceContextRegistry() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   342
02bb8761fcce Initial load
duke
parents:
diff changeset
   343
    public abstract RequestDispatcherRegistry getRequestDispatcherRegistry();
02bb8761fcce Initial load
duke
parents:
diff changeset
   344
02bb8761fcce Initial load
duke
parents:
diff changeset
   345
    public abstract ORBData getORBData() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   346
02bb8761fcce Initial load
duke
parents:
diff changeset
   347
    public abstract void setClientDelegateFactory( ClientDelegateFactory factory ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   348
02bb8761fcce Initial load
duke
parents:
diff changeset
   349
    public abstract ClientDelegateFactory getClientDelegateFactory() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   350
02bb8761fcce Initial load
duke
parents:
diff changeset
   351
    public abstract void setCorbaContactInfoListFactory( CorbaContactInfoListFactory factory ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   352
02bb8761fcce Initial load
duke
parents:
diff changeset
   353
    public abstract CorbaContactInfoListFactory getCorbaContactInfoListFactory() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   354
02bb8761fcce Initial load
duke
parents:
diff changeset
   355
    // XXX These next 7 methods should be moved to a ResolverManager.
02bb8761fcce Initial load
duke
parents:
diff changeset
   356
02bb8761fcce Initial load
duke
parents:
diff changeset
   357
    /** Set the resolver used in this ORB.  This resolver will be used for list_initial_services
02bb8761fcce Initial load
duke
parents:
diff changeset
   358
     * and resolve_initial_references.
02bb8761fcce Initial load
duke
parents:
diff changeset
   359
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   360
    public abstract void setResolver( Resolver resolver ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   361
02bb8761fcce Initial load
duke
parents:
diff changeset
   362
    /** Get the resolver used in this ORB.  This resolver will be used for list_initial_services
02bb8761fcce Initial load
duke
parents:
diff changeset
   363
     * and resolve_initial_references.
02bb8761fcce Initial load
duke
parents:
diff changeset
   364
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   365
    public abstract Resolver getResolver() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   366
02bb8761fcce Initial load
duke
parents:
diff changeset
   367
    /** Set the LocalResolver used in this ORB.  This LocalResolver is used for
02bb8761fcce Initial load
duke
parents:
diff changeset
   368
     * register_initial_reference only.
02bb8761fcce Initial load
duke
parents:
diff changeset
   369
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   370
    public abstract void setLocalResolver( LocalResolver resolver ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   371
02bb8761fcce Initial load
duke
parents:
diff changeset
   372
    /** Get the LocalResolver used in this ORB.  This LocalResolver is used for
02bb8761fcce Initial load
duke
parents:
diff changeset
   373
     * register_initial_reference only.
02bb8761fcce Initial load
duke
parents:
diff changeset
   374
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   375
    public abstract LocalResolver getLocalResolver() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   376
02bb8761fcce Initial load
duke
parents:
diff changeset
   377
    /** Set the operation used in string_to_object calls.  The Operation must expect a
02bb8761fcce Initial load
duke
parents:
diff changeset
   378
     * String and return an org.omg.CORBA.Object.
02bb8761fcce Initial load
duke
parents:
diff changeset
   379
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   380
    public abstract void setURLOperation( Operation stringToObject ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   381
02bb8761fcce Initial load
duke
parents:
diff changeset
   382
    /** Get the operation used in string_to_object calls.  The Operation must expect a
02bb8761fcce Initial load
duke
parents:
diff changeset
   383
     * String and return an org.omg.CORBA.Object.
02bb8761fcce Initial load
duke
parents:
diff changeset
   384
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   385
    public abstract Operation getURLOperation() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   386
02bb8761fcce Initial load
duke
parents:
diff changeset
   387
    /** Set the ServerRequestDispatcher that should be used for handling INS requests.
02bb8761fcce Initial load
duke
parents:
diff changeset
   388
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   389
    public abstract void setINSDelegate( CorbaServerRequestDispatcher insDelegate ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   390
02bb8761fcce Initial load
duke
parents:
diff changeset
   391
    // XXX The next 5 operations should be moved to an IORManager.
02bb8761fcce Initial load
duke
parents:
diff changeset
   392
02bb8761fcce Initial load
duke
parents:
diff changeset
   393
    /** Factory finders for the various parts of the IOR: tagged components, tagged
02bb8761fcce Initial load
duke
parents:
diff changeset
   394
     * profiles, and tagged profile templates.
02bb8761fcce Initial load
duke
parents:
diff changeset
   395
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   396
    public abstract TaggedComponentFactoryFinder getTaggedComponentFactoryFinder() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   397
    public abstract IdentifiableFactoryFinder getTaggedProfileFactoryFinder() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   398
    public abstract IdentifiableFactoryFinder getTaggedProfileTemplateFactoryFinder() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   399
02bb8761fcce Initial load
duke
parents:
diff changeset
   400
    public abstract ObjectKeyFactory getObjectKeyFactory() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   401
    public abstract void setObjectKeyFactory( ObjectKeyFactory factory ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   402
02bb8761fcce Initial load
duke
parents:
diff changeset
   403
    // Logging SPI
02bb8761fcce Initial load
duke
parents:
diff changeset
   404
02bb8761fcce Initial load
duke
parents:
diff changeset
   405
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
   406
     * Returns the logger based on the category.
02bb8761fcce Initial load
duke
parents:
diff changeset
   407
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   408
    public Logger getLogger( String domain )
02bb8761fcce Initial load
duke
parents:
diff changeset
   409
    {
13171
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   410
        synchronized (this) {
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   411
            checkShutdownState();
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   412
        }
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   413
        ORBData odata = getORBData() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   414
02bb8761fcce Initial load
duke
parents:
diff changeset
   415
        // Determine the correct ORBId.  There are 3 cases:
02bb8761fcce Initial load
duke
parents:
diff changeset
   416
        // 1. odata is null, which happens if we are getting a logger before
02bb8761fcce Initial load
duke
parents:
diff changeset
   417
        //    ORB initialization is complete.  In this case we cannot determine
02bb8761fcce Initial load
duke
parents:
diff changeset
   418
        //    the ORB ID (it's not known yet), so we set the ORBId to
02bb8761fcce Initial load
duke
parents:
diff changeset
   419
        //    _INITIALIZING_.
02bb8761fcce Initial load
duke
parents:
diff changeset
   420
        // 2. odata is not null, so initialization is complete, but ORBId is set to
02bb8761fcce Initial load
duke
parents:
diff changeset
   421
        //    the default "".  To avoid a ".." in
02bb8761fcce Initial load
duke
parents:
diff changeset
   422
        //    the log domain, we simply use _DEFAULT_ in this case.
02bb8761fcce Initial load
duke
parents:
diff changeset
   423
        // 3. odata is not null, ORBId is not "": just use the ORBId.
02bb8761fcce Initial load
duke
parents:
diff changeset
   424
        String ORBId ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   425
        if (odata == null)
02bb8761fcce Initial load
duke
parents:
diff changeset
   426
            ORBId = "_INITIALIZING_" ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   427
        else {
02bb8761fcce Initial load
duke
parents:
diff changeset
   428
            ORBId = odata.getORBId() ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   429
            if (ORBId.equals(""))
02bb8761fcce Initial load
duke
parents:
diff changeset
   430
                ORBId = "_DEFAULT_" ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   431
        }
02bb8761fcce Initial load
duke
parents:
diff changeset
   432
02bb8761fcce Initial load
duke
parents:
diff changeset
   433
        return getCORBALogger( ORBId, domain ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   434
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   435
02bb8761fcce Initial load
duke
parents:
diff changeset
   436
    public static Logger staticGetLogger( String domain )
02bb8761fcce Initial load
duke
parents:
diff changeset
   437
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   438
        return getCORBALogger( "_CORBA_", domain ) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   439
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   440
02bb8761fcce Initial load
duke
parents:
diff changeset
   441
    private static Logger getCORBALogger( String ORBId, String domain )
02bb8761fcce Initial load
duke
parents:
diff changeset
   442
    {
02bb8761fcce Initial load
duke
parents:
diff changeset
   443
        String fqLogDomain = CORBALogDomains.TOP_LEVEL_DOMAIN + "." +
02bb8761fcce Initial load
duke
parents:
diff changeset
   444
            ORBId + "." + domain;
02bb8761fcce Initial load
duke
parents:
diff changeset
   445
02bb8761fcce Initial load
duke
parents:
diff changeset
   446
        return Logger.getLogger( fqLogDomain, ORBConstants.LOG_RESOURCE_FILE );
02bb8761fcce Initial load
duke
parents:
diff changeset
   447
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   448
02bb8761fcce Initial load
duke
parents:
diff changeset
   449
    /** get the log wrapper class (its type is dependent on the exceptionGroup) for the
02bb8761fcce Initial load
duke
parents:
diff changeset
   450
     * given log domain and exception group in this ORB instance.
02bb8761fcce Initial load
duke
parents:
diff changeset
   451
     */
24380
1c91e3a7752d 8042906: Remove use of reflection in ORB
coffeys
parents: 23754
diff changeset
   452
    public LogWrapperBase getLogWrapper(String logDomain,
1c91e3a7752d 8042906: Remove use of reflection in ORB
coffeys
parents: 23754
diff changeset
   453
        String exceptionGroup, LogWrapperFactory factory)
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   454
    {
24380
1c91e3a7752d 8042906: Remove use of reflection in ORB
coffeys
parents: 23754
diff changeset
   455
        return wrapperMap.computeIfAbsent(
1c91e3a7752d 8042906: Remove use of reflection in ORB
coffeys
parents: 23754
diff changeset
   456
            new StringPair(logDomain, exceptionGroup),
1c91e3a7752d 8042906: Remove use of reflection in ORB
coffeys
parents: 23754
diff changeset
   457
            x -> factory.create(getLogger(logDomain)));
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   458
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   459
02bb8761fcce Initial load
duke
parents:
diff changeset
   460
    /** get the log wrapper class (its type is dependent on the exceptionGroup) for the
02bb8761fcce Initial load
duke
parents:
diff changeset
   461
     * given log domain and exception group in this ORB instance.
02bb8761fcce Initial load
duke
parents:
diff changeset
   462
     */
24380
1c91e3a7752d 8042906: Remove use of reflection in ORB
coffeys
parents: 23754
diff changeset
   463
    public static LogWrapperBase staticGetLogWrapper(String logDomain,
1c91e3a7752d 8042906: Remove use of reflection in ORB
coffeys
parents: 23754
diff changeset
   464
        String exceptionGroup, LogWrapperFactory factory)
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   465
    {
24380
1c91e3a7752d 8042906: Remove use of reflection in ORB
coffeys
parents: 23754
diff changeset
   466
        return staticWrapperMap.computeIfAbsent(
1c91e3a7752d 8042906: Remove use of reflection in ORB
coffeys
parents: 23754
diff changeset
   467
            new StringPair(logDomain, exceptionGroup),
1c91e3a7752d 8042906: Remove use of reflection in ORB
coffeys
parents: 23754
diff changeset
   468
            x -> factory.create(staticGetLogger(logDomain)));
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   469
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   470
02bb8761fcce Initial load
duke
parents:
diff changeset
   471
    // get a reference to a ByteBufferPool, a pool of NIO ByteBuffers
02bb8761fcce Initial load
duke
parents:
diff changeset
   472
    // NOTE: ByteBuffer pool must be unique per ORB, not per process.
02bb8761fcce Initial load
duke
parents:
diff changeset
   473
    //       There can be more than one ORB per process.
02bb8761fcce Initial load
duke
parents:
diff changeset
   474
    //       This method must also be inherited by both ORB and ORBSingleton.
02bb8761fcce Initial load
duke
parents:
diff changeset
   475
    public ByteBufferPool getByteBufferPool()
02bb8761fcce Initial load
duke
parents:
diff changeset
   476
    {
13171
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   477
        synchronized (this) {
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   478
            checkShutdownState();
1ac5e9a54a6e 7162902: Umbrella port of a number of corba bug fixes from JDK 6 to jdk7u/8
coffeys
parents: 5555
diff changeset
   479
        }
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   480
        if (byteBufferPool == null)
02bb8761fcce Initial load
duke
parents:
diff changeset
   481
            byteBufferPool = new ByteBufferPoolImpl(this);
02bb8761fcce Initial load
duke
parents:
diff changeset
   482
02bb8761fcce Initial load
duke
parents:
diff changeset
   483
        return byteBufferPool;
02bb8761fcce Initial load
duke
parents:
diff changeset
   484
    }
02bb8761fcce Initial load
duke
parents:
diff changeset
   485
02bb8761fcce Initial load
duke
parents:
diff changeset
   486
    public abstract void setThreadPoolManager(ThreadPoolManager mgr);
02bb8761fcce Initial load
duke
parents:
diff changeset
   487
02bb8761fcce Initial load
duke
parents:
diff changeset
   488
    public abstract ThreadPoolManager getThreadPoolManager();
02bb8761fcce Initial load
duke
parents:
diff changeset
   489
02bb8761fcce Initial load
duke
parents:
diff changeset
   490
    public abstract CopierManager getCopierManager() ;
48554
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
   491
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
   492
    /*
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
   493
     * This method is called to verify that a stringified IOR passed to
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
   494
     * an org.omg.CORBA.ORB::string_to_object method contains a valid and acceptable IOR type.
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
   495
     * If an ORB is configured with IOR type checking enabled,
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
   496
     * the ORB executes a IOR type registry lookup to
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
   497
     * validate that the class name extract from a type id in
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
   498
     * a stringified IOR is a known and accepted type.
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
   499
     * A CORBA {@code org.omg.CORBA.DATA_CONVERSION} exception will be thrown should the type check fail.
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
   500
     *
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
   501
     * @param iorClassName
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
   502
     *        a string representing the class name corresponding to the type id of an IOR
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
   503
     * @throws org.omg.CORBA.DATA_CONVERSION
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
   504
     *           exception with an indication that it is a "Bad stringified IOR", which is thrown
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
   505
     *           when the type check fails.
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
   506
     */
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
   507
    public abstract void validateIORClass(String iorClassName);
592e22777742 8160104: CORBA communication improvements
msheppar
parents: 47216
diff changeset
   508
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   509
}
02bb8761fcce Initial load
duke
parents:
diff changeset
   510
02bb8761fcce Initial load
duke
parents:
diff changeset
   511
// End of file.