- java.lang.Object
-
- ch.qos.logback.core.util.ReentryGuardFactory
-
public class ReentryGuardFactory extends Object
Factory that createsReentryGuardinstances 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 Classes Modifier and Type Class Description static classReentryGuardFactory.GuardTypeTypes of guards that can be produced by this factory.
-
Constructor Summary
Constructors Constructor Description ReentryGuardFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ReentryGuardmakeGuard(ReentryGuardFactory.GuardType guardType)Create aReentryGuardfor the givenReentryGuardFactory.GuardType.
-
-
-
Constructor Detail
-
ReentryGuardFactory
public ReentryGuardFactory()
-
-
Method Detail
-
makeGuard
public static ReentryGuard makeGuard(ReentryGuardFactory.GuardType guardType)
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
-
-