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 java.lang.Object implements org.springframework.beans.factory.InitializingBeanASpringBeanExtensions 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(java.util.List<SpringBeanExtension<?,?>> extensions)voidsetId(java.lang.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(java.util.List<SpringBeanExtension<?,?>> extensions)
-
setId
public void setId(java.lang.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.
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
-