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 voidderegister(Class<?> theClass, Object theInstance)static <T> Tget(Class<T> theClass)static voidregister(Class<?> theClass, Object theInstance)
-