KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.ubermq.jms.client;
2
3 import com.ubermq.jms.common.datagram.*;
4 import com.ubermq.kernel.*;
5 import java.io.*;
6
7 /**
8  * Extensions to the standard datagram message processor to provide
9  * subscription management and other things that client-side connection
10  * handlers need to support.
11  */

12 public interface IClientProcessor
13     extends com.ubermq.kernel.IMessageProcessor
14 {
15     /**
16      * Registers a subscription in the same process. Specifies an object
17      * as a endpoint for delivery of datagrams.
18      * @param spec the subscription specification
19      * @param selector a message selector, or null for none.
20      * @param e the endpoint for delivery of datagrams that are relevant.
21      */

22     public void registerSubscription(String JavaDoc spec,
23                                      String JavaDoc selector,
24                                      IDatagramEndpoint e);
25
26     /**
27      * Registers a durable subscription . Specifies an object
28      * as a endpoint for delivery of datagrams.
29      * @param spec the subscription specification
30      * @param name the durable's name, passed on to the server.
31      * @param selector a message selector, or null for none.
32      * @param e the endpoint for delivery of datagrams that are relevant.
33      */

34     public void registerDurableSubscription(String JavaDoc spec,
35                                             String JavaDoc name,
36                                             String JavaDoc selector,
37                                             IDatagramEndpoint e);
38
39     /**
40      * Unregisters a subscription that was previously registered.
41      */

42     public void unregisterSubscription(String JavaDoc spec,
43                                        IDatagramEndpoint e);
44
45     /**
46      * Unregisters a subscription that was previously registered.
47      */

48     public void unregisterDurableSubscription(String JavaDoc name);
49
50     /**
51      * Indicates that a durable subscription is going away. The server will
52      * stop sending messages on receipt of this call.
53      * @param the name of the durable subscriber.
54      */

55     public void durableGoingAway(String JavaDoc name);
56
57     /**
58      * Begins receiving messages from a queue, with the given selector,
59      * to the specified endpoint.
60      */

61     public void startQueue(String JavaDoc queue,
62                            String JavaDoc selector,
63                            IDatagramEndpoint e);
64
65     /**
66      * Stops a queue from sending messages to the endpoint.
67      */

68     public void stopQueue(String JavaDoc queue,
69                           IDatagramEndpoint e);
70
71     /**
72      * Executes a control sequence on the remote. This is a
73      * combination of an output datagram and a wait for a return ACK.
74      * The control sequence is also logged in the replay log in
75      * case of reconnection. <P>
76      *
77      * @param c a control datagram
78      * @param h an overflow handler
79      * @returns whether the command successfully completed.
80      */

81     public boolean controlSequence(IControlDatagram c,
82                                    IOverflowHandler h)
83         throws IOException;
84
85     /**
86      * Registers that a control flow needs an ack response on a
87      * given message ID before continuing.<P>
88      *
89      * @param msgId the message ID to wait for, or null to wait
90      * for an anonymous ack.
91      * @param e the endpoint to register.
92      */

93     public void registerNeedAck(MessageId msgId,
94                                 IDatagramEndpoint e);
95
96     /**
97      * Returns whether the client processor generally waits for ACK messages
98      * or not when sending message datagrams.
99      */

100     public boolean shouldWaitForAck();
101
102     /**
103      * Indicates that the connection has been reconnected. The client
104      * processor should restore any server-side state, as necessary.
105      */

106     public void reconnected();
107
108 }
109
Popular Tags