Class ReentryGuardFactory
java.lang.Object
ch.qos.logback.core.util.ReentryGuardFactory
Factory that creates
ReentryGuard instances according to a requested type.
This class centralizes creation of the built-in guard implementations. Consumers can use the factory to obtain either a per-thread guard or a no-op guard depending on their needs.
- Since:
- 1.5.21
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumTypes of guards that can be produced by this factory. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ReentryGuardmakeGuard(ReentryGuardFactory.GuardType guardType) Create aReentryGuardfor the givenReentryGuardFactory.GuardType.
-
Constructor Details
-
ReentryGuardFactory
public ReentryGuardFactory()
-
-
Method Details
-
makeGuard
Create aReentryGuardfor the givenReentryGuardFactory.GuardType.Returns a fresh instance of the requested guard implementation. The factory does not cache instances; callers may obtain separate instances as required.
Thread-safety: this method is stateless and may be called concurrently from multiple threads.
- Parameters:
guardType- the type of guard to create; must not benull- Returns:
- a new
ReentryGuardinstance implementing the requested semantics - Throws:
NullPointerException- ifguardTypeisnullIllegalArgumentException- if an unknown guard type is provided- Since:
- 1.5.21
-