org.sharengo.wikitty.jms
Class WikittyStorageSubscriberJMS
java.lang.Object
org.sharengo.wikitty.jms.WikittyStorageSubscriberJMS
- All Implemented Interfaces:
- javax.jms.MessageListener
public class WikittyStorageSubscriberJMS
- extends Object
- implements javax.jms.MessageListener
WikittyStorageSubscriberJMS.
- Since:
- 11 févr. 2010 11:07:30
- Version:
- $Revision: 1 $ $Date: 2010-04-16 10:29:38 +0200 (ven., 16 avril 2010) $
- Author:
- $Author: echatellier $
connectionFactory
protected final javax.jms.TopicConnectionFactory connectionFactory
topicConnection
protected final javax.jms.TopicConnection topicConnection
topic
protected final javax.jms.Topic topic
topicSession
protected final javax.jms.TopicSession topicSession
topicSubscriber
protected final javax.jms.TopicSubscriber topicSubscriber
delegateStorage
protected final WikittyStorage delegateStorage
WikittyStorageSubscriberJMS
public WikittyStorageSubscriberJMS(WikittyStorage delegateStorage,
Properties properties)
throws NamingException,
javax.jms.JMSException
- Creates a durable subscriber on a topic named
WikittyStorageTopic.
All received messages are dispatched to the specified delegateStorage.
- Parameters:
delegateStorage - an instance of WikittyStorageproperties - properties passed to InitialContext,
it must contains at least a value for the Context.PROVIDER_URL
- Throws:
NamingException
javax.jms.JMSException
start
public void start()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
stop
public void stop()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
close
public void close()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
finalize
protected void finalize()
throws Throwable
- Overrides:
finalize in class Object
- Throws:
Throwable
onMessage
public void onMessage(javax.jms.Message message)
- Forwards the message to the
delegateStorage according
to its type (TextMessage or ObjectMessage) and its client properties.
More precisely, the action client property determines the delegateStorage's method
which will be invoked.
- Specified by:
onMessage in interface javax.jms.MessageListener
- Parameters:
message - the incoming message
onActionMessage
protected void onActionMessage(WikittyTransaction transaction,
WikittyActionMessage message)
actionStore
protected void actionStore(WikittyTransaction transaction,
WikittyActionMessage message)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
actionClear
protected void actionClear(WikittyTransaction transaction,
WikittyActionMessage message)
actionDelete
protected void actionDelete(WikittyTransaction transaction,
WikittyActionMessage message)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
Copyright © 2010 CodeLutin. All Rights Reserved.