@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>();
        
        synchronized (this.timers) {
            for (final TimerImpl timer : this.timers.values()) {
                
                if (timer.isActive() || (!timer.isActive() && timer.getState() == TimerState.ACTIVE)) {
                    if (timer.getPrimaryKey() == null || timer.getPrimaryKey().equals(pk)) {
                        activeTimers.add(timer);
                    }
                }
            }
        }
        
        
        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}
{