Package org.alfresco.traitextender
Class SingletonExtensionFactory<E,S extends SingletonExtension<E,T>,T extends Trait>
- java.lang.Object
-
- org.alfresco.traitextender.SingletonExtensionFactory<E,S,T>
-
- All Implemented Interfaces:
ExtensionFactory<E>
public class SingletonExtensionFactory<E,S extends SingletonExtension<E,T>,T extends Trait> extends java.lang.Object implements ExtensionFactory<E>
Creates singleton extension sub classes that are extension API implementors. The singleton extensions continue to exist after the extensible has been collected.- Author:
- Bogdan Horje
-
-
Constructor Summary
Constructors Constructor Description SingletonExtensionFactory(S singleton, java.lang.Class<E> extensionAPI)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanCreateExtensionFor(ExtensionPoint<?,?> point)<TO extends Trait>
EcreateExtension(TO traitObject)
-
-
-
Constructor Detail
-
SingletonExtensionFactory
public SingletonExtensionFactory(S singleton, java.lang.Class<E> extensionAPI) throws InvalidExtension
- Throws:
InvalidExtension
-
-
Method Detail
-
createExtension
public <TO extends Trait> E createExtension(TO traitObject)
- Specified by:
createExtensionin interfaceExtensionFactory<E>
-
canCreateExtensionFor
public boolean canCreateExtensionFor(ExtensionPoint<?,?> point)
- Specified by:
canCreateExtensionForin interfaceExtensionFactory<E>- Returns:
trueif the given extensio-point API elements are compatible with the returned extension (i.e. the given extension API is assignable form the type of the extension created by this factory and theTraitaccepted as aparameter inExtensionFactory.createExtension(Trait)is assignable from the type of the given trait API).
-
-