Search in sources :

Example 1 with EJBObjectOutputStreamHandler

use of com.sun.ejb.base.io.EJBObjectOutputStreamHandler in project Payara by payara.

the class EjbContainerUtilImpl method postConstruct.

@Override
public void postConstruct() {
    ejbContainer = serverConfig.getExtensionByType(EjbContainer.class);
    ClassLoader ejbImplClassLoader = EjbContainerUtilImpl.class.getClassLoader();
    if (callFlowAgent == null) {
        callFlowAgent = (Agent) Proxy.newProxyInstance(ejbImplClassLoader, new Class[] { Agent.class }, new InvocationHandler() {

            @Override
            public Object invoke(Object proxy, Method m, Object[] args) {
                return null;
            }
        });
    }
    defaultThreadPoolExecutor = createThreadPoolExecutor(DEFAULT_THREAD_POOL_NAME);
    // avoid starting JDK timer in application class loader.  The life of _timer
    // field is longer than deployed apps, and any reference to app class loader
    // in JDK timer thread will cause class loader leak.  Issue 17468
    ClassLoader originalClassLoader = null;
    try {
        originalClassLoader = Utility.setContextClassLoader(ejbImplClassLoader);
        _timer = new Timer("EJB Container Timer", true);
    } finally {
        if (originalClassLoader != null) {
            Utility.setContextClassLoader(originalClassLoader);
        }
    }
    EJBObjectOutputStreamHandler.setJavaEEIOUtils(javaEEIOUtils);
    javaEEIOUtils.addGlassFishOutputStreamHandler(new EJBObjectOutputStreamHandler());
    javaEEIOUtils.addGlassFishInputStreamHandler(new EJBObjectInputStreamHandler());
    _me = this;
}
Also used : EjbContainer(org.glassfish.ejb.config.EjbContainer) Timer(java.util.Timer) EJBObjectOutputStreamHandler(com.sun.ejb.base.io.EJBObjectOutputStreamHandler) EJBObjectInputStreamHandler(com.sun.ejb.base.io.EJBObjectInputStreamHandler) Method(java.lang.reflect.Method) InvocationHandler(java.lang.reflect.InvocationHandler)

Aggregations

EJBObjectInputStreamHandler (com.sun.ejb.base.io.EJBObjectInputStreamHandler)1 EJBObjectOutputStreamHandler (com.sun.ejb.base.io.EJBObjectOutputStreamHandler)1 InvocationHandler (java.lang.reflect.InvocationHandler)1 Method (java.lang.reflect.Method)1 Timer (java.util.Timer)1 EjbContainer (org.glassfish.ejb.config.EjbContainer)1