KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * MessageService: The message service daemon
3  * Copyright (C) 2007 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  * MessageManager.java
20  */

21
22 // package path
23
package com.rift.coad.daemon.messageservice;
24
25 // java imports
26
import java.util.Date JavaDoc;
27 import javax.transaction.xa.XAResource JavaDoc;
28
29 /**
30  * This interface defines the methods responsible for managing a message within
31  * the the message service.
32  *
33  * @author Brett Chaldecott
34  */

35 public interface MessageManager extends Comparable JavaDoc,XAResource JavaDoc {
36     /**
37      * This method returns the id of this messsage.
38      *
39      * @return The id of the message this object is managing.
40      */

41     public String JavaDoc getID();
42     
43     
44     /**
45      * This method returns the message object.
46      *
47      * @return The message object.
48      * @exception MessageServiceException
49      */

50     public Message getMessage() throws MessageServiceException;
51     
52     
53     /**
54      * This method updates the message object.
55      *
56      * @param updatedMessage The updated message object.
57      * @exception MessageServiceException
58      */

59     public void updateMessage(Message updatedMessage) throws
60             MessageServiceException;
61     
62     
63     /**
64      * This method returns the next process time for this message.
65      *
66      * @return The date message.
67      * @exception MessageServiceException
68      */

69     public Date JavaDoc nextProcessTime();
70     
71     
72     /**
73      * This method returns the name of the messaqe queue to which this message
74      * is assigned.
75      *
76      * @return The name of the message queue that this message is assigned to.
77      */

78     public String JavaDoc getMessageQueueName();
79     
80     
81     /**
82      * This method is responsible from removing this message from the db.
83      *
84      * @exception MessageServiceException
85      */

86     public void remove() throws MessageServiceException;
87     
88 }
89
Popular Tags