KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > rift > coad > daemon > messageservice > NamedQueue


1 /*
2  * MessageQueueClient: The message queue client library
3  * Copyright (C) 2006 Rift IT Contracting
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * Queue.java
20  */

21
22 // package path
23
package com.rift.coad.daemon.messageservice;
24
25 // java imports
26
import java.rmi.Remote JavaDoc;
27 import java.rmi.RemoteException JavaDoc;
28 import java.util.List JavaDoc;
29
30 /**
31  * This interface supplies access to a queue within the message service.
32  *
33  * @author Brett Chaldecott
34  */

35 public interface NamedQueue extends Remote JavaDoc {
36     
37     /**
38      * This method returns a message for processing. It is designed to auto
39      * acknowledge. This means that when the transaction is commited the message
40      * will be removed from the named queue.
41      *
42      * @return The reference to the Message for processing.
43      * @param delay The delay before returning a null reference.
44      * @exception RemoteException
45      * @exception MessageServiceException
46      * @exception TimeoutException
47      */

48     public Message receive(long delay) throws RemoteException JavaDoc,
49             MessageServiceException;
50     
51     
52     /**
53      * This method adds a service to the list of services used to identify this
54      * queue, by the service broker.
55      *
56      * @param service The string containing the service name.
57      * @exception RemoteException
58      * @exception MessageServiceException
59      */

60     public void addService(String JavaDoc service) throws RemoteException JavaDoc,
61             MessageServiceException;
62     
63     
64     /**
65      * This method returns a list of services used to identify this queue to the
66      * service broker.
67      *
68      * @return The list of service used to identify this queue to the service
69      * broker.
70      * @exception RemoteException
71      * @exception MessageServiceException
72      */

73     public List JavaDoc listServices() throws RemoteException JavaDoc, MessageServiceException;
74     
75     
76     /**
77      * This method removes a service from the list of services.
78      *
79      * @param service The name of the service to remove.
80      * @exception RemoteException
81      * @exception MessageServiceException
82      */

83     public void removeService(String JavaDoc service) throws RemoteException JavaDoc,
84             MessageServiceException;
85 }
86
Popular Tags