Search in sources :

Example 1 with Acceptor

use of com.sun.corba.ee.spi.transport.Acceptor in project Payara by payara.

the class PEORBConfigurator method addAcceptor.

private Acceptor addAcceptor(org.omg.CORBA.ORB orb, boolean isLazy, String host, String type, int port) {
    com.sun.corba.ee.spi.orb.ORB theOrb = (com.sun.corba.ee.spi.orb.ORB) orb;
    TransportManager ctm = theOrb.getTransportManager();
    Acceptor acceptor;
    if (isLazy) {
        acceptor = TransportDefault.makeLazyCorbaAcceptor(theOrb, port, host, type);
    } else {
        acceptor = TransportDefault.makeStandardCorbaAcceptor(theOrb, port, host, type);
    }
    ctm.registerAcceptor(acceptor);
    return acceptor;
}
Also used : Acceptor(com.sun.corba.ee.spi.transport.Acceptor) ORB(com.sun.corba.ee.spi.orb.ORB) TransportManager(com.sun.corba.ee.spi.transport.TransportManager) ORB(com.sun.corba.ee.spi.orb.ORB)

Example 2 with Acceptor

use of com.sun.corba.ee.spi.transport.Acceptor in project Payara by payara.

the class PEORBConfigurator method createORBListeners.

private void createORBListeners(IIOPUtils iiopUtils, IiopListener[] iiopListenerBeans, org.omg.CORBA.ORB orb) {
    if (iiopListenerBeans != null) {
        int lazyCount = 0;
        for (IiopListener ilb : iiopListenerBeans) {
            boolean securityEnabled = Boolean.valueOf(ilb.getSecurityEnabled());
            boolean isLazy = Boolean.valueOf(ilb.getLazyInit());
            if (isLazy) {
                lazyCount++;
            }
            if (lazyCount > 1) {
                throw new IllegalStateException("Invalid iiop-listener " + ilb.getId() + ". Only one iiop-listener can be configured " + "with lazy-init=true");
            }
            int port = Integer.parseInt(ilb.getPort());
            String host = handleAddrAny(ilb.getAddress());
            if (!securityEnabled || ilb.getSsl() == null) {
                Acceptor acceptor = addAcceptor(orb, isLazy, host, IIOP_CLEAR_TEXT_CONNECTION, port);
                if (isLazy) {
                    lazyAcceptor = acceptor;
                }
            } else {
                if (isLazy) {
                    throw new IllegalStateException("Invalid iiop-listener " + ilb.getId() + ". Lazy-init not supported for SSL iiop-listeners");
                }
                Ssl sslBean = ilb.getSsl();
                assert sslBean != null;
                boolean clientAuth = Boolean.valueOf(sslBean.getClientAuthEnabled());
                String type = clientAuth ? SSL_MUTUALAUTH : SSL;
                addAcceptor(orb, isLazy, host, type, port);
            }
        }
        if (lazyCount == 1) {
            getHelper().setSelectableChannelDelegate(new AcceptorDelegateImpl(lazyAcceptor));
        }
    }
}
Also used : IiopListener(org.glassfish.orb.admin.config.IiopListener) Acceptor(com.sun.corba.ee.spi.transport.Acceptor) Ssl(org.glassfish.grizzly.config.dom.Ssl) PluginPoint(org.glassfish.external.probe.provider.PluginPoint)

Aggregations

Acceptor (com.sun.corba.ee.spi.transport.Acceptor)2 ORB (com.sun.corba.ee.spi.orb.ORB)1 TransportManager (com.sun.corba.ee.spi.transport.TransportManager)1 PluginPoint (org.glassfish.external.probe.provider.PluginPoint)1 Ssl (org.glassfish.grizzly.config.dom.Ssl)1 IiopListener (org.glassfish.orb.admin.config.IiopListener)1