Package org.jboss.ejb.txtimer

Examples of org.jboss.ejb.txtimer.EJBTimerService


   public TimerService createTimerService(TimedObjectInvoker invoker)
   {
      TimerService timerService = null;
      try
      {
         EJBTimerService service = getEJBTimerService();
         ObjectName objectName = new ObjectName(invoker.getTimedObjectId());
         org.jboss.ejb.txtimer.TimedObjectInvoker bridge = new TimedObjectInvokerBridge(invoker);
         TimerService delegate = service.createTimerService(objectName, null, bridge);
         timerService = new TimerServiceFacade(objectName, delegate);
      }
      catch (Exception e)
      {
         //throw new EJBException("Could not create timer service", e);
View Full Code Here


   protected void removeTimerService(ObjectName containerId)
   {
      try
      {
         EJBTimerService service = getEJBTimerService();
         service.removeTimerService(containerId, true);
      }
      catch (Exception e)
      {
         //throw new EJBException("Could not remove timer service", e);
         if (log.isTraceEnabled())
View Full Code Here

      final boolean trace = log.isTraceEnabled();
      if (trace)
      {
         log.trace("Check whether all timers are cancelled or expired for this entity: " + id);
      }
      final EJBTimerService service = container.getTimerService();
      final ObjectName containerId = container.getJmxName();
     
      AccessController.doPrivileged(new PrivilegedAction<Object>()
      {
         public Object run()
         {
            TimerService timerService = service.getTimerService(containerId, id);
            if (timerService != null && timerService.getTimers().isEmpty())
            {
               // Assuming that active timers do not include cancelled or expired ones.
               if (trace)
               {
                  log.trace("No active timers available for " + containerId + " and primary key " + id);
               }
               service.removeTimerService(containerId, id);
            }
            return null;
         }
      });
   }
View Full Code Here

      boolean trace = log.isTraceEnabled();
      if (trace)
      {
         log.trace("Check whether all timers are cancelled or expired for this entity: " + ctx);
      }
      EJBTimerService service = m_container.getTimerService();
      ObjectName containerId = m_container.getJmxName();
      Object pKey = ctx.getId();
      TimerService timerService = service.getTimerService(containerId, pKey);
      if (timerService != null && timerService.getTimers().isEmpty())
      {
         // Assuming that active timers do not include cancelled or expired ones.
         if (trace)
         {
            log.trace("No active timers available for " + containerId + " and primary key " + pKey);
         }
         service.removeTimerService(containerId, pKey);
      }
   }
View Full Code Here

   public TimerService createTimerService(Container container, TimedObjectInvoker invoker)
   {
      TimerService timerService = null;
      try
      {
         EJBTimerService service = getEJBTimerService();
         TimerService delegate = service.createTimerService(container.getObjectName(), null, invoker);
         timerService = new TimerServiceFacade(container, delegate);
      }
      catch (Exception e)
      {
         //throw new EJBException("Could not create timer service", e);
View Full Code Here

   protected void removeTimerService(ObjectName containerId)
   {
      try
      {
         EJBTimerService service = getEJBTimerService();
         service.removeTimerService(containerId, true);
      }
      catch (Exception e)
      {
         //throw new EJBException("Could not remove timer service", e);
         if (log.isTraceEnabled())
View Full Code Here

  
   public boolean hasTimerService(String jndi)
   {
      try
      {
         EJBTimerService service = EJBTimerServiceLocator.getEjbTimerService();
         String name = Container.BASE_EJB_CONTAINER_NAME + ",jndiName=" + jndi;
         ObjectName containerId = ObjectNameConverter.convert(name);
         return service.getTimerService(containerId, ctx.getPrimaryKey()) != null;        
      }
      catch(Exception e)
      {
         throw new EJBException("Unable to verify whether entity bean has a timer service associated", e);
      }
View Full Code Here

      final boolean trace = log.isTraceEnabled();
      if (trace)
      {
         log.trace("Check whether all timers are cancelled or expired for this entity: " + id);
      }
      final EJBTimerService service = container.getTimerService();
      final ObjectName containerId = container.getJmxName();
     
      AccessController.doPrivileged(new PrivilegedAction<Object>()
      {
         public Object run()
         {
            TimerService timerService = service.getTimerService(containerId, id);
            if (timerService != null && timerService.getTimers().isEmpty())
            {
               // Assuming that active timers do not include cancelled or expired ones.
               if (trace)
               {
                  log.trace("No active timers available for " + containerId + " and primary key " + id);
               }
               service.removeTimerService(containerId, id);
            }
            return null;
         }
      });
   }
View Full Code Here

      boolean trace = log.isTraceEnabled();
      if (trace)
      {
         log.trace("Check whether all timers are cancelled or expired for this entity: " + ctx);
      }
      EJBTimerService service = m_container.getTimerService();
      ObjectName containerId = m_container.getJmxName();
      Object pKey = ctx.getId();
      TimerService timerService = service.getTimerService(containerId, pKey);
      if (timerService != null && timerService.getTimers().isEmpty())
      {
         // Assuming that active timers do not include cancelled or expired ones.
         if (trace)
         {
            log.trace("No active timers available for " + containerId + " and primary key " + pKey);
         }
         service.removeTimerService(containerId, pKey);
      }
   }
View Full Code Here

   public TimerService createTimerService(Container container, TimedObjectInvoker invoker)
   {
      TimerService timerService = null;
      try
      {
         EJBTimerService service = getEJBTimerService();
         TimerService delegate = service.createTimerService(container.getObjectName(), null, invoker);
         timerService = new TimerServiceFacade(container, delegate);
      }
      catch (Exception e)
      {
         //throw new EJBException("Could not create timer service", e);
View Full Code Here

TOP

Related Classes of org.jboss.ejb.txtimer.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.