Search in sources :

Example 1 with ThreadPoolManager

use of com.sun.corba.ee.spi.threadpool.ThreadPoolManager in project Payara by payara.

the class PEORBConfigurator method configure.

public void configure(DataCollector dc, ORB orb) {
    try {
        // end temp fix for bug 6320008
        if (threadpoolMgr != null) {
            // This will be the case for the Server Side ORB created
            // For client side threadpoolMgr will be null, so we will
            // never come here
            orb.setThreadPoolManager(threadpoolMgr);
        }
        // Do the stats for the threadpool
        ThreadPoolManager tpool = orb.getThreadPoolManager();
        // ORB creates its own threadpool if threadpoolMgr was null above
        ThreadPool thpool = tpool.getDefaultThreadPool();
        String ThreadPoolName = thpool.getName();
        ThreadPoolStats tpStats = new ThreadPoolStatsImpl(thpool.getWorkQueue(0).getThreadPool());
        StatsProviderManager.register("orb", PluginPoint.SERVER, "thread-pool/orb/threadpool/" + ThreadPoolName, tpStats);
        configureCopiers(orb);
        configureCallflowInvocationInterceptor(orb);
        // In the server-case, iiop acceptors need to be set up after the
        // initial part of the orb creation but before any
        // portable interceptor initialization
        IIOPUtils iiopUtils = IIOPUtils.getInstance();
        if (iiopUtils.getProcessType().isServer()) {
            List<IiopListener> iiop_listener_list = IIOPUtils.getInstance().getIiopService().getIiopListener();
            IiopListener[] iiopListenerBeans = iiop_listener_list.toArray(new IiopListener[iiop_listener_list.size()]);
            this.createORBListeners(iiopUtils, iiopListenerBeans, orb);
        }
        if (orb.getORBData().environmentIsGFServer()) {
            // Start the transient name service, which publishes NameService
            // in the ORB's local resolver.
            new TransientNameService(orb);
        }
        // Publish the ORB reference back to GlassFishORBHelper, so that
        // subsequent calls from interceptor ORBInitializers can call
        // GlassFishORBHelper.getORB() without problems.  This is
        // especially important for code running in the service initializer
        // thread.
        getHelper().setORB(orb);
    } catch (NoSuchWorkQueueException ex) {
        Logger.getLogger(PEORBConfigurator.class.getName()).log(Level.SEVERE, null, ex);
    }
}
Also used : IiopListener(org.glassfish.orb.admin.config.IiopListener) NoSuchWorkQueueException(com.sun.corba.ee.spi.threadpool.NoSuchWorkQueueException) ThreadPoolStats(org.glassfish.enterprise.iiop.util.ThreadPoolStats) ThreadPoolStatsImpl(org.glassfish.enterprise.iiop.util.ThreadPoolStatsImpl) ThreadPool(com.sun.corba.ee.spi.threadpool.ThreadPool) TransientNameService(com.sun.corba.ee.impl.naming.cosnaming.TransientNameService) ThreadPoolManager(com.sun.corba.ee.spi.threadpool.ThreadPoolManager) S1ASThreadPoolManager(org.glassfish.enterprise.iiop.util.S1ASThreadPoolManager) IIOPUtils(org.glassfish.enterprise.iiop.util.IIOPUtils)

Example 2 with ThreadPoolManager

use of com.sun.corba.ee.spi.threadpool.ThreadPoolManager in project Payara by payara.

the class POARemoteReferenceFactory method createReferenceFactory.

private ReferenceFactory createReferenceFactory(String poaId, String repoid) throws Exception {
    try {
        if (logger.isLoggable(Level.FINE)) {
            logger.log(Level.FINE, ".createReferenceFactory->: {0} {1}", new Object[] { poaId, repoid });
        }
        ReferenceFactoryManager rfm = (ReferenceFactoryManager) orb.resolve_initial_references(ORBConstants.REFERENCE_FACTORY_MANAGER);
        List<Policy> policies = new ArrayList<Policy>();
        // Servant caching for local RMI-IIOP invocation performance
        policies.add(ServantCachingPolicy.getPolicy());
        // OTS Policy
        policies.add(new OTSPolicyImpl());
        if (logger.isLoggable(Level.FINE)) {
            logger.log(Level.FINE, ".createReferenceFactory: {0} {1}: {2}", new Object[] { poaId, repoid, ejbDescriptor });
        }
        // CSIv2 Policy
        policies.add(new CSIv2Policy(ejbDescriptor));
        String threadPoolName = container.getUseThreadPoolId();
        int threadPoolNumericID = 0;
        boolean usePassByReference = container.getPassByReference();
        if (usePassByReference) {
            policies.add(new CopyObjectPolicy(PASS_BY_REFERENCE_ID));
        }
        if (threadPoolName != null) {
            ThreadPoolManager threadPoolManager = S1ASThreadPoolManager.getThreadPoolManager();
            try {
                threadPoolNumericID = threadPoolManager.getThreadPoolNumericId(threadPoolName);
                policies.add(new RequestPartitioningPolicy(threadPoolNumericID));
            } catch (Exception ex) {
                logger.log(Level.WARNING, "Not using threadpool-request-partitioning...", ex);
            }
        }
        if (logger.isLoggable(Level.FINE)) {
            String jndiName = ejbDescriptor.getJndiName();
            logger.log(Level.FINE, "Using Thread-Pool: [{0} ==> {1}] for jndi name: {2}", new Object[] { threadPoolName, threadPoolNumericID, jndiName });
            logger.log(Level.FINE, "Pass by reference: [{0}] for jndi name: {1}", new Object[] { usePassByReference, usePassByReference });
        }
        // if EJB allows only SSL invocations
        if (ejbDescriptor.allMechanismsRequireSSL()) {
            if (logger.isLoggable(Level.FINE)) {
                logger.log(Level.WARNING, ".createReferenceFactory: {0} {1}: adding ZeroPortPolicy", new Object[] { poaId, repoid });
            }
            policies.add(ZeroPortPolicy.getPolicy());
        }
        if (logger.isLoggable(Level.FINE)) {
            logger.log(Level.FINE, ".createReferenceFactory: {0} {1}: policies: {2}", new Object[] { poaId, repoid, policies });
        }
        ReferenceFactory rf = rfm.create(poaId, repoid, policies, this);
        return rf;
    } finally {
        if (logger.isLoggable(Level.FINE)) {
            logger.log(Level.WARNING, ".createReferenceFactory<-: {0} {1}", new Object[] { poaId, repoid });
        }
    }
}
Also used : Policy(org.omg.CORBA.Policy) ServantCachingPolicy(com.sun.corba.ee.spi.extension.ServantCachingPolicy) ZeroPortPolicy(com.sun.corba.ee.spi.extension.ZeroPortPolicy) CopyObjectPolicy(com.sun.corba.ee.spi.extension.CopyObjectPolicy) RequestPartitioningPolicy(com.sun.corba.ee.spi.extension.RequestPartitioningPolicy) CopyObjectPolicy(com.sun.corba.ee.spi.extension.CopyObjectPolicy) ArrayList(java.util.ArrayList) IOException(java.io.IOException) NotSerializableException(java.io.NotSerializableException) NoSuchObjectLocalException(javax.ejb.NoSuchObjectLocalException) ReferenceFactory(com.sun.corba.ee.spi.oa.rfm.ReferenceFactory) RemoteReferenceFactory(org.glassfish.enterprise.iiop.api.RemoteReferenceFactory) RequestPartitioningPolicy(com.sun.corba.ee.spi.extension.RequestPartitioningPolicy) ReferenceFactoryManager(com.sun.corba.ee.spi.oa.rfm.ReferenceFactoryManager) ThreadPoolManager(com.sun.corba.ee.spi.threadpool.ThreadPoolManager) S1ASThreadPoolManager(org.glassfish.enterprise.iiop.util.S1ASThreadPoolManager)

Aggregations

ThreadPoolManager (com.sun.corba.ee.spi.threadpool.ThreadPoolManager)2 S1ASThreadPoolManager (org.glassfish.enterprise.iiop.util.S1ASThreadPoolManager)2 TransientNameService (com.sun.corba.ee.impl.naming.cosnaming.TransientNameService)1 CopyObjectPolicy (com.sun.corba.ee.spi.extension.CopyObjectPolicy)1 RequestPartitioningPolicy (com.sun.corba.ee.spi.extension.RequestPartitioningPolicy)1 ServantCachingPolicy (com.sun.corba.ee.spi.extension.ServantCachingPolicy)1 ZeroPortPolicy (com.sun.corba.ee.spi.extension.ZeroPortPolicy)1 ReferenceFactory (com.sun.corba.ee.spi.oa.rfm.ReferenceFactory)1 ReferenceFactoryManager (com.sun.corba.ee.spi.oa.rfm.ReferenceFactoryManager)1 NoSuchWorkQueueException (com.sun.corba.ee.spi.threadpool.NoSuchWorkQueueException)1 ThreadPool (com.sun.corba.ee.spi.threadpool.ThreadPool)1 IOException (java.io.IOException)1 NotSerializableException (java.io.NotSerializableException)1 ArrayList (java.util.ArrayList)1 NoSuchObjectLocalException (javax.ejb.NoSuchObjectLocalException)1 RemoteReferenceFactory (org.glassfish.enterprise.iiop.api.RemoteReferenceFactory)1 IIOPUtils (org.glassfish.enterprise.iiop.util.IIOPUtils)1 ThreadPoolStats (org.glassfish.enterprise.iiop.util.ThreadPoolStats)1 ThreadPoolStatsImpl (org.glassfish.enterprise.iiop.util.ThreadPoolStatsImpl)1 IiopListener (org.glassfish.orb.admin.config.IiopListener)1