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 Modifier and Type Field Description static int
DEFAULT_FORCE_IDLE_MILLIS
static int
DEFAULT_IDLE_TIME_MILLIS
static int
MAX_RETRIES
-
Constructor Summary
Constructors Constructor Description SubscriberIdle(int idleMillis, int forceIdleMillies, AtomicBoolean readyHolder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
busy(int retries)
Called when processing of a message startsvoid
close()
void
idle()
Called when processing of a message has finishedboolean
isIdle()
-
-
-
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
-
busy
public void busy(int retries)
Called when processing of a message starts
-
idle
public void idle()
Called when processing of a message has finished
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-