public class MessageGroupStoreReaper extends Object implements Runnable, DisposableBean, InitializingBean, SmartLifecycle
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.DEFAULT_PHASE
Constructor and Description |
---|
MessageGroupStoreReaper() |
MessageGroupStoreReaper(MessageGroupStore messageGroupStore) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
destroy() |
int |
getPhase() |
boolean |
isAutoStartup() |
boolean |
isRunning() |
void |
run()
Expire all message groups older than the
timeout 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() |
void |
stop(Runnable callback) |
public MessageGroupStoreReaper(MessageGroupStore messageGroupStore)
public MessageGroupStoreReaper()
public void setExpireOnDestroy(boolean expireOnDestroy)
ApplicationContext
is closed).expireOnDestroy
- the flag value to setpublic void setTimeout(long timeout)
run()
.timeout
- the timeout to setpublic void setMessageGroupStore(MessageGroupStore messageGroupStore)
messageGroupStore
- the MessageGroupStore
to setpublic void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
public void destroy()
destroy
in interface DisposableBean
public void run()
timeout
provided. Normally this method would
be executed by a scheduled task.public int getPhase()
getPhase
in interface Phased
getPhase
in interface SmartLifecycle
public void setPhase(int phase)
public boolean isAutoStartup()
isAutoStartup
in interface SmartLifecycle
public void setAutoStartup(boolean autoStartup)
public void stop(Runnable callback)
stop
in interface SmartLifecycle