public abstract class AbstractGlobalSingleton extends AbstractSingleton
EScope.GLOBALm_aRWLock| Modifier | Constructor and Description |
|---|---|
protected |
AbstractGlobalSingleton() |
| Modifier and Type | Method and Description |
|---|---|
static List<AbstractGlobalSingleton> |
getAllGlobalSingletons()
Get all instantiated singleton objects registered in the current global
scope.
|
static <T extends AbstractGlobalSingleton> |
getGlobalSingleton(Class<T> aClass)
Get the singleton object in the current global scope, using the passed
class.
|
static <T extends AbstractGlobalSingleton> |
getGlobalSingletonIfInstantiated(Class<T> aClass)
Get the singleton object if it is already instantiated inside the current
global scope or
null if it is not instantiated. |
static boolean |
isGlobalSingletonInstantiated(Class<? extends AbstractGlobalSingleton> aClass)
Check if a singleton is already instantiated inside the current global
scope
|
getAllSingletons, getSingleton, getSingletonIfInstantiated, getSingletonScopeKey, isDestroyed, isInDestruction, isInInstantiation, isInPreDestruction, isInstantiated, isSingletonInstantiated, isUsableObject, onAfterInstantiation, onBeforeDestroy, onBeforeScopeDestruction, onDestroy, onScopeDestruction, readAbstractSingletonFields, setDestroyed, setInDestruction, setInInstantiation, setInPreDestruction, setInstantiated, toString, writeAbstractSingletonFields@Nonnull public static final <T extends AbstractGlobalSingleton> T getGlobalSingleton(@Nonnull Class<T> aClass)
T - The type to be returnedaClass - The class to be used. May not be null. The class must
be public as needs to have a public no-argument constructor.null.@Nullable public static final <T extends AbstractGlobalSingleton> T getGlobalSingletonIfInstantiated(@Nonnull Class<T> aClass)
null if it is not instantiated.T - The type to be returnedaClass - The class to be checked. May not be null.null otherwise.public static final boolean isGlobalSingletonInstantiated(@Nonnull Class<? extends AbstractGlobalSingleton> aClass)
aClass - The class to be checked. May not be null.true if the singleton for the specified class is
already instantiated, false otherwise.@Nonnull @ReturnsMutableCopy public static final List<AbstractGlobalSingleton> getAllGlobalSingletons()
null list with all instances of this class in
the current global scope.Copyright © 2014–2015 Philip Helger. All rights reserved.