FileDocCategorySizeDatePackage
ContainerServiceImpl.javaAPI DocGlassfish v2 API6523Fri May 04 22:32:54 BST 2007com.sun.ejb.base.container

ContainerServiceImpl

public class ContainerServiceImpl extends Object implements com.sun.ejb.spi.container.ContainerService

Fields Summary
private static String
J2EE_OBJECT_FACTORY_NAME
private static final Logger
_ejbLogger
private Timer
timer
private com.sun.ejb.spi.io.J2EEObjectStreamFactory
j2eeObjectStreamFactory
Constructors Summary
public ContainerServiceImpl()


      
    
Methods Summary
public com.sun.ejb.spi.io.J2EEObjectStreamFactorygetJ2EEObjectStreamFactory()

        return j2eeObjectStreamFactory;
    
public java.util.TimergetTimer()

        return timer;
    
public voidinitializeService()

        timer = new Timer(true);

        try {
            Class clazz = Class.forName(J2EE_OBJECT_FACTORY_NAME);
            j2eeObjectStreamFactory = (J2EEObjectStreamFactory) clazz.newInstance();
            _ejbLogger.log(Level.FINE, "Instantiated J2EEObjectStreamFactory");
        } catch (Exception ex) {
            _ejbLogger.log(Level.WARNING, "Couldn't instantiate "
                    + "J2EEObjectstreamFactory", ex);
        }
    
public voidscheduleWork(java.lang.ClassLoader classLoader, java.lang.Runnable target)

        ThreadPoolWork work = new ThreadPoolWork(classLoader, target);

        try {
            ThreadPoolManager threadpoolMgr =
                S1ASThreadPoolManager.getThreadPoolManager();
            ThreadPool threadpool = threadpoolMgr.getDefaultThreadPool();
            threadpool.getAnyWorkQueue().addWork(work);
        } catch (Throwable th) {
            String errMsg =  "Error while adding work to orb threadpool. "
                + "Hence doing it in current thread";
            _ejbLogger.log(Level.WARNING, errMsg, th);
            work.doWork();
        }
    
public voidshutdown()

        timer = null;