Package de.hybris.platform.tx
Class DefaultAfterSaveListenerRegistry
- java.lang.Object
-
- de.hybris.platform.tx.DefaultAfterSaveListenerRegistry
-
- All Implemented Interfaces:
AfterSaveListenerRegistry,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean
public class DefaultAfterSaveListenerRegistry extends java.lang.Object implements AfterSaveListenerRegistry, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
Default implementation forAfterSaveListenerRegistry- Since:
- 5.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCORE_AFTERSAVE_ASYNCstatic java.lang.StringCORE_AFTERSAVE_BATCHSIZEstatic java.lang.StringCORE_AFTERSAVE_INTERVALstatic java.lang.StringCORE_AFTERSAVE_QUEUESIZE
-
Constructor Summary
Constructors Constructor Description DefaultAfterSaveListenerRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(AfterSaveListener afterSaveListener)voidafterPropertiesSet()voiddestroy()protected voiddoNotifyListeners(java.util.Collection<AfterSaveEvent> events, java.util.Collection<AfterSaveListener> listeners)Notifies all registered listeners with the AfterSaveEvents.protected voidenqueueChangesForAsyncNotification(byte[][] changes)protected intgetBatchSizeParam()protected intgetQueueSizeParam()protected longgetSleepTimeParam()protected voidinitPublisherThread()protected booleanisAsyncParam()protected booleanisPublishAsynchronously()protected voidnotifyListenersSynchronously(java.util.Collection<AfterSaveEvent> events)voidpublishChanges(byte[][] encodedChanges)Publishes a set of encoded changes.voidremoveListener(AfterSaveListener afterSaveListener)voidsetListeners(java.util.List<AfterSaveListener> listeners)
-
-
-
Field Detail
-
CORE_AFTERSAVE_INTERVAL
public static final java.lang.String CORE_AFTERSAVE_INTERVAL
- See Also:
- Constant Field Values
-
CORE_AFTERSAVE_BATCHSIZE
public static final java.lang.String CORE_AFTERSAVE_BATCHSIZE
- See Also:
- Constant Field Values
-
CORE_AFTERSAVE_QUEUESIZE
public static final java.lang.String CORE_AFTERSAVE_QUEUESIZE
- See Also:
- Constant Field Values
-
CORE_AFTERSAVE_ASYNC
public static final java.lang.String CORE_AFTERSAVE_ASYNC
- See Also:
- Constant Field Values
-
-
Method Detail
-
setListeners
public void setListeners(java.util.List<AfterSaveListener> listeners)
-
publishChanges
public void publishChanges(byte[][] encodedChanges)
Description copied from interface:AfterSaveListenerRegistryPublishes a set of encoded changes.- Specified by:
publishChangesin interfaceAfterSaveListenerRegistry- Parameters:
encodedChanges- an array which consists of byte arrays with a fixed length of 9- See Also:
AfterSaveEventUtils.encodeChanges(de.hybris.platform.core.PK, int)
-
enqueueChangesForAsyncNotification
protected void enqueueChangesForAsyncNotification(byte[][] changes)
-
notifyListenersSynchronously
protected void notifyListenersSynchronously(java.util.Collection<AfterSaveEvent> events)
-
addListener
public void addListener(AfterSaveListener afterSaveListener)
-
removeListener
public void removeListener(AfterSaveListener afterSaveListener)
-
destroy
public void destroy() throws java.lang.Exception- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Throws:
java.lang.Exception
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
initPublisherThread
protected void initPublisherThread()
-
getBatchSizeParam
protected int getBatchSizeParam()
-
getSleepTimeParam
protected long getSleepTimeParam()
-
getQueueSizeParam
protected int getQueueSizeParam()
-
isAsyncParam
protected boolean isAsyncParam()
-
doNotifyListeners
protected void doNotifyListeners(java.util.Collection<AfterSaveEvent> events, java.util.Collection<AfterSaveListener> listeners)
Notifies all registered listeners with the AfterSaveEvents.
-
isPublishAsynchronously
protected boolean isPublishAsynchronously()
-
-