Package com.bc.ceres.core
Class ExtensionManager
java.lang.Object
com.bc.ceres.core.ExtensionManager
The
ExtensionManager
is a service used to register and unregister ExtensionFactory
s with a given
type of an extensible object.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<E> E
getExtension
(Object extensibleObject, Class<E> extensionType) Gets a dynamic extension for the given (extensible) object.abstract ExtensionFactory[]
getExtensionFactories
(Class<?> extensibleType) Gets all extension factories registered for the given type.static ExtensionManager
abstract void
register
(Class<?> extensibleType, ExtensionFactory factory) Registers an extension factory for the given extensible type.static void
setInstance
(ExtensionManager instance) abstract void
unregister
(Class<?> extensibleType, ExtensionFactory factory) Unregisters an extension factory for the given extensible type.
-
Constructor Details
-
ExtensionManager
public ExtensionManager()
-
-
Method Details
-
getInstance
- Returns:
- The service instance.
-
setInstance
- Parameters:
instance
- The service instance.
-
register
Registers an extension factory for the given extensible type.- Parameters:
extensibleType
- The extensible type.factory
- The factory.
-
unregister
Unregisters an extension factory for the given extensible type.- Parameters:
extensibleType
- The extensible type.factory
- The factory.
-
getExtensionFactories
Gets all extension factories registered for the given type.- Parameters:
extensibleType
- The extensible type.- Returns:
- The list of extension factories. May be empty.
-
getExtension
Gets a dynamic extension for the given (extensible) object.- Parameters:
extensibleObject
- The (extensible) object.extensionType
- The type of the requested extension.- Returns:
- The extension instance, or
null
if the given object is not extensible by this factory or if the factory fails to provide that extension. - See Also:
-