ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerServiceImpl.java
@Override
    public Collection<Timer> getTimers() throws IllegalStateException, EJBException {
        assertTimerServiceState();
        Object pk = currentPrimaryKey();
        final Set<Timer> activeTimers = new HashSet<Timer>();
        // get all active timers for this timerservice
        synchronized (this.timers) {
            for (final TimerImpl timer : this.timers.values()) {
                // Less disruptive way to get WFLY-8457 fixed.
                if (timer.isActive() || (!timer.isActive() && timer.getState() == TimerState.ACTIVE)) {
                    if (timer.getPrimaryKey() == null || timer.getPrimaryKey().equals(pk)) {
                        activeTimers.add(timer);
                    }
                }
            }
        }
        // get all active timers which are persistent, but haven't yet been
        // persisted (waiting for tx to complete) that are in the current transaction
        for (final TimerImpl timer : getWaitingOnTxCompletionTimers().values()) {
            if (timer.isActive()) {
                if (timer.getPrimaryKey() == null || timer.getPrimaryKey().equals(pk)) {
                    activeTimers.add(timer);
                }
            }
        }
        return activeTimers;
    }
@Override
    public Collection<Timer> getTimers() throws IllegalStateException, EJBException {
        assertTimerServiceState();
        Object pk = currentPrimaryKey();
        final Set<Timer> activeTimers = new HashSet<Timer>();
        // get all active timers for this timerservice
        synchronized (this.timers) {
            for (final TimerImpl timer : this.timers.values()) {
                // Less disruptive way to get WFLY-8457 fixed.
                if (timer.isActive() || (!timer.isActive() && timer.getState() == TimerState.ACTIVE)) {
                    if (timer.getPrimaryKey() == null || timer.getPrimaryKey().equals(pk)) {
                        activeTimers.add(timer);
                    }
                }
            }
        }
        // get all active timers which are persistent, but haven't yet been
        // persisted (waiting for tx to complete) that are in the current transaction
        for (final TimerImpl timer : getWaitingOnTxCompletionTimers().values()) {
            if (timer.isActive()) {
                if (timer.getPrimaryKey() == null || timer.getPrimaryKey().equals(pk)) {
                    activeTimers.add(timer);
                }
            }
        }
        return activeTimers;
    }
@ Override public Collection < Timer > getTimers ( ) throws IllegalStateException , EJBException { assertTimerServiceState ( ) ; Object pk = currentPrimaryKey ( ) ; final Set < Timer > activeTimers = new HashSet < Timer > ( ) ; // get all active timers for this timerservice synchronized ( this . timers ) { for ( final TimerImpl timer : this . timers . values ( ) ) { // Less disruptive way to get WFLY-8457 fixed. if ( timer . isActive ( ) || ( ! timer . isActive ( ) && timer . getState ( ) == TimerState . ACTIVE ) ) { if ( timer . getPrimaryKey ( ) == null || timer . getPrimaryKey ( ) . equals ( pk ) ) { activeTimers . add ( timer ) ; } } } } // get all active timers which are persistent, but haven't yet been // persisted (waiting for tx to complete) that are in the current transaction for ( final TimerImpl timer : getWaitingOnTxCompletionTimers ( ) . values ( ) ) { if ( timer . isActive ( ) ) { if ( timer . getPrimaryKey ( ) == null || timer . getPrimaryKey ( ) . equals ( pk ) ) { activeTimers . add ( timer ) ; } } } return activeTimers ; }
{@inheritDoc}
{