Package org.apache.sling.distribution.journal.impl.subscriber

## Class SubscriberIdle

- java.lang.Object
- - org.apache.sling.distribution.journal.impl.subscriber.SubscriberIdle

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`, `IdleCheck`

    public class SubscriberIdle
    extends Object
    implements IdleCheck

A DistributionSubscriber is considered ready when it is idle for more than the READY_IDLE_TIME_SECONDS at least once ; or when it is busy processing the same package for more than MAX_RETRIES times.

### Field Summary

Fields
`static int` `DEFAULT_FORCE_IDLE_MILLIS`
`static int` `DEFAULT_IDLE_TIME_MILLIS`
`static int` `MAX_RETRIES`

### Constructor Summary

Constructors
`SubscriberIdle​(int idleMillis, int forceIdleMillies, AtomicBoolean readyHolder)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `busy​(int retries)` Called when processing of a message starts
`void` `close()`
`void` `idle()` Called when processing of a message has finished
`boolean` `isIdle()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### DEFAULT_IDLE_TIME_MILLIS

    public static final int DEFAULT_IDLE_TIME_MILLIS

See Also:
  Constant Field Values

#### DEFAULT_FORCE_IDLE_MILLIS

    public static final int DEFAULT_FORCE_IDLE_MILLIS

See Also:
  Constant Field Values

#### MAX_RETRIES

    public static final int MAX_RETRIES

See Also:
  Constant Field Values

### Constructor Detail

#### SubscriberIdle

    public SubscriberIdle​(int idleMillis,
                          int forceIdleMillies,
                          AtomicBoolean readyHolder)

### Method Detail

#### isIdle

    public boolean isIdle()

Specified by:
  `isIdle` in interface `IdleCheck`

#### busy

    public void busy​(int retries)

Called when processing of a message starts

Specified by:
  `busy` in interface `IdleCheck`
Parameters:
  `retries` - the number of retries to process the message

#### idle

    public void idle()

Called when processing of a message has finished

Specified by:
  `idle` in interface `IdleCheck`

#### close

    public void close()

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`