org.codehaus.activemq.service.impl
Class InitialImageMessageContainerManager

java.lang.Object
  extended byorg.codehaus.activemq.service.impl.ProxyMessageContainerManager
      extended byorg.codehaus.activemq.service.impl.InitialImageMessageContainerManager
All Implemented Interfaces:
MessageContainerManager, Service

public class InitialImageMessageContainerManager
extends ProxyMessageContainerManager

Implements an initial image service where on subscription the client will recieve the last image that was previously cached. This is very useful in financial market data and in rapidly changing transient event models where you don't want to persist messages when you are away, but wish to cache the last image, per destination around so that when a new reliable consumer subscribes you receive the latest value you may have missed.

This is especially true in finance with slow moving markets where you may have to wait a while for an update (or times when you subscribe after market close etc).

Version:
$Revision: 1.2 $

Constructor Summary
InitialImageMessageContainerManager(MessageContainerManager delegate, Map cache, boolean topic, DestinationFilter destinationFilter)
           
InitialImageMessageContainerManager(MessageContainerManager delegate, Map cache, DestinationFilter destinationFilter)
          Creates a topic based initial image message container manager using the given destination filter
 
Method Summary
 void addMessageConsumer(BrokerClient client, ConsumerInfo info)
           
protected  boolean isValid(ActiveMQDestination destination)
          Does this message match the destinations on which initial image caching should be used
protected  void sendMatchingInitialImages(BrokerClient client, ConsumerInfo info, DestinationFilter filter)
           
 void sendMessage(BrokerClient client, ActiveMQMessage message)
           
 
Methods inherited from class org.codehaus.activemq.service.impl.ProxyMessageContainerManager
acknowledgeMessage, acknowledgeTransactedMessage, commitTransaction, createMessageContainer, deleteSubscription, destroyMessageContainer, getContainer, getDeadLetterPolicy, getDelegate, getDestinations, getMessageContainerAdmins, poll, redeliverMessage, removeMessageConsumer, rollbackTransaction, setDeadLetterPolicy, setDelegate, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InitialImageMessageContainerManager

public InitialImageMessageContainerManager(MessageContainerManager delegate,
                                           Map cache,
                                           DestinationFilter destinationFilter)
Creates a topic based initial image message container manager using the given destination filter

Parameters:
delegate -
cache -
destinationFilter -

InitialImageMessageContainerManager

public InitialImageMessageContainerManager(MessageContainerManager delegate,
                                           Map cache,
                                           boolean topic,
                                           DestinationFilter destinationFilter)
Method Detail

addMessageConsumer

public void addMessageConsumer(BrokerClient client,
                               ConsumerInfo info)
                        throws JMSException
Specified by:
addMessageConsumer in interface MessageContainerManager
Overrides:
addMessageConsumer in class ProxyMessageContainerManager
Throws:
JMSException

sendMessage

public void sendMessage(BrokerClient client,
                        ActiveMQMessage message)
                 throws JMSException
Specified by:
sendMessage in interface MessageContainerManager
Overrides:
sendMessage in class ProxyMessageContainerManager
Throws:
JMSException

sendMatchingInitialImages

protected void sendMatchingInitialImages(BrokerClient client,
                                         ConsumerInfo info,
                                         DestinationFilter filter)
                                  throws JMSException
Throws:
JMSException

isValid

protected boolean isValid(ActiveMQDestination destination)
Does this message match the destinations on which initial image caching should be used

Parameters:
destination -
Returns:
true if the given destination should use initial image caching which is typically true if the message is a topic which may match an optional DestinationFilter


Copyright © 2004-2005 Protique, Ltd.. All Rights Reserved.