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