Package org.apache.openejb.core.timer

Examples of org.apache.openejb.core.timer.EjbTimerService


            deploymentRegistry.put((String) beanContext.getDeploymentID(), beanContext);
            beanContext.setContainer(this);
        }
        instanceManager.deploy(beanContext);

        EjbTimerService timerService = beanContext.getEjbTimerService();
        if (timerService != null) {
            timerService.start();
        }
    }
View Full Code Here


   
    public void stop(BeanContext info) throws OpenEJBException {
    }
   
    public void undeploy(BeanContext info) throws OpenEJBException {
        EjbTimerService timerService = info.getEjbTimerService();
        if (timerService != null) {
            timerService.stop();
        }

        instanceManager.undeploy(info);

        synchronized (this) {
View Full Code Here

        BeanContext beanContext = threadContext.getBeanContext();
        Object primaryKey = threadContext.getPrimaryKey();

        // if we have a real timerservice, stop all timers. Otherwise, ignore...
        if (primaryKey != null) {
            EjbTimerService timerService = beanContext.getEjbTimerService();
            if (timerService != null && timerService instanceof EjbTimerServiceImpl) {
                for (Timer timer : beanContext.getEjbTimerService().getTimers(primaryKey)) {
                    timer.cancel();
                }
            }
View Full Code Here

        synchronized (this) {
            deploymentRegistry.put(id, beanContext);
            beanContext.setContainer(this);
        }

        EjbTimerService timerService = beanContext.getEjbTimerService();
        if (timerService != null) {
            timerService.start();
        }
       
    }
View Full Code Here

            instanceManager.freeInstance(threadContext);
        } finally{
            ThreadContext.exit(old);
        }
       
        EjbTimerService timerService = beanContext.getEjbTimerService();
        if (timerService != null) {
            timerService.stop();
        }
       
        instanceManager.undeploy(beanContext);
       
        synchronized (this) {
View Full Code Here

    public TimerService getTimerService() throws IllegalStateException {
        check(Call.getTimerService);

        ThreadContext threadContext = ThreadContext.getThreadContext();
        BeanContext beanContext = threadContext.getBeanContext();
        EjbTimerService timerService = beanContext.getEjbTimerService();
        if (timerService == null) {
            throw new IllegalStateException("This ejb does not support timers " + beanContext.getDeploymentID());
        }
        return new TimerServiceImpl(timerService, threadContext.getPrimaryKey(), beanContext.getEjbTimeout());
    }
View Full Code Here

            throw new OpenEJBException(e);
        }

        // start the timer service
        EjbTimerService timerService = beanContext.getEjbTimerService();
        if (timerService != null) {
            timerService.start();
        }
    }
View Full Code Here

            deploymentsById.put(deploymentId, beanContext);
            beansByClass.put(beanContext.getCmpImplClass(), beanContext);
            beanContext.setContainer(this);
        }

        EjbTimerService timerService = beanContext.getEjbTimerService();
        if (timerService != null) {
            timerService.start();
        }
    }
View Full Code Here

   
    public void stop(BeanContext beanContext) throws OpenEJBException {
    }
   
    public void undeploy(BeanContext beanContext) throws OpenEJBException {
        EjbTimerService timerService = beanContext.getEjbTimerService();
        if (timerService != null) {
            timerService.stop();
        }
        synchronized (this) {
            deploymentsById.remove(beanContext.getDeploymentID());
            beansByClass.remove(beanContext.getCmpImplClass());
View Full Code Here

        BeanContext beanContext = threadContext.getBeanContext();
        Object primaryKey = threadContext.getPrimaryKey();

        // stop timers
        if (primaryKey != null && beanContext.getEjbTimerService() != null) {
            EjbTimerService timerService = beanContext.getEjbTimerService();
            if (timerService != null && timerService instanceof EjbTimerServiceImpl) {
                for (Timer timer : beanContext.getEjbTimerService().getTimers(primaryKey)) {
                    timer.cancel();
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.openejb.core.timer.EjbTimerService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.