01: /*
02: * MessageQueueClient: The message queue client library
03: * Copyright (C) 2006 Rift IT Contracting
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
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;
27: import java.rmi.RemoteException;
28: import java.util.List;
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 {
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,
49: MessageServiceException;
50:
51: /**
52: * This method adds a service to the list of services used to identify this
53: * queue, by the service broker.
54: *
55: * @param service The string containing the service name.
56: * @exception RemoteException
57: * @exception MessageServiceException
58: */
59: public void addService(String service) throws RemoteException,
60: MessageServiceException;
61:
62: /**
63: * This method returns a list of services used to identify this queue to the
64: * service broker.
65: *
66: * @return The list of service used to identify this queue to the service
67: * broker.
68: * @exception RemoteException
69: * @exception MessageServiceException
70: */
71: public List listServices() throws RemoteException,
72: MessageServiceException;
73:
74: /**
75: * This method removes a service from the list of services.
76: *
77: * @param service The name of the service to remove.
78: * @exception RemoteException
79: * @exception MessageServiceException
80: */
81: public void removeService(String service) throws RemoteException,
82: MessageServiceException;
83: }
|