Package javax.ejb

Examples of javax.ejb.Timer


         String name = "myJob" + jobNum;
         jobNum++;
        
         Class jobClass = QuartzTimerJob.class;
        
         Timer timer = new TimerImpl(scheduler, trigger, info);
        
         PersistentTimer persistentTimer = new PersistentTimer(trigger, Ejb3Registry.guid(container), info);
        
         JobDetail jobDetail = new JobDetail(name, groupName, jobClass);
         jobDetail.getJobDataMap().put("timer", persistentTimer);
View Full Code Here


     * @param timerData the timer to call.
     */
    @SuppressWarnings("ReturnInsideFinallyBlock")
    public void ejbTimeout(final TimerData timerData) {
        try {
            Timer timer = getTimer(timerData.getId());
            // quartz can be backed by some advanced config (jdbc for instance)
            if (timer == null && timerStore instanceof MemoryTimerStore && timerData.getTimer() != null) {
                try {
                    timerStore.addTimerData(timerData);
                    timer = timerData.getTimer(); // TODO: replace memoryjobstore by the db one?
View Full Code Here

        public Timer getTimer()
            throws IllegalStateException,
                   NoSuchObjectLocalException,
                   EJBException
        {
            Timer timer = (Timer) instance().call(new Callable() {
                public Object call()
                {
                    try
                    {
                        return handle.getTimer();
View Full Code Here

   }

   private void registerTimer(Invocation invocation)
           throws RollbackException, SystemException
   {
      Timer timer = (Timer) invocation.getArguments()[0];
      Transaction transaction = invocation.getTransaction();
      if (transaction != null && timer instanceof Synchronization)
         transaction.registerSynchronization((Synchronization) timer);
   }
View Full Code Here

        public Timer getTimer()
            throws IllegalStateException,
                   NoSuchObjectLocalException,
                   EJBException
        {
            Timer timer = (Timer) callInContext(new Callable() {
                public Object call() {
                    try
                    {
                        return handle.getTimer();
                    }
View Full Code Here

        String result = persist();
       
        Payment payment = getInstance();
        log.info("scheduling instance #0", payment);

        Timer timer = processor.schedulePayment(payment.getPaymentDate(),
                                                payment.getPaymentFrequency().getInterval(),
                                                payment);
       
        payment.setTimerHandle( timer.getHandle() );

        return result;
    }
View Full Code Here

         LocalDispatcher dispatcher = Dispatcher.instance();
         if (dispatcher==null)
         {
            throw new IllegalStateException("org.jboss.seam.core.dispatcher is not installed in components.xml");
         }
         Timer timer = dispatcher.scheduleInvocation( invocation, getComponent() );
         //if the method returns a Timer, return it to the client
         return invocation.getMethod().getReturnType().equals(Timer.class) ? timer : null;
      }
      else
      {
View Full Code Here

     *
     * @param timerData the timer to call.
     */
    public void ejbTimeout(TimerData timerData) {
        try {
            Timer timer = getTimer(timerData.getId());
            // quartz can be backed by some advanced config (jdbc for instance)
            if (timer == null && timerStore instanceof MemoryTimerStore && timerData.getTimer() != null) {
                try {
                    timerStore.addTimerData(timerData);
                    timer = timerData.getTimer(); // TODO: replace memoryjobstore by the db one?
View Full Code Here

/*  77 */       String name = "myJob" + this.jobNum;
/*  78 */       this.jobNum += 1L;
/*     */
/*  80 */       Class jobClass = QuartzTimerJob.class;
/*     */
/*  82 */       Timer timer = new TimerImpl(this.scheduler, trigger, info);
/*     */
/*  84 */       PersistentTimer persistentTimer = new PersistentTimer(trigger, Ejb3Registry.guid(this.container), info);
/*     */
/*  86 */       JobDetail jobDetail = new JobDetail(name, this.groupName, jobClass);
/*  87 */       jobDetail.getJobDataMap().put("timer", persistentTimer);
View Full Code Here

/*     */   }
/*     */
/*     */   private void registerTimer(Invocation invocation)
/*     */     throws RollbackException, SystemException
/*     */   {
/* 286 */     Timer timer = (Timer)invocation.getArguments()[0];
/* 287 */     Transaction transaction = invocation.getTransaction();
/* 288 */     if ((transaction != null) && ((timer instanceof Synchronization)))
/* 289 */       transaction.registerSynchronization((Synchronization)timer);
/*     */   }
View Full Code Here

TOP

Related Classes of javax.ejb.Timer

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.