Package javax.ejb

Examples of javax.ejb.TimerService


      public TimerService getTimerService(ObjectName containerId, Object instancePk)
              throws IllegalStateException
      {
         try
         {
            TimerService timerService = mbeanEjbTimerService.getTimerService(containerId, instancePk);
            return timerService;
         }
         catch (Exception e)
         {
            log.error("Cannot getTimerService", e);
View Full Code Here


            try
            {
               TimedObjectId targetId = handle.getTimedObjectId();
               ObjectName containerName = targetId.getContainerId();
               ContainerMBean container = (ContainerMBean)MBeanProxyExt.create(ContainerMBean.class, containerName, server);
               TimerService timerService = container.getTimerService(targetId.getInstancePk());
               timerService.createTimer(handle.getFirstTime(), handle.getPeriode(), handle.getInfo());
            }
            catch (Exception e)
            {
               log.warn("Unable to restore timer record: " + handle);
            }
View Full Code Here

            TimerHandleImpl handle = (TimerHandleImpl)i.next();
            try
            {
               TimedObjectId targetId = handle.getTimedObjectId();
               ContainerMBean container = (ContainerMBean)MBeanProxyExt.create(ContainerMBean.class, containerId, server);              
               TimerService timerService = container.getTimerService(targetId.getInstancePk());
               timerService.createTimer(handle.getFirstTime(), handle.getPeriode(), handle.getInfo());
            }
            catch (Exception e)
            {
               log.warn("Unable to restore timer record: " + handle, e);
            }
View Full Code Here

    schedule(getDueDate());
  }

  private void schedule(Date dueDate) {
    log.debug("registering timer #" + getDbid() + " due " + TimerImpl.formatDueDate(dueDate));
    TimerService timerService = entityContext.getTimerService();
    timerService.createTimer(dueDate, null);
  }
View Full Code Here

      {
         return;
      }

      // get hold of the timerservice since we need it to create the autotimers
      TimerService timerService = this.container.getTimerService();

      if (timerService instanceof org.jboss.ejb3.timerservice.extension.TimerService == false)
      {
         // can't do anything about this
         logger.warn("Cannot create auto timers for EJB: " + enterpriseBeanMetaData.getEjbName()
View Full Code Here

/*     */ {
/*  44 */   private static Logger log = Logger.getLogger(JBossTimerServiceFactory.class);
/*     */
/*     */   public TimerService createTimerService(Container container, TimedObjectInvoker invoker)
/*     */   {
/*  52 */     TimerService timerService = null;
/*     */     try
/*     */     {
/*  55 */       EJBTimerService service = getEJBTimerService();
/*  56 */       TimerService delegate = service.createTimerService(container.getObjectName(), null, invoker);
/*  57 */       timerService = new TimerServiceFacade(container, delegate);
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/*  62 */       if (log.isTraceEnabled())
View Full Code Here

/* 468 */         TimerHandleImpl handle = (TimerHandleImpl)i.next();
/*     */         try
/*     */         {
/* 471 */           TimedObjectId targetId = handle.getTimedObjectId();
/* 472 */           ContainerMBean container = (ContainerMBean)MBeanProxyExt.create(ContainerMBean.class, containerId, this.server);
/* 473 */           TimerService timerService = container.getTimerService(targetId.getInstancePk());
/* 474 */           timerService.createTimer(handle.getFirstTime(), handle.getPeriode(), handle.getInfo());
/*     */         }
/*     */         catch (Exception e)
/*     */         {
/* 478 */           log.warn("Unable to restore timer record: " + handle, e);
/*     */         }
View Full Code Here

/*  774 */     if (!TimedObject.class.isAssignableFrom(this.beanClass))
/*      */     {
/*  777 */       return EJBTimerServiceImpl.FOR_NON_TIMED_OBJECT;
/*      */     }
/*      */
/*  780 */     TimerService timerService = null;
/*      */     try
/*      */     {
/*  783 */       timerService = this.timerService.createTimerService(getJmxName(), pKey, this);
/*      */     }
/*      */     catch (Exception e)
View Full Code Here

/*     */     public TimerService createTimerService(ObjectName containerId, Object instancePk, Container container)
/*     */       throws IllegalStateException
/*     */     {
/*     */       try
/*     */       {
/* 111 */         TimerService timerService = this.mbeanEjbTimerService.createTimerService(containerId, instancePk, container);
/* 112 */         return timerService;
/*     */       }
/*     */       catch (Exception e)
/*     */       {
/* 116 */         EJBTimerServiceLocator.log.error("Cannot createTimerService", e);
View Full Code Here

/*     */     public TimerService createTimerService(ObjectName containerId, Object instancePk, TimedObjectInvoker invoker)
/*     */       throws IllegalStateException
/*     */     {
/*     */       try
/*     */       {
/* 126 */         TimerService timerService = this.mbeanEjbTimerService.createTimerService(containerId, instancePk, invoker);
/* 127 */         return timerService;
/*     */       }
/*     */       catch (Exception e)
/*     */       {
/* 131 */         EJBTimerServiceLocator.log.error("Cannot createTimerService", e);
View Full Code Here

TOP

Related Classes of javax.ejb.TimerService

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.