ADK CVS

tryllian.afc.task.jms
Class SubscribeJMSTopicTask

java.lang.Object
  extended bytryllian.afc.task.AbstractTask
      extended bytryllian.afc.task.DefaultTask
          extended bytryllian.afc.task.jms.JMSTask
              extended bytryllian.afc.task.jms.TopicTask
                  extended bytryllian.afc.task.jms.SubscribeJMSTopicTask
All Implemented Interfaces:
java.util.EventListener, MessageHandler, javax.jms.MessageListener, java.io.Serializable, Task

public abstract class SubscribeJMSTopicTask
extends TopicTask
implements javax.jms.MessageListener

This task subscribes to the JMS topic. When a topic is received the abstract method handleJMSMessage is invoked.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class tryllian.afc.task.AbstractTask
NL
 
Fields inherited from interface tryllian.afc.task.Task
EMPTY_FINISH_VALUE, FORCED_FINISH_FAILURE, NO_TIME_OUT, TASK_TIMED_OUT
 
Constructor Summary
SubscribeJMSTopicTask()
          Creates a new SubscribeJMSTopicTask using the default settings.
SubscribeJMSTopicTask(java.lang.String jndiFactory, java.lang.String urlProvider, java.lang.String jmsFactory, java.lang.String topic)
          Create a SubscribeJMSTopicTask using the specified JMS parameters.
 
Method Summary
 void handleHeartbeat()
          Override this method to define proactive behavior.
abstract  void handleJMSMessage(javax.jms.Message message)
          Implement this method to receive the JMS messages for your agent.
 void onMessage(javax.jms.Message message)
          MessageListener interface callback
 void taskEnded()
          Closes the subscriber.
 void taskStarted()
          Listens to topics.
 
Methods inherited from class tryllian.afc.task.jms.TopicTask
getConnection, getSession, getTopic
 
Methods inherited from class tryllian.afc.task.jms.JMSTask
getConnectionFactory, getJMSDestination, getJNDIFactory, getURLProvider, setConnectionFactory, setJMSDestination, setJNDIFactory, setURLProvider
 
Methods inherited from class tryllian.afc.task.DefaultTask
addFinishingTask, addTask, getSubtasks, propagateHeartbeat
 
Methods inherited from class tryllian.afc.task.AbstractTask
addTaskListener, fail, fail, finish, finish, finish, forceFinish, forceFinish, getAgentContext, getFinishValue, getState, getSupertask, getTimeOut, handleMessage, heartbeatReceived, logException, messageReceived, removeTaskListener, setAgentContext, setFinishValue, setTimeOut, succeed, succeed, taskAdded, taskRemoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubscribeJMSTopicTask

public SubscribeJMSTopicTask()
Creates a new SubscribeJMSTopicTask using the default settings.


SubscribeJMSTopicTask

public SubscribeJMSTopicTask(java.lang.String jndiFactory,
                             java.lang.String urlProvider,
                             java.lang.String jmsFactory,
                             java.lang.String topic)
Create a SubscribeJMSTopicTask using the specified JMS parameters.

Parameters:
jndiFactory - JNDI factory name.
urlProvider - the provider URL of the JMS system.
jmsFactory - JMS factory name.
topic - name of the JMS topic.
Method Detail

taskStarted

public void taskStarted()
Listens to topics.

Overrides:
taskStarted in class TopicTask

taskEnded

public void taskEnded()
Closes the subscriber.

Overrides:
taskEnded in class TopicTask

onMessage

public void onMessage(javax.jms.Message message)
MessageListener interface callback

Specified by:
onMessage in interface javax.jms.MessageListener
Parameters:
message - The message we are sending to this subscriber.

handleHeartbeat

public void handleHeartbeat()
Description copied from class: DefaultTask
Override this method to define proactive behavior. This implementation is empty, so you can override it without calling super.handleHeartbeat().

Overrides:
handleHeartbeat in class DefaultTask

handleJMSMessage

public abstract void handleJMSMessage(javax.jms.Message message)
Implement this method to receive the JMS messages for your agent.

Parameters:
message - the message received from the JMS Topic.

Copyright 2005, Tryllian Solutions B.V.