示例#1
0
 @Override
 public void start(final BeanContext beanContext) throws OpenEJBException {
   final EjbTimerService timerService = beanContext.getEjbTimerService();
   if (timerService != null) {
     timerService.start();
   }
 }
  public void deploy(BeanContext beanContext) throws OpenEJBException {
    String id = (String) beanContext.getDeploymentID();
    synchronized (this) {
      deploymentRegistry.put(id, beanContext);
      beanContext.setContainer(this);
    }

    EjbTimerService timerService = beanContext.getEjbTimerService();
    if (timerService != null) {
      timerService.start();
    }
  }
  public void undeploy(BeanContext beanContext) {

    EjbTimerService timerService = beanContext.getEjbTimerService();
    if (timerService != null) {
      timerService.stop();
    }

    instanceManager.undeploy(beanContext);

    synchronized (this) {
      String id = (String) beanContext.getDeploymentID();
      beanContext.setContainer(null);
      beanContext.setContainerData(null);
      deploymentRegistry.remove(id);
    }
  }
  public void undeploy(BeanContext beanContext) {
    ThreadContext threadContext = new ThreadContext(beanContext, null);
    ThreadContext old = ThreadContext.enter(threadContext);
    try {
      instanceManager.freeInstance(threadContext);
    } finally {
      ThreadContext.exit(old);
    }

    EjbTimerService timerService = beanContext.getEjbTimerService();
    if (timerService != null) {
      timerService.stop();
    }

    instanceManager.undeploy(beanContext);

    synchronized (this) {
      String id = (String) beanContext.getDeploymentID();
      beanContext.setContainer(null);
      beanContext.setContainerData(null);
      deploymentRegistry.remove(id);
    }
  }