ehsbe CommonsTM
Version 1.1.0rc3

com.ehsbe.commons.server.jms
Class MsgProducer

java.lang.Object
  extended by com.ehsbe.commons.server.jms.MsgProducer

public class MsgProducer
extends Object

A message producer, which uses cached producer instances to send messages. Avoids the overhead of setting/looking up up connections, sessions and producers. Sessions are NOT used with Transactions, and are auto acknowledged.

Version:
$Revision: 432 $
Author:
Jens Elkner

Nested Class Summary
static class MsgProducer.QueueParams
          Simple container for recording queue parameters.
 
Constructor Summary
MsgProducer()
           
 
Method Summary
protected static long getNextId(String destination)
          Get the next messageID for the given destination
static void send(String destination, ClientInfoEvent event, boolean transacted)
          Sends the client info event to the given topic.
static void send(String destination, CrudEvent<?> event)
          Convinience method for sending a CRUD message to the given destination.
static void send(String destination, CrudEventList list)
          Send a message to the given destination.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MsgProducer

public MsgProducer()
Method Detail

getNextId

protected static long getNextId(String destination)
Get the next messageID for the given destination

Parameters:
destination - topic
Returns:
always a sequenced value incremented by 1 for the given topic

send

public static void send(String destination,
                        CrudEvent<?> event)
Convinience method for sending a CRUD message to the given destination.

Parameters:
destination - name of the queue/topic - e.g. "topic/foo" or "queue/bar".
event - event to send

send

public static void send(String destination,
                        CrudEventList list)
Send a message to the given destination.

Parameters:
destination - name of the queue/topic - e.g. "topic/foo" or "queue/bar".
list - list of CRUD events

send

public static void send(String destination,
                        ClientInfoEvent event,
                        boolean transacted)
Sends the client info event to the given topic.

Parameters:
destination - name of the queue/topic - e.g. "topic/foo" or "queue/bar".
event - event to send.
transacted - whether to send via transacted session

ehsbe CommonsTM
Version 1.1.0rc3

Copyright ©2005-2009 EHSBE, Walther-Rathenau-Str. 58, 39104 Magdeburg, Sachsen-Anhalt, Germany. All Rights Reserved.