Search in sources :

Example 6 with NoSuchObjectLocalException

use of javax.ejb.NoSuchObjectLocalException in project wildfly by wildfly.

the class TimerAttributeDefinition method addNextTimeout.

private static void addNextTimeout(Timer timer, ModelNode timerNode, final String componentName) {
    try {
        final ModelNode detailNode = timerNode.get(NEXT_TIMEOUT);
        Date d = timer.getNextTimeout();
        if (d != null) {
            detailNode.set(d.getTime());
        }
    } catch (IllegalStateException e) {
    // ignore
    } catch (NoSuchObjectLocalException e) {
    // ignore
    } catch (EJBException e) {
        logTimerFailure(componentName, e);
    }
}
Also used : NoSuchObjectLocalException(javax.ejb.NoSuchObjectLocalException) ModelNode(org.jboss.dmr.ModelNode) EJBException(javax.ejb.EJBException) Date(java.util.Date)

Example 7 with NoSuchObjectLocalException

use of javax.ejb.NoSuchObjectLocalException in project tomee by apache.

the class TimerHandleImpl method getTimer.

public Timer getTimer() {
    final ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
    if (containerSystem == null) {
        throw new NoSuchObjectLocalException("OpenEJb container system is not running");
    }
    final BeanContext beanContext = containerSystem.getBeanContext(deploymentId);
    if (beanContext == null) {
        throw new NoSuchObjectLocalException("Deployment info not found " + deploymentId);
    }
    final EjbTimerService timerService = beanContext.getEjbTimerService();
    if (timerService == null) {
        throw new NoSuchObjectLocalException("Deployment no longer supports ejbTimout " + deploymentId + ". Has this ejb been redeployed?");
    }
    final Timer timer = timerService.getTimer(id);
    if (timer == null) {
        throw new NoSuchObjectLocalException("Timer not found for ejb " + deploymentId);
    }
    return timer;
}
Also used : ContainerSystem(org.apache.openejb.spi.ContainerSystem) NoSuchObjectLocalException(javax.ejb.NoSuchObjectLocalException) BeanContext(org.apache.openejb.BeanContext) Timer(javax.ejb.Timer)

Aggregations

NoSuchObjectLocalException (javax.ejb.NoSuchObjectLocalException)7 EJBException (javax.ejb.EJBException)5 ModelNode (org.jboss.dmr.ModelNode)5 Date (java.util.Date)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 NoMoreTimeoutsException (javax.ejb.NoMoreTimeoutsException)1 ScheduleExpression (javax.ejb.ScheduleExpression)1 Timer (javax.ejb.Timer)1 TimerConfig (javax.ejb.TimerConfig)1 BeanContext (org.apache.openejb.BeanContext)1 ContainerSystem (org.apache.openejb.spi.ContainerSystem)1 Test (org.junit.Test)1