Class MessageGroupStoreReaper
java.lang.Object
org.springframework.integration.store.MessageGroupStoreReaper
- All Implemented Interfaces:
java.lang.Runnable
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.Lifecycle
,org.springframework.context.Phased
,org.springframework.context.SmartLifecycle
public class MessageGroupStoreReaper
extends java.lang.Object
implements java.lang.Runnable, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.SmartLifecycle
Convenient configurable component to allow explicit timed expiry of
MessageGroup
instances in a
MessageGroupStore
. This component provides a no-args run()
method that is useful for remote or timed
execution and a destroy()
method that can optionally be called on shutdown.-
Field Summary
-
Constructor Summary
Constructors Constructor Description MessageGroupStoreReaper()
MessageGroupStoreReaper(MessageGroupStore messageGroupStore)
-
Method Summary
Modifier and Type Method Description void
afterPropertiesSet()
void
destroy()
int
getPhase()
boolean
isAutoStartup()
boolean
isRunning()
void
run()
Expire all message groups older than thetimeout
provided.void
setAutoStartup(boolean autoStartup)
void
setExpireOnDestroy(boolean expireOnDestroy)
Flag to indicate that the stores should be expired when this component is destroyed (i.e.void
setMessageGroupStore(MessageGroupStore messageGroupStore)
A message group store to expire according the other configurations.void
setPhase(int phase)
void
setTimeout(long timeout)
Timeout in milliseconds (default -1).void
start()
void
stop()
-
Constructor Details
-
MessageGroupStoreReaper
-
MessageGroupStoreReaper
public MessageGroupStoreReaper()
-
-
Method Details
-
setExpireOnDestroy
public void setExpireOnDestroy(boolean expireOnDestroy)Flag to indicate that the stores should be expired when this component is destroyed (i.e. usually when its enclosingApplicationContext
is closed).- Parameters:
expireOnDestroy
- the flag value to set
-
setTimeout
public void setTimeout(long timeout)Timeout in milliseconds (default -1). If negative then no groups ever time out. If greater than zero then all groups older than that value are expired when this component isrun()
.- Parameters:
timeout
- the timeout to set
-
setMessageGroupStore
A message group store to expire according the other configurations.- Parameters:
messageGroupStore
- theMessageGroupStore
to set
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
destroy
public void destroy()- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
-
run
public void run()Expire all message groups older than thetimeout
provided. Normally this method would be executed by a scheduled task.- Specified by:
run
in interfacejava.lang.Runnable
-
start
public final void start()- Specified by:
start
in interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()- Specified by:
stop
in interfaceorg.springframework.context.Lifecycle
-
isRunning
public final boolean isRunning()- Specified by:
isRunning
in interfaceorg.springframework.context.Lifecycle
-
getPhase
public int getPhase()- Specified by:
getPhase
in interfaceorg.springframework.context.Phased
- Specified by:
getPhase
in interfaceorg.springframework.context.SmartLifecycle
-
setPhase
public void setPhase(int phase) -
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartup
in interfaceorg.springframework.context.SmartLifecycle
-
setAutoStartup
public void setAutoStartup(boolean autoStartup)
-