Package org.alfresco.traitextender
Class SpringExtensionBundle
- java.lang.Object
-
- org.alfresco.traitextender.SpringExtensionBundle
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
public class SpringExtensionBundle extends Object implements org.springframework.beans.factory.InitializingBean
ASpringBeanExtensions collection that get registered on theExtender's registry onafterPropertiesSet().
Works in conjunction withSpringBeanExtensions andSpringExtensionPoints to define and start spring basedExtensionBundles ofSingletonExtensions.
The spring-context XML sample bellow shows the definition of spring-bundled trait-extensions:<bean id="ep1" class="org.alfresco.traitextender.SpringExtensionPoint"> <property name="extension" value="org.alfresco.sample.Extension1" /> <property name="trait" value="org.alfresco.sample.Trait1" /> </bean> <bean id="ep2" class="org.alfresco.traitextender.SpringExtensionPoint"> <property name="extension" value="org.alfresco.sample.Extension2" /> <property name="trait" value="org.alfresco.sample.Trait2" /> </bean> <bean id="extension1" class="org.alfresco.sample.Extension1"> <property name="extensionPoint" ref="ep1" /> </bean> <bean id="extension2" class="org.alfresco.sample.Extension2"> <property name="extensionPoint" ref="ep2" /> </bean> <bean id="aBundle" class="org.alfresco.traitextender.SpringExtensionBundle"> <property name="id" value="org.alfresco.sample.aBundle" /> <property name="enabled" value="true" /> <property name="extensions"> <list> <ref bean="extension1" /> <ref bean="extension2" /> </list > </property> </bean>- Author:
- Bogdan Horje
-
-
Constructor Summary
Constructors Constructor Description SpringExtensionBundle()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()booleanisEnabled()Returns whether the current bundle should be registered or not.voidsetEnabled(boolean enabled)voidsetExtensions(List<SpringBeanExtension<?,?>> extensions)voidsetId(String id)voidstart()Creates aRegistryExtensionBundleand registers all containedSpringBeanExtensions with it.
When all extension have successfully registered it starts theRegistryExtensionBundle.
The previously createdRegistryExtensionBundleis stored for later start orstop()operations.voidstop()Stops a previouslystart()createdRegistryExtensionBundle.
-
-
-
Method Detail
-
setEnabled
public void setEnabled(boolean enabled)
- Parameters:
enabled-trueif the current bundle should be registered.
falseif the current bundle should skip extension registration
-
isEnabled
public boolean isEnabled()
Returns whether the current bundle should be registered or not.- Returns:
trueif the current bundle should be registered, otherwisefalse
-
setExtensions
public void setExtensions(List<SpringBeanExtension<?,?>> extensions)
-
setId
public void setId(String id)
-
start
public void start()
Creates aRegistryExtensionBundleand registers all containedSpringBeanExtensions with it.
When all extension have successfully registered it starts theRegistryExtensionBundle.
The previously createdRegistryExtensionBundleis stored for later start orstop()operations.
-
stop
public void stop()
Stops a previouslystart()createdRegistryExtensionBundle.
-
-