KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ubermq > jms > client > IDeliveryManager


1 package com.ubermq.jms.client;
2
3 import javax.jms.*;
4
5 /**
6  * An interface that can be plugged into the TopicSubscriber
7  * to provide resequencing, gap detection, and other delivery time
8  * optimizations and reorderings. Typically the delivery manager
9  * maintains state about what messages have been delivered and
10  * tailors the delivery stream to take that information into account.
11  */

12 public interface IDeliveryManager
13 {
14     /**
15      * Requests delivery of the message at some time in the future.
16      * At this point, the caller can forget about the message and
17      * assume the message sender specified may be called back
18      * at some future time, or before the call returns.
19      * It is up to the implementation whether
20      * the object will be called back at all.
21      * <P>
22      * @param senderId the ID of the sender of the message
23      * @param sequence the sequence number of the message
24      * @param msg the actual message itself
25      * @param s an instance of IMessageSender to do the actual sending
26      * when the delivery manager determines it is appropriate to do so. The
27      */

28     public void deliver(long senderId,
29                         long sequence,
30                         Message msg,
31                         IMessageSender s);
32     
33     /**
34      * Creates a new instance of a delivery manager with empty or derived state
35      * for a new spawned connection. Typically the new state will be empty,
36      * but it is theoretically possible to create a delivery manager that
37      * shares state across connection instances.
38      */

39     public IDeliveryManager newInstance();
40 }
41
Popular Tags