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