Class DefaultPropertyBackedBeanRegistry
- java.lang.Object
-
- org.alfresco.repo.management.subsystems.DefaultPropertyBackedBeanRegistry
-
- All Implemented Interfaces:
java.util.EventListener,PropertyBackedBeanRegistry,TransactionListener,org.alfresco.util.transaction.TransactionListener,org.springframework.context.ApplicationListener
public class DefaultPropertyBackedBeanRegistry extends java.lang.Object implements PropertyBackedBeanRegistry, org.springframework.context.ApplicationListener, TransactionListener
A default implementation ofPropertyBackedBeanRegistry. An instance of this class will defer broadcastingPropertyBackedBeanEvents until it is notified that the database schema is available via aSchemaAvailableEvent. This allows listeners to potentially reconfigure the beans using persisted database information.- Author:
- dward
-
-
Constructor Summary
Constructors Constructor Description DefaultPropertyBackedBeanRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(org.springframework.context.ApplicationListener listener)Registers a listener object that will be notified of register and deregister calls via aPropertyBackedBeanEvent.voidafterCommit()Invoked after transaction commit.voidafterRollback()Invoked after transaction rollback.voidbeforeCommit(boolean readOnly)Called before a transaction is committed.voidbeforeCompletion()Invoked before transaction commit/rollback.voidbroadcastRemoveProperties(PropertyBackedBean bean, java.util.Collection<java.lang.String> properties)Signals that aPropertyBackedBeanhas been asked to remove properties.voidbroadcastSetProperties(PropertyBackedBean bean, java.util.Map<java.lang.String,java.lang.String> properties)Signals that aPropertyBackedBeanhas been asked to update properties.voidbroadcastSetProperty(PropertyBackedBean bean, java.lang.String name, java.lang.String value)Signals that aPropertyBackedBeanhas been asked to update a property.voidbroadcastStart(PropertyBackedBean bean)Signals that aPropertyBackedBeanhas been started.voidbroadcastStop(PropertyBackedBean bean)Signals that aPropertyBackedBeanhas been stopped.voidderegister(PropertyBackedBean bean, boolean isPermanent)Signals thePropertyBackedBeanUnregisteredEventevent.voidflush()voidonApplicationEvent(org.springframework.context.ApplicationEvent event)voidregister(PropertyBackedBean bean)Signals that aPropertyBackedBeanhas been initialized.
-
-
-
Method Detail
-
addListener
public void addListener(org.springframework.context.ApplicationListener listener)
Description copied from interface:PropertyBackedBeanRegistryRegisters a listener object that will be notified of register and deregister calls via aPropertyBackedBeanEvent.- Specified by:
addListenerin interfacePropertyBackedBeanRegistry- Parameters:
listener- the listener
-
register
public void register(PropertyBackedBean bean)
Description copied from interface:PropertyBackedBeanRegistrySignals that aPropertyBackedBeanhas been initialized.- Specified by:
registerin interfacePropertyBackedBeanRegistry- Parameters:
bean- the bean
-
deregister
public void deregister(PropertyBackedBean bean, boolean isPermanent)
Description copied from interface:PropertyBackedBeanRegistrySignals thePropertyBackedBeanUnregisteredEventevent.- Specified by:
deregisterin interfacePropertyBackedBeanRegistry- Parameters:
bean- the beanisPermanent- is the component being destroyed forever, i.e. should persisted values be removed? On server shutdown, this value would befalse, whereas on the removal of a dynamically created instance, this value would betrue.
-
broadcastStart
public void broadcastStart(PropertyBackedBean bean)
Description copied from interface:PropertyBackedBeanRegistrySignals that aPropertyBackedBeanhas been started.- Specified by:
broadcastStartin interfacePropertyBackedBeanRegistry- Parameters:
bean- the bean
-
broadcastStop
public void broadcastStop(PropertyBackedBean bean)
Description copied from interface:PropertyBackedBeanRegistrySignals that aPropertyBackedBeanhas been stopped.- Specified by:
broadcastStopin interfacePropertyBackedBeanRegistry- Parameters:
bean- the bean
-
broadcastSetProperty
public void broadcastSetProperty(PropertyBackedBean bean, java.lang.String name, java.lang.String value)
Description copied from interface:PropertyBackedBeanRegistrySignals that aPropertyBackedBeanhas been asked to update a property.- Specified by:
broadcastSetPropertyin interfacePropertyBackedBeanRegistry- Parameters:
bean- the beanname- the namevalue- the value
-
broadcastSetProperties
public void broadcastSetProperties(PropertyBackedBean bean, java.util.Map<java.lang.String,java.lang.String> properties)
Description copied from interface:PropertyBackedBeanRegistrySignals that aPropertyBackedBeanhas been asked to update properties.- Specified by:
broadcastSetPropertiesin interfacePropertyBackedBeanRegistry- Parameters:
bean- the bean
-
broadcastRemoveProperties
public void broadcastRemoveProperties(PropertyBackedBean bean, java.util.Collection<java.lang.String> properties)
Description copied from interface:PropertyBackedBeanRegistrySignals that aPropertyBackedBeanhas been asked to remove properties.- Specified by:
broadcastRemovePropertiesin interfacePropertyBackedBeanRegistry- Parameters:
bean- the bean
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
- Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener
-
beforeCommit
public void beforeCommit(boolean readOnly)
Description copied from interface:TransactionListenerCalled before a transaction is committed.All transaction resources are still available.
- Specified by:
beforeCommitin interfaceTransactionListener- Specified by:
beforeCommitin interfaceorg.alfresco.util.transaction.TransactionListener- Parameters:
readOnly- true if the transaction is read-only
-
afterCommit
public void afterCommit()
Description copied from interface:TransactionListenerInvoked after transaction commit.Any exceptions generated here will only be logged and will have no effect on the state of the transaction.
Although all transaction resources are still available, this method should be used only for cleaning up resources after a commit has occured.
- Specified by:
afterCommitin interfaceTransactionListener- Specified by:
afterCommitin interfaceorg.alfresco.util.transaction.TransactionListener
-
beforeCompletion
public void beforeCompletion()
Description copied from interface:TransactionListenerInvoked before transaction commit/rollback. Will be called afterTransactionListener.beforeCommit(boolean)even ifTransactionListener.beforeCommit(boolean)failed.All transaction resources are still available.
- Specified by:
beforeCompletionin interfaceTransactionListener- Specified by:
beforeCompletionin interfaceorg.alfresco.util.transaction.TransactionListener
-
afterRollback
public void afterRollback()
Description copied from interface:TransactionListenerInvoked after transaction rollback.Any exceptions generated here will only be logged and will have no effect on the state of the transaction.
Although all transaction resources are still available, this method should be used only for cleaning up resources after a rollback has occured.
- Specified by:
afterRollbackin interfaceTransactionListener- Specified by:
afterRollbackin interfaceorg.alfresco.util.transaction.TransactionListener
-
flush
public void flush()
- Specified by:
flushin interfaceTransactionListener
-
-