Package org.alfresco.traitextender
Class ExtenderImpl
java.lang.Object
org.alfresco.traitextender.Extender
org.alfresco.traitextender.ExtenderImpl
Standard-singleton
Extender implementation.- Author:
- Bogdan Horje
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<E,M extends Trait>
EgetExtension(Extensible anExtensible, ExtensionPoint<E, M> point) Creates and returns a unique perExtensibleTraitobject ornullif no extension-point factory is registered for the givenExtensionPoint.
Given thatExtensible.getTrait(Class)is used to obtain theExtendedTraitthat the returned extension is uniquely associated with, the uniqueness and garbage collection of the returned extension is dependent on how the givenExtensiblehandles itsExtendedTraits.voidregister(ExtensionPoint<?, ?> point, ExtensionFactory<?> factory) Registers an extension-point to factory association to be used in extension creation.voidstart(ExtensionBundle bundle) Start life-cycle phase trigger method.
Upon successful execution the bundle will have all its extension points registered usingExtender.register(ExtensionPoint, ExtensionFactory)and ready to be.voidstop(ExtensionBundle bundle) Start life-cycle phase trigger method.
Upon successful execution the bundle will have all its extension points unregistered usingExtender.unregister(ExtensionPoint).voidstopAll()Stops all previously registeredExtensionBundles.voidunregister(ExtensionPoint<?, ?> point) Unregisters an extension-point to factory association of the given extension point.Methods inherited from class org.alfresco.traitextender.Extender
getInstance
-
Constructor Details
-
ExtenderImpl
public ExtenderImpl()
-
-
Method Details
-
start
Description copied from class:ExtenderStart life-cycle phase trigger method.
Upon successful execution the bundle will have all its extension points registered usingExtender.register(ExtensionPoint, ExtensionFactory)and ready to be. -
stop
Description copied from class:ExtenderStart life-cycle phase trigger method.
Upon successful execution the bundle will have all its extension points unregistered usingExtender.unregister(ExtensionPoint). -
stopAll
public void stopAll()Description copied from class:ExtenderStops all previously registeredExtensionBundles. -
getExtension
Description copied from class:ExtenderCreates and returns a unique perExtensibleTraitobject ornullif no extension-point factory is registered for the givenExtensionPoint.
Given thatExtensible.getTrait(Class)is used to obtain theExtendedTraitthat the returned extension is uniquely associated with, the uniqueness and garbage collection of the returned extension is dependent on how the givenExtensiblehandles itsExtendedTraits.- Specified by:
getExtensionin classExtender- Returns:
- a unique per
ExtensibleTraitextension object ornullif no extension-point factory is registered for the givenExtensionPoint
-
register
Description copied from class:ExtenderRegisters an extension-point to factory association to be used in extension creation. The presence of an association for a given extension point guarantees that, when requested, a unique extension object perExtensibleTraitextension is returned byExtender.getExtension(Extensible, ExtensionPoint).- Specified by:
registerin classExtender- Parameters:
point- the extension point to be associated with the given extension factory during extension retrieval usingExtender.getExtension(Extensible, ExtensionPoint)
-
unregister
Description copied from class:ExtenderUnregisters an extension-point to factory association of the given extension point. The absence of an association for a given extension point guarantees that, when requested, a null is returned byExtender.getExtension(Extensible, ExtensionPoint).
Unregistering extension points does not force the garbage collection of the already created extensions.- Specified by:
unregisterin classExtender
-