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