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
A
Works in conjunction with
The spring-context XML sample bellow shows the definition of spring-bundled trait-extensions:
SpringBeanExtensions collection that get registered on the
Extender's registry on afterPropertiesSet().Works in conjunction with
SpringBeanExtensions and
SpringExtensionPoints to define and start spring based
ExtensionBundles of SingletonExtensions.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 -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanReturns whether the current bundle should be registered or not.voidsetEnabled(boolean enabled) voidsetExtensions(List<SpringBeanExtension<?, ?>> extensions) voidvoidstart()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.
-
Constructor Details
-
SpringExtensionBundle
public SpringExtensionBundle()
-
-
Method Details
-
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
-
setId
-
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
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-