R - A type that implements FacadeReadypublic abstract class AbstractFacade<R extends FacadeReady<R>> extends AbstractGlobalReady implements LocalFacade<R>, FacadeMessages
| Modifier and Type | Field and Description |
|---|---|
private Map<UniqueKey<? extends R>,WeakReference<R>> |
componentMap
The map that store FacadeReady singletons.
|
private static JRLogger |
LOGGER
The class logger.
|
COMPONENT_BUILD_ERROR, COMPONENT_CUSTOM_FACTORY_ERROR, COMPONENT_RETRIEVAL_ERROR, JREBIRTH_EVENT, JTP_CREATION| Constructor and Description |
|---|
AbstractFacade(GlobalFacade globalFacade)
Default Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private <E extends R> |
buildClassKey(Class<E> clazz)
Build a singleton key.
|
protected <E extends R> |
buildComponent(UniqueKey<E> uniqueKey)
Build a new instance of the ready object class.
|
<E extends R> |
buildKey(Class<E> clazz,
Object... keyPart)
Build an unique key.
|
private <E extends R> |
buildMultitonKey(Class<E> clazz,
Object... keyPart)
Build a multiton key.
|
<E extends R> |
exists(Class<E> clazz,
Object... keyPart)
Check if the component has already been created and stored.
|
<E extends R> |
exists(UniqueKey<E> uniqueKey)
Check if the component has already been created and stored.
|
<E extends R> |
register(E readyObject,
Object... keyPart)
Register a new ready object component.
|
<E extends R> |
register(UniqueKey<E> uniqueKey,
E readyObject)
Register a new ready object component.
|
<E extends R> |
retrieve(Class<E> clazz,
Object... keyPart)
Retrieve a ready object component.
|
<E extends R> |
retrieve(UniqueKey<E> uniqueKey)
Retrieve a ready object component.
|
<E extends R> |
unregister(E readyObject,
Object... keyPart)
Unregister a new ready object component.
|
<E extends R> |
unregister(UniqueKey<E> uniqueKey)
Unregister a new ready object component.
|
getGlobalFacadeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetGlobalFacadeprivate static final JRLogger LOGGER
private final Map<UniqueKey<? extends R extends FacadeReady<R>>,WeakReference<R extends FacadeReady<R>>> componentMap
public AbstractFacade(GlobalFacade globalFacade)
globalFacade - the global facade of the applicationpublic <E extends R> void register(UniqueKey<E> uniqueKey, E readyObject)
register in interface Facade<R extends FacadeReady<R>>E - the type of the ready object useduniqueKey - the unique key for the component to getreadyObject - the component to registerpublic <E extends R> void register(E readyObject, Object... keyPart)
register in interface Facade<R extends FacadeReady<R>>E - the type of the ready object usedreadyObject - the component to registerkeyPart - the unique key for multiton FacadeReady element, could be omitted for singletonpublic <E extends R> void unregister(UniqueKey<E> uniqueKey)
unregister in interface Facade<R extends FacadeReady<R>>E - the type of the ready object useduniqueKey - the unique key for the component to getpublic <E extends R> void unregister(E readyObject, Object... keyPart)
unregister in interface Facade<R extends FacadeReady<R>>E - the type of the ready object usedreadyObject - the component to unregisterkeyPart - the unique key for multiton FacadeReady element, could be omitted for singletonpublic <E extends R> boolean exists(UniqueKey<E> uniqueKey)
exists in interface Facade<R extends FacadeReady<R>>E - The type of the object registered by this ClassKeyuniqueKey - the unique key for the component to getpublic <E extends R> boolean exists(Class<E> clazz, Object... keyPart)
exists in interface Facade<R extends FacadeReady<R>>E - The type of the object registered by this ClassKeyclazz - the component class to checkkeyPart - the unique key for multiton FacadeReady element, could be omitted for singletonpublic <E extends R> E retrieve(UniqueKey<E> uniqueKey)
retrieve in interface Facade<R extends FacadeReady<R>>E - the type of the ready object to retrieveuniqueKey - the unique key for the component to getpublic <E extends R> E retrieve(Class<E> clazz, Object... keyPart)
retrieve in interface Facade<R extends FacadeReady<R>>E - the type of the ready object to retrieveclazz - the component classkeyPart - the unique key for multiton FacadeReady element, could be omitted for singletonprotected <E extends R> E buildComponent(UniqueKey<E> uniqueKey) throws CoreException
E - the type of the ready object to retrieveuniqueKey - the unique key for the component to getCoreException - if an error occurredpublic <E extends R> UniqueKey<E> buildKey(Class<E> clazz, Object... keyPart)
buildKey in interface Facade<R extends FacadeReady<R>>E - The type of the object registered by this ClassKeyclazz - the class type of the componentkeyPart - all complementary part of the keyprivate <E extends R> UniqueKey<E> buildClassKey(Class<E> clazz)
E - The type of the object registered by this ClassKeyclazz - the class type of the componentprivate <E extends R> UniqueKey<E> buildMultitonKey(Class<E> clazz, Object... keyPart)
E - The type of the object registered by this ClassKeyclazz - the class type of the componentkeyPart - all complementary part of the keyCopyright © 2011–2014 JRebirth OSS. All rights reserved.