Search in sources :

Example 1 with TimedObjectInvoker

use of org.jboss.as.ejb3.timerservice.spi.TimedObjectInvoker in project wildfly by wildfly.

the class CalendarTimerTask method invokeBeanMethod.

@Override
protected void invokeBeanMethod(TimerImpl timer) throws Exception {
    // finally invoke the timeout method through the invoker
    if (timer.isAutoTimer()) {
        CalendarTimer calendarTimer = (CalendarTimer) timer;
        TimedObjectInvoker invoker = this.timerService.getInvoker();
        // call the timeout method
        invoker.callTimeout(calendarTimer, calendarTimer.getTimeoutMethod());
    } else {
        this.timerService.getInvoker().callTimeout(timer);
    }
}
Also used : TimedObjectInvoker(org.jboss.as.ejb3.timerservice.spi.TimedObjectInvoker)

Example 2 with TimedObjectInvoker

use of org.jboss.as.ejb3.timerservice.spi.TimedObjectInvoker in project wildfly by wildfly.

the class TimerServiceImpl method start.

@Override
public synchronized void start(final StartContext context) throws StartException {
    if (EJB3_TIMER_LOGGER.isDebugEnabled()) {
        EJB3_TIMER_LOGGER.debug("Starting timerservice for timedObjectId: " + getInvoker().getTimedObjectId());
    }
    final EJBComponent component = ejbComponentInjectedValue.getValue();
    this.tsr = component.getTransactionSynchronizationRegistry();
    final TimedObjectInvoker invoker = timedObjectInvoker.getValue();
    if (invoker == null) {
        throw EJB3_TIMER_LOGGER.invokerIsNull();
    }
    started = true;
    timerPersistence.getValue().timerDeployed(timedObjectInvoker.getValue().getTimedObjectId());
    // register ourselves to the TimerServiceRegistry (if any)
    if (timerServiceRegistry != null) {
        timerServiceRegistry.registerTimerService(this);
    }
    listenerHandle = timerPersistence.getValue().registerChangeListener(getInvoker().getTimedObjectId(), new TimerRefreshListener());
}
Also used : TimedObjectInvoker(org.jboss.as.ejb3.timerservice.spi.TimedObjectInvoker) EJBComponent(org.jboss.as.ejb3.component.EJBComponent)

Aggregations

TimedObjectInvoker (org.jboss.as.ejb3.timerservice.spi.TimedObjectInvoker)2 EJBComponent (org.jboss.as.ejb3.component.EJBComponent)1