Class DefaultPropertyBackedBeanRegistry
java.lang.Object
org.alfresco.repo.management.subsystems.DefaultPropertyBackedBeanRegistry
- All Implemented Interfaces:
EventListener,PropertyBackedBeanRegistry,TransactionListener,org.alfresco.util.transaction.TransactionListener,org.springframework.context.ApplicationListener
public class DefaultPropertyBackedBeanRegistry
extends Object
implements PropertyBackedBeanRegistry, org.springframework.context.ApplicationListener, TransactionListener
A default implementation of
PropertyBackedBeanRegistry. An instance of this class will defer broadcasting
PropertyBackedBeanEvents until it is notified that the database schema is available via a
SchemaAvailableEvent. This allows listeners to potentially reconfigure the beans using persisted database
information.- Author:
- dward
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(org.springframework.context.ApplicationListener listener) Registers a listener object that will be notified of register and deregister calls via aPropertyBackedBeanEvent.voidInvoked after transaction commit.voidInvoked after transaction rollback.voidbeforeCommit(boolean readOnly) Called before a transaction is committed.voidInvoked before transaction commit/rollback.voidbroadcastRemoveProperties(PropertyBackedBean bean, Collection<String> properties) Signals that aPropertyBackedBeanhas been asked to remove properties.voidbroadcastSetProperties(PropertyBackedBean bean, Map<String, String> properties) Signals that aPropertyBackedBeanhas been asked to update properties.voidbroadcastSetProperty(PropertyBackedBean bean, String name, String value) Signals that aPropertyBackedBeanhas been asked to update a property.voidSignals that aPropertyBackedBeanhas been started.voidSignals 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.
-
Constructor Details
-
DefaultPropertyBackedBeanRegistry
public DefaultPropertyBackedBeanRegistry()
-
-
Method Details
-
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
Description copied from interface:PropertyBackedBeanRegistrySignals that aPropertyBackedBeanhas been initialized.- Specified by:
registerin interfacePropertyBackedBeanRegistry- Parameters:
bean- the bean
-
deregister
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
Description copied from interface:PropertyBackedBeanRegistrySignals that aPropertyBackedBeanhas been started.- Specified by:
broadcastStartin interfacePropertyBackedBeanRegistry- Parameters:
bean- the bean
-
broadcastStop
Description copied from interface:PropertyBackedBeanRegistrySignals that aPropertyBackedBeanhas been stopped.- Specified by:
broadcastStopin interfacePropertyBackedBeanRegistry- Parameters:
bean- the bean
-
broadcastSetProperty
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
Description copied from interface:PropertyBackedBeanRegistrySignals that aPropertyBackedBeanhas been asked to update properties.- Specified by:
broadcastSetPropertiesin interfacePropertyBackedBeanRegistry- Parameters:
bean- the bean
-
broadcastRemoveProperties
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
-