Class SingletonEnforcer
- java.lang.Object
-
- org.glassfish.admin.amx.impl.util.SingletonEnforcer
-
public final class SingletonEnforcer extends Object
Enforce singleton semantics: if an item already exists, an Error is thrown. Otherwise it is recorded for future checks. This facility exists because of ugly framework requirements for singletons to offer public constructors, which can allow more than one instance of a class to be instantiated.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
deregister(Class<?> theClass, Object theInstance)
static <T> T
get(Class<T> theClass)
static void
register(Class<?> theClass, Object theInstance)
-