org.sharengo.wikitty.jms
Class WikittyExtensionSubscriberJMS

java.lang.Object
  extended by org.sharengo.wikitty.jms.WikittyExtensionSubscriberJMS
All Implemented Interfaces:
javax.jms.MessageListener

public class WikittyExtensionSubscriberJMS
extends Object
implements javax.jms.MessageListener

WikittyExtensionSubscriberJMS.

Since:
11 févr. 2010 17:58:34
Version:
$Revision: 1 $ $Date: 2010-04-16 10:29:38 +0200 (ven., 16 avril 2010) $
Author:
$Author: echatellier $

Field Summary
protected  javax.jms.TopicConnectionFactory connectionFactory
           
protected  WikittyExtensionStorage delegateExtensionStorage
           
protected  javax.jms.Topic topic
           
protected  javax.jms.TopicConnection topicConnection
           
protected  javax.jms.TopicSession topicSession
           
protected  javax.jms.TopicSubscriber topicSubscriber
           
 
Constructor Summary
WikittyExtensionSubscriberJMS(WikittyExtensionStorage delegateExtensionStorage, Properties properties)
          Creates a durable subscriber on a topic named WikittyExtensionStorageTopic.
 
Method Summary
protected  void actionClear(WikittyTransaction transaction, WikittyActionMessage message)
           
protected  void actionStore(WikittyTransaction transaction, WikittyActionMessage message)
           
 void close()
           
protected  void finalize()
           
protected  void onActionMessage(WikittyTransaction transaction, WikittyActionMessage message)
           
 void onMessage(javax.jms.Message message)
          Forwards the message to the delegateExtensionStorage according to its type (TextMessage or ObjectMessage) and its client properties.
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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

delegateExtensionStorage

protected final WikittyExtensionStorage delegateExtensionStorage
Constructor Detail

WikittyExtensionSubscriberJMS

public WikittyExtensionSubscriberJMS(WikittyExtensionStorage delegateExtensionStorage,
                                     Properties properties)
                              throws NamingException,
                                     javax.jms.JMSException
Creates a durable subscriber on a topic named WikittyExtensionStorageTopic. All received messages are dispatched to the specified delegateExtensionStorage.

Parameters:
delegateExtensionStorage - an instance of WikittyExtensionStorage
properties - properties passed to InitialContext, it must contains at least a value for the Context.PROVIDER_URL
Throws:
NamingException
javax.jms.JMSException
Method Detail

start

public void start()
           throws Exception
Throws:
Exception

stop

public void stop()
          throws Exception
Throws:
Exception

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 delegateExtensionStorage according to its type (TextMessage or ObjectMessage) and its client properties. More precisely, the action client property determines the delegateExtensionStorage'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)


Copyright © 2010 CodeLutin. All Rights Reserved.