src/share/classes/com/sun/corba/se/spi/orb/ORB.java

Print this page

        

*** 23,34 **** * questions. */ package com.sun.corba.se.spi.orb; - import java.lang.reflect.InvocationTargetException; - import java.lang.reflect.Method; import java.util.Map ; import java.util.HashMap ; import java.util.Properties ; import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Logger ; --- 23,32 ----
*** 42,74 **** import com.sun.corba.se.pept.transport.ByteBufferPool; import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry ; import com.sun.corba.se.spi.protocol.ClientDelegateFactory ; import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ; - import com.sun.corba.se.spi.protocol.CorbaMessageMediator ; import com.sun.corba.se.spi.protocol.PIHandler ; import com.sun.corba.se.spi.resolver.LocalResolver ; import com.sun.corba.se.spi.resolver.Resolver ; import com.sun.corba.se.spi.transport.CorbaContactInfoListFactory ; - import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfo; import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketManager; import com.sun.corba.se.spi.monitoring.MonitoringConstants; import com.sun.corba.se.spi.monitoring.MonitoringManager; - import com.sun.corba.se.spi.monitoring.MonitoringManagerFactory; import com.sun.corba.se.spi.monitoring.MonitoringFactories; import com.sun.corba.se.spi.ior.IdentifiableFactoryFinder ; import com.sun.corba.se.spi.ior.TaggedComponentFactoryFinder ; import com.sun.corba.se.spi.ior.ObjectKey ; import com.sun.corba.se.spi.ior.ObjectKeyFactory ; import com.sun.corba.se.spi.ior.IOR ; - import com.sun.corba.se.spi.orbutil.closure.Closure ; - - import com.sun.corba.se.spi.orb.Operation ; - import com.sun.corba.se.spi.orb.ORBData ; - import com.sun.corba.se.spi.orb.ORBVersion ; import com.sun.corba.se.spi.orbutil.threadpool.ThreadPoolManager; import com.sun.corba.se.spi.oa.OAInvocationInfo ; import com.sun.corba.se.spi.transport.CorbaTransportManager; --- 40,64 ----
*** 97,108 **** import com.sun.corba.se.impl.logging.ORBUtilSystemException ; import com.sun.corba.se.impl.logging.OMGSystemException ; import com.sun.corba.se.impl.presentation.rmi.PresentationManagerImpl ; - import sun.misc.JavaAWTAccess; - public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB implements Broker, TypeCodeFactory { // As much as possible, this class should be stateless. However, // there are a few reasons why it is not: --- 87,96 ----
*** 144,156 **** protected OMGSystemException omgWrapper ; // This map is needed for resolving recursive type code placeholders // based on the unique repository id. // XXX Should this be a WeakHashMap for GC? ! private Map typeCodeMap ; ! private TypeCodeImpl[] primitiveTypeCodeConstants ; // ByteBufferPool - needed by both ORBImpl and ORBSingleton ByteBufferPool byteBufferPool; // Local testing --- 132,144 ---- protected OMGSystemException omgWrapper ; // This map is needed for resolving recursive type code placeholders // based on the unique repository id. // XXX Should this be a WeakHashMap for GC? ! private Map<String, TypeCodeImpl> typeCodeMap; ! private TypeCodeImpl[] primitiveTypeCodeConstants; // ByteBufferPool - needed by both ORBImpl and ORBSingleton ByteBufferPool byteBufferPool; // Local testing
*** 167,186 **** public abstract LegacyServerSocketManager getLegacyServerSocketManager(); // wrapperMap maintains a table of LogWrapper instances used by // different classes to log exceptions. The key is a StringPair // representing LogDomain and ExceptionGroup. ! private Map wrapperMap ; static class Holder { static final PresentationManager defaultPresentationManager = setupPresentationManager(); } ! private static final Map<Object, PresentationManager> pmContexts = new HashMap<>(); ! private static Map staticWrapperMap = new ConcurrentHashMap(); protected MonitoringManager monitoringManager; private static PresentationManager setupPresentationManager() { staticWrapper = ORBUtilSystemException.get( --- 155,176 ---- public abstract LegacyServerSocketManager getLegacyServerSocketManager(); // wrapperMap maintains a table of LogWrapper instances used by // different classes to log exceptions. The key is a StringPair // representing LogDomain and ExceptionGroup. ! private Map<StringPair, LogWrapperBase> wrapperMap; static class Holder { static final PresentationManager defaultPresentationManager = setupPresentationManager(); } ! private static final Map<Object, PresentationManager> pmContexts = ! new ConcurrentHashMap<>(); ! private static Map<StringPair, LogWrapperBase> staticWrapperMap = ! new ConcurrentHashMap<>(); protected MonitoringManager monitoringManager; private static PresentationManager setupPresentationManager() { staticWrapper = ORBUtilSystemException.get(
*** 243,276 **** * AppContext to hold it. Creates and records one if needed. */ public static PresentationManager getPresentationManager() { SecurityManager sm = System.getSecurityManager(); ! JavaAWTAccess javaAwtAccess = sun.misc.SharedSecrets.getJavaAWTAccess(); if (sm != null && javaAwtAccess != null) { ! Object appletContext; ! try { ! Class<?> clazz = JavaAWTAccess.class; ! Method method = clazz.getMethod("getAppletContext"); ! appletContext = method.invoke(javaAwtAccess); ! } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { ! InternalError err = new InternalError(); ! err.initCause(e); ! throw err; ! } ! if (appletContext != null) { ! synchronized (pmContexts) { ! PresentationManager pm = pmContexts.get(appletContext); ! if (pm == null) { ! pm = setupPresentationManager(); ! pmContexts.put(appletContext, pm); } - return pm; } - } - } // No security manager or AppletAppContext return Holder.defaultPresentationManager; } --- 233,250 ---- * AppContext to hold it. Creates and records one if needed. */ public static PresentationManager getPresentationManager() { SecurityManager sm = System.getSecurityManager(); ! sun.misc.JavaAWTAccess javaAwtAccess = sun.misc.SharedSecrets.getJavaAWTAccess(); if (sm != null && javaAwtAccess != null) { ! final Object appletContext = javaAwtAccess.getAppletContext(); if (appletContext != null) { ! return pmContexts.computeIfAbsent(appletContext, ! x -> setupPresentationManager()); } } // No security manager or AppletAppContext return Holder.defaultPresentationManager; }
*** 288,304 **** protected ORB() { // Initialize logging first, since it is needed nearly // everywhere (for example, in TypeCodeImpl). ! wrapperMap = new ConcurrentHashMap(); wrapper = ORBUtilSystemException.get( this, CORBALogDomains.RPC_PRESENTATION ) ; omgWrapper = OMGSystemException.get( this, CORBALogDomains.RPC_PRESENTATION ) ; ! typeCodeMap = new HashMap(); primitiveTypeCodeConstants = new TypeCodeImpl[] { new TypeCodeImpl(this, TCKind._tk_null), new TypeCodeImpl(this, TCKind._tk_void), new TypeCodeImpl(this, TCKind._tk_short), --- 262,278 ---- protected ORB() { // Initialize logging first, since it is needed nearly // everywhere (for example, in TypeCodeImpl). ! wrapperMap = new ConcurrentHashMap<>(); wrapper = ORBUtilSystemException.get( this, CORBALogDomains.RPC_PRESENTATION ) ; omgWrapper = OMGSystemException.get( this, CORBALogDomains.RPC_PRESENTATION ) ; ! typeCodeMap = new HashMap<>(); primitiveTypeCodeConstants = new TypeCodeImpl[] { new TypeCodeImpl(this, TCKind._tk_null), new TypeCodeImpl(this, TCKind._tk_void), new TypeCodeImpl(this, TCKind._tk_short),
*** 361,371 **** } public synchronized TypeCodeImpl getTypeCode(String id) { checkShutdownState(); ! return (TypeCodeImpl)typeCodeMap.get(id); } public MonitoringManager getMonitoringManager( ) { synchronized (this) { checkShutdownState(); --- 335,345 ---- } public synchronized TypeCodeImpl getTypeCode(String id) { checkShutdownState(); ! return typeCodeMap.get(id); } public MonitoringManager getMonitoringManager( ) { synchronized (this) { checkShutdownState();
*** 524,559 **** } /** get the log wrapper class (its type is dependent on the exceptionGroup) for the * given log domain and exception group in this ORB instance. */ ! public LogWrapperBase getLogWrapper( String logDomain, ! String exceptionGroup, LogWrapperFactory factory ) { ! StringPair key = new StringPair( logDomain, exceptionGroup ) ; ! LogWrapperBase logWrapper = (LogWrapperBase)wrapperMap.get( key ); if (logWrapper == null) { ! logWrapper = factory.create( getLogger( logDomain ) ); ! wrapperMap.put( key, logWrapper ); } return logWrapper; } /** get the log wrapper class (its type is dependent on the exceptionGroup) for the * given log domain and exception group in this ORB instance. */ ! public static LogWrapperBase staticGetLogWrapper( String logDomain, ! String exceptionGroup, LogWrapperFactory factory ) { ! StringPair key = new StringPair( logDomain, exceptionGroup ) ; ! LogWrapperBase logWrapper = (LogWrapperBase)staticWrapperMap.get( key ); if (logWrapper == null) { ! logWrapper = factory.create( staticGetLogger( logDomain ) ); ! staticWrapperMap.put( key, logWrapper ); } return logWrapper; } --- 498,533 ---- } /** get the log wrapper class (its type is dependent on the exceptionGroup) for the * given log domain and exception group in this ORB instance. */ ! public LogWrapperBase getLogWrapper(String logDomain, ! String exceptionGroup, LogWrapperFactory factory) { ! StringPair key = new StringPair(logDomain, exceptionGroup); ! LogWrapperBase logWrapper = wrapperMap.get(key); if (logWrapper == null) { ! logWrapper = factory.create(getLogger(logDomain)); ! wrapperMap.put(key, logWrapper); } return logWrapper; } /** get the log wrapper class (its type is dependent on the exceptionGroup) for the * given log domain and exception group in this ORB instance. */ ! public static LogWrapperBase staticGetLogWrapper(String logDomain, ! String exceptionGroup, LogWrapperFactory factory) { ! StringPair key = new StringPair(logDomain, exceptionGroup); ! LogWrapperBase logWrapper = staticWrapperMap.get(key); if (logWrapper == null) { ! logWrapper = factory.create( staticGetLogger(logDomain)); ! staticWrapperMap.put(key, logWrapper); } return logWrapper; }