public class DefaultPropertyBackedBeanRegistry extends Object implements PropertyBackedBeanRegistry, org.springframework.context.ApplicationListener, TransactionListener
PropertyBackedBeanRegistry
. An instance of this class will defer broadcasting
PropertyBackedBeanEvent
s 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.Constructor and Description |
---|
DefaultPropertyBackedBeanRegistry() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(org.springframework.context.ApplicationListener listener)
Registers a listener object that will be notified of register and deregister calls via a
PropertyBackedBeanEvent . |
void |
afterCommit()
Invoked after transaction commit.
|
void |
afterRollback()
Invoked after transaction rollback.
|
void |
beforeCommit(boolean readOnly)
Called before a transaction is committed.
|
void |
beforeCompletion()
Invoked before transaction commit/rollback.
|
void |
broadcastRemoveProperties(PropertyBackedBean bean,
Collection<String> properties)
Signals that a
PropertyBackedBean has been asked to
remove properties. |
void |
broadcastSetProperties(PropertyBackedBean bean,
Map<String,String> properties)
Signals that a
PropertyBackedBean has been asked to
update properties. |
void |
broadcastSetProperty(PropertyBackedBean bean,
String name,
String value)
Signals that a
PropertyBackedBean has been asked to
update a property. |
void |
broadcastStart(PropertyBackedBean bean)
Signals that a
PropertyBackedBean has been started. |
void |
broadcastStop(PropertyBackedBean bean)
Signals that a
PropertyBackedBean has been stopped. |
void |
deregister(PropertyBackedBean bean,
boolean isPermanent)
Signals the
PropertyBackedBeanUnregisteredEvent event. |
void |
flush() |
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event) |
void |
register(PropertyBackedBean bean)
Signals that a
PropertyBackedBean has been initialized. |
public void addListener(org.springframework.context.ApplicationListener listener)
PropertyBackedBeanRegistry
PropertyBackedBeanEvent
.addListener
in interface PropertyBackedBeanRegistry
listener
- the listenerpublic void register(PropertyBackedBean bean)
PropertyBackedBeanRegistry
PropertyBackedBean
has been initialized.register
in interface PropertyBackedBeanRegistry
bean
- the beanpublic void deregister(PropertyBackedBean bean, boolean isPermanent)
PropertyBackedBeanRegistry
PropertyBackedBeanUnregisteredEvent
event.deregister
in interface PropertyBackedBeanRegistry
bean
- the beanisPermanent
- is the component being destroyed forever, i.e. should persisted values be removed? On server shutdown,
this value would be false
, whereas on the removal of a dynamically created instance, this
value would be true
.public void broadcastStart(PropertyBackedBean bean)
PropertyBackedBeanRegistry
PropertyBackedBean
has been started.broadcastStart
in interface PropertyBackedBeanRegistry
bean
- the beanpublic void broadcastStop(PropertyBackedBean bean)
PropertyBackedBeanRegistry
PropertyBackedBean
has been stopped.broadcastStop
in interface PropertyBackedBeanRegistry
bean
- the beanpublic void broadcastSetProperty(PropertyBackedBean bean, String name, String value)
PropertyBackedBeanRegistry
PropertyBackedBean
has been asked to
update a property.broadcastSetProperty
in interface PropertyBackedBeanRegistry
bean
- the beanname
- the namevalue
- the valuepublic void broadcastSetProperties(PropertyBackedBean bean, Map<String,String> properties)
PropertyBackedBeanRegistry
PropertyBackedBean
has been asked to
update properties.broadcastSetProperties
in interface PropertyBackedBeanRegistry
bean
- the beanpublic void broadcastRemoveProperties(PropertyBackedBean bean, Collection<String> properties)
PropertyBackedBeanRegistry
PropertyBackedBean
has been asked to
remove properties.broadcastRemoveProperties
in interface PropertyBackedBeanRegistry
bean
- the beanpublic void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener
public void beforeCommit(boolean readOnly)
TransactionListener
All transaction resources are still available.
beforeCommit
in interface org.alfresco.util.transaction.TransactionListener
readOnly
- true if the transaction is read-onlypublic void afterCommit()
TransactionListener
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.
afterCommit
in interface org.alfresco.util.transaction.TransactionListener
public void beforeCompletion()
TransactionListener
TransactionListener.beforeCommit(boolean)
even if TransactionListener.beforeCommit(boolean)
failed.
All transaction resources are still available.
beforeCompletion
in interface org.alfresco.util.transaction.TransactionListener
public void afterRollback()
TransactionListener
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.
afterRollback
in interface org.alfresco.util.transaction.TransactionListener
public void flush()
Copyright © 2005–2017 Alfresco Software. All rights reserved.