Jumpi v1.2.0

org.jumpi.impl.application
Class EchoApplicationImpl

java.lang.Object
  |
  +--org.jumpi.impl.application.EchoApplicationImpl
All Implemented Interfaces:
Application, java.lang.Runnable

public class EchoApplicationImpl
extends java.lang.Object
implements Application

A JMS Replyer-like Jumpi client application which echoes each received message back to the sender. The Application instantiates a single Jumpi instance and uses this continuously to service incoming requests. The Application runs indefinitely, and is intended to be run by a Daemon Thread. The Appliction is configured to receive messages on a single JMS Queue with property 'echoapplication.jms.queue'.


Field Summary
static java.lang.String PROPERTY_JMS_QUEUE
          The queue to use for receiving echo requests.
 
Constructor Summary
EchoApplicationImpl()
           
 
Method Summary
 void doWork(Jumpi j)
          Run the application code.
 void run()
          Instantiate a Jumpi instance which to use for receiving requests and sending the response.
 void setConfiguration(java.util.Hashtable config)
          Set the Jumpi instance and application configuration values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_JMS_QUEUE

public static final java.lang.String PROPERTY_JMS_QUEUE
The queue to use for receiving echo requests. Value: echoapplication.jms.queue.

See Also:
Constant Field Values
Constructor Detail

EchoApplicationImpl

public EchoApplicationImpl()
Method Detail

setConfiguration

public void setConfiguration(java.util.Hashtable config)
Set the Jumpi instance and application configuration values.

Specified by:
setConfiguration in interface Application
Parameters:
config - the configuration Hashtable.

run

public void run()
Instantiate a Jumpi instance which to use for receiving requests and sending the response. Continuously receive requests and send the received request as a response unchanged.

Specified by:
run in interface java.lang.Runnable
Throws:
java.lang.IllegalStateException - if configuration is missing.
java.lang.IllegalArgumentException - if configuration values are missing.

doWork

public void doWork(Jumpi j)
            throws java.lang.Exception
Run the application code.

Parameters:
j - the started, configured Jumpi instance to use.
Throws:
java.lang.Exception - if any failure condition occurs.
java.lang.IllegalArgumentException - if the configured receive Queue is invalid.

Jumpi v1.2.0

Copyright 2003, Peter Jonathan Klauser.