|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface EntityProviderManager
Handles all internal work of managing and working with the entity providers
Registration of entity brokers happens via spring, see the EntityProvider interface for
details
| Method Summary | ||
|---|---|---|
EntityPropertiesService |
getEntityProperties()
Allows access to the current EntityPropertiesService service |
|
EntityProviderMethodStore |
getEntityProviderMethodStore()
Allows access to the current EntityProviderMethodStore service |
|
List<Class<? extends EntityProvider>> |
getPrefixCapabilities(String prefix)
Get all the capabilities for a given entity prefix, WARNING: This is very inefficient so you should normally use getProviderByPrefixAndCapability(String, Class)
when trying to determine if a provider implements a specific capability |
|
|
getPrefixesByCapability(Class<T> capability)
Gets the prefixes which support a specific capability |
|
EntityProvider |
getProviderByPrefix(String prefix)
Get the entity provider by the prefix which uniquely defines all entities of a type, NOTE: this returns the CoreEntityProvider that handles the exists check (it
may handle many other things as well), the basic EntityProvider if there is no
CoreEntityProvider, OR null if neither exists |
|
|
getProviderByPrefixAndCapability(String prefix,
Class<T> capability)
Get the entity provider by the prefix which uniquely defines all entities of a type and also handles a specific capability NOTE: this returns the provider that handles this capability (it may handle many other things as well) |
|
EntityProvider |
getProviderByReference(String reference)
Deprecated. this method is no longer functional or supported |
|
|
getProvidersByCapability(Class<T> capability)
Get all the entity providers which support a specific capability, this useful if you need to get the providers and call the capability methods on them directly |
|
Map<String,List<Class<? extends EntityProvider>>> |
getRegisteredEntityCapabilities()
Get all registered prefixes and their capabilities, WARNING: This is very inefficient so you should normally use getProviderByPrefixAndCapability(String, Class)
when trying to determine if a provider implements a specific capability |
|
Set<String> |
getRegisteredPrefixes()
Retrieve a complete list of all currently registered EntityProviders |
|
RequestGetterWrite |
getRequestGetter()
Allows access to the current RequestGetter service |
|
RequestStorageWrite |
getRequestStorage()
Allows access to the current RequestStorage service |
|
void |
registerEntityProvider(EntityProvider entityProvider)
Registers an entity provider with the manager, this allows registration to happen programatically but the preferred method is to use the AutoRegisterEntityProvider
instead (see the EntityProvider interface), replaces an existing entity provider which
uses the same prefix and handles the same capabilities if one is already registered, does not
affect other providers which handle the same prefix but handle other capabilitiesNOTE: This allows developers to register providers from all over the code base without requiring all capabilities to live in the same project (i.e. allows for a large reduction in dependencies and conflicts) |
|
|
registerListener(EntityProviderListener<T> listener,
boolean includeExisting)
Registers a listener which is called whenever entity providers are registered depending on the filters in the EntityProviderListenerThis is particularly useful for capabilities which should/must be executed one time only and should not be called over and over OR will not do anything until they are triggered |
|
void |
unregisterCapability(String prefix,
Class<? extends EntityProvider> capability)
Unregisters an entity provider with the manager based on a prefix and capability, this will remove a registered entity broker from the manager registration, if the prefix and capability are not registered then no error is thrown NOTE: Attempting to unregister the base EntityProvider will cause an exception, if you want to completely unregister a
type of entity you must use the unregisterEntityProviderByPrefix(String) |
|
void |
unregisterEntityProvider(EntityProvider entityProvider)
Unregisters an entity provider with the manager, this will remove a registered entity broker from the manager registration, if the entity provider supplied is not registered then no error is thrown |
|
void |
unregisterEntityProviderByPrefix(String prefix)
Unregisters an entity provider with the manager based on the entity prefix it handles, this will remove all registered entity providers from the manager registration by the prefix, if the entity provider prefix provided is not registered then no error is thrown This effectively purges the entire set of entity providers for a prefix |
|
|
unregisterListener(EntityProviderListener<T> listener)
Unregisters the listener if it is registered or does nothing |
|
| Method Detail |
|---|
Set<String> getRegisteredPrefixes()
EntityProviders
EntityProvider getProviderByReference(String reference)
getProviderByPrefix(String) CoreEntityProvider that handles the exists check (it may handle many other things
as well) or returns null
reference - a globally unique reference to an entity
EntityProvider which handles this entity or null if none exists, fails if
the reference is invalidEntityProvider getProviderByPrefix(String prefix)
CoreEntityProvider that handles the exists check (it
may handle many other things as well), the basic EntityProvider if there is no
CoreEntityProvider, OR null if neither exists
prefix - the string which represents a type of entity handled by an entity provider
EntityProvider which handles this entity or null if none exists (only if
prefix is not used)
<T extends EntityProvider> T getProviderByPrefixAndCapability(String prefix,
Class<T> capability)
T - a class which extends EntityProviderprefix - the string which represents a type of entity handled by an entity providercapability - any entity provider capability class (these classes extend EntityProvider or
CoreEntityProvider or another capability)
EntityProvider which handles this capability for this prefix or null if
none exists or the prefix is not used<T extends EntityProvider> List<T> getProvidersByCapability(Class<T> capability)
T - a class which extends EntityProvidercapability - any entity provider capability class (these classes extend EntityProvider or
CoreEntityProvider or another capability)
<T extends EntityProvider> List<String> getPrefixesByCapability(Class<T> capability)
T - a class which extends EntityProvidercapability - any entity provider capability class (these classes extend EntityProvider or
CoreEntityProvider or another capability)
List<Class<? extends EntityProvider>> getPrefixCapabilities(String prefix)
getProviderByPrefixAndCapability(String, Class)
when trying to determine if a provider implements a specific capability
prefix - the string which represents a type of entity handled by an entity provider
Map<String,List<Class<? extends EntityProvider>>> getRegisteredEntityCapabilities()
getProviderByPrefixAndCapability(String, Class)
when trying to determine if a provider implements a specific capability
void registerEntityProvider(EntityProvider entityProvider)
AutoRegisterEntityProvider
instead (see the EntityProvider interface), replaces an existing entity provider which
uses the same prefix and handles the same capabilities if one is already registered, does not
affect other providers which handle the same prefix but handle other capabilities
entityProvider - an entity provider to register with the main entity provider managervoid unregisterEntityProvider(EntityProvider entityProvider)
entityProvider - an entity provider to unregister with the main entity provider manager
void unregisterCapability(String prefix,
Class<? extends EntityProvider> capability)
EntityProvider will cause an exception, if you want to completely unregister a
type of entity you must use the unregisterEntityProviderByPrefix(String)
prefix - the string which represents a type of entity handled by an entity providercapability - any entity provider capability class (these classes extend EntityProvider or
CoreEntityProvider or another capability)void unregisterEntityProviderByPrefix(String prefix)
prefix - the string which represents a type of entity handled by entity providers
<T extends EntityProvider> void registerListener(EntityProviderListener<T> listener,
boolean includeExisting)
EntityProviderListener
notifier - the entity provider listener to registerincludeExisting - if true then the listener will be called for existing registered providers,
otherwise it will only be called for newly registered providers
IllegalArgumentException - if the params are null<T extends EntityProvider> void unregisterListener(EntityProviderListener<T> listener)
notifier - the entity provider listener to unregister
IllegalArgumentException - if the params are nullRequestStorageWrite getRequestStorage()
RequestGetterWrite getRequestGetter()
EntityPropertiesService getEntityProperties()
EntityProviderMethodStore getEntityProviderMethodStore()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||