Package io.wcm.handler.link.type.helpers
Class LinkResolveCounter
- java.lang.Object
-
- io.wcm.handler.link.type.helpers.LinkResolveCounter
-
public final class LinkResolveCounter extends java.lang.Object
Counts number of recursive link resolve requests to detect endless loops. Max. 5 hops are allowed inisMaximumReached()
method.
-
-
Constructor Summary
Constructors Constructor Description LinkResolveCounter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
decreaseCount()
Decrease counter by 1.static @NotNull LinkResolveCounter
get()
int
getCount()
void
increaseCount()
Increase counter by 1.boolean
isMaximumReached()
-
-
-
Method Detail
-
getCount
public int getCount()
- Returns:
- Counter value
-
increaseCount
public void increaseCount()
Increase counter by 1.
-
decreaseCount
public void decreaseCount()
Decrease counter by 1. If 0 is reached the counter instance is removed from the current thread.
-
isMaximumReached
public boolean isMaximumReached()
- Returns:
- true if maximum of allowed recursion steps is reached.
-
get
@NotNull public static @NotNull LinkResolveCounter get()
- Returns:
- Counter for current request/thread. If instance was not set in thread before it is newly created and attached to the current thread.
-
-