Examples of TimerService


Examples of com.espertech.esper.timer.TimerService

        long msecTimerResolution = configSnapshot.getEngineDefaults().getThreading().getInternalTimerMsecResolution();
        if (msecTimerResolution <= 0)
        {
            throw new ConfigurationException("Timer resolution configuration not set to a valid value, expecting a non-zero value");
        }
        TimerService timerService = new TimerServiceImpl(epServiceProvider.getURI(), msecTimerResolution);

        VariableService variableService = new VariableServiceImpl(configSnapshot.getEngineDefaults().getVariables().getMsecVersionRelease(), schedulingService, eventAdapterService, null);
        initVariables(variableService, configSnapshot.getVariables(), engineImportService);

        StatementLockFactory statementLockFactory = new StatementLockFactoryImpl(configSnapshot.getEngineDefaults().getExecution().isFairlock(), configSnapshot.getEngineDefaults().getExecution().isDisableLocking());
View Full Code Here

Examples of javax.ejb.TimerService

     * Passes a message to the listener.
     * @param message - the message passed to the listener
     */
    public void onMessage(final Message message) {
        // Get the timer service
        TimerService timerService = messageDrivenContext.getTimerService();

        // Calling the timer service
        timerService.createTimer(FIRING_TIME, "Timer started by the onMessage() method");
    }
View Full Code Here

Examples of javax.ejb.TimerService

     * Tests the sessionContext by invoking "getTimerService".
     * @throws Exception if a problem occurs.
     */
    @SuppressWarnings("unused")
    protected void access01() throws Exception{
        TimerService ts = ctx.getTimerService();
    }
View Full Code Here

Examples of javax.ejb.TimerService

     * @throws Exception if a problem occurs
     */
    public static void checkJNDI() throws Exception{
        Context ctx = new InitialContext();

        TimerService ts = (TimerService) ctx.lookup("java:comp/TimerService");
        if (ts == null){
            throw new Exception("TimerService reference obtained using JNDI API is null.");
        }
    }
View Full Code Here

Examples of javax.ejb.TimerService

{
   private static Logger log = Logger.getLogger(JBossTimerServiceFactory.class);
  
   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

Examples of javax.ejb.TimerService

     
      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);
View Full Code Here

Examples of javax.ejb.TimerService

         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);
View Full Code Here

Examples of javax.ejb.TimerService

      {
         // jbcts-381
         return EJBTimerServiceImpl.FOR_NON_TIMED_OBJECT;
      }

      TimerService timerService = null;
      try
      {
         timerService = this.timerService.createTimerService(getJmxName(), pKey, this);
      }
      catch (Exception e)
View Full Code Here

Examples of javax.ejb.TimerService

            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

Examples of javax.ejb.TimerService

  /**
   * Returns the timer service.
   */
  public TimerService getTimerService()
  {
    TimerService service = _producer.getTimerService();
   
    if (service != null)
      return service;
   
    // ejb/0fj0
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.