Spring Integration

org.springframework.integration.store
Class MessageGroupStoreReaper

java.lang.Object
  extended by org.springframework.integration.store.MessageGroupStoreReaper
All Implemented Interfaces:
Runnable, DisposableBean, InitializingBean

public class MessageGroupStoreReaper
extends Object
implements Runnable, DisposableBean, InitializingBean

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.

Author:
Dave Syer

Constructor Summary
MessageGroupStoreReaper()
           
MessageGroupStoreReaper(MessageGroupStore messageGroupStore)
           
 
Method Summary
 void afterPropertiesSet()
           
 void destroy()
           
 void run()
          Expire all message groups older than the timeout provided.
 void setExpireOnDestroy(boolean expireOnDestroy)
          Flag to indicate that the stores should be expired when this component is destroyed (i.e. usuually when its enclosing ApplicationContext is closed).
 void setMessageGroupStore(MessageGroupStore messageGroupStore)
          A message group store to expire according the the other configurations.
 void setTimeout(long timeout)
          Timeout in milliseconds (default -1).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageGroupStoreReaper

public MessageGroupStoreReaper(MessageGroupStore messageGroupStore)

MessageGroupStoreReaper

public MessageGroupStoreReaper()
Method Detail

setExpireOnDestroy

public void setExpireOnDestroy(boolean expireOnDestroy)
Flag to indicate that the stores should be expired when this component is destroyed (i.e. usuually when its enclosing ApplicationContext 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 is run().

Parameters:
timeout - the timeout to set

setMessageGroupStore

public void setMessageGroupStore(MessageGroupStore messageGroupStore)
A message group store to expire according the the other configurations.

Parameters:
messageGroupStore - the MessageGroupStore to set

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

destroy

public void destroy()
             throws Exception
Specified by:
destroy in interface DisposableBean
Throws:
Exception

run

public void run()
Expire all message groups older than the timeout provided. Normally this method would be executed by a scheduled task.

Specified by:
run in interface Runnable

Spring Integration

Copyright © 2010. All Rights Reserved.