KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > dream > queue > PushPullKeyQueueAttributeController


1 /**
2  * Dream
3  * Copyright (C) 2003 INRIA Rhone-Alpes
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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Contact: matthieu.leclercq@inrialpes.fr
20  *
21  * Initial developer(s): Matthieu Leclercq
22  * Contributor(s): Vivien Quema
23  */

24
25 package org.objectweb.dream.queue;
26
27 import org.objectweb.fractal.api.control.AttributeController;
28
29 /**
30  * Key based Push/Pull queue attribute controller. It defines a policy applied
31  * when the requested message cannot be found. Two default policies are provided
32  * (specific implementations can define other).
33  */

34 public interface PushPullKeyQueueAttributeController
35     extends
36       AttributeController
37 {
38
39   /**
40    * "Message not found" policy that returns <code>null</code> as result of
41    * the pull method.
42    */

43   String JavaDoc RETURN_NULL_MESSAGE_NOT_FOUND_POLICY = "return-null";
44
45   /**
46    * "Message not found" policy that throw a {@link KeyNotFoundException }
47    * exception.
48    */

49   String JavaDoc EXCEPTION_MESSAGE_NOT_FOUND_POLICY = "exception";
50
51   /**
52    * Returns the policy applied when a message cannot be found.
53    *
54    * @return the policy applied when a message cannot be found.
55    */

56   String JavaDoc getMessageNotFoundPolicy();
57
58   /**
59    * Sets the policy applied when a message cannot be found.
60    *
61    * @param policy the policy applied when a message cannot be found.
62    */

63   void setMessageNotFoundPolicy(String JavaDoc policy);
64
65   /**
66    * Returns the name of the chunk to be used as a key of the message.
67    *
68    * @return the name of the chunk to be used as a key of the message.
69    */

70   String JavaDoc getKeyChunkName();
71
72   /**
73    * Sets the name of the chunk to be used as a key of the message.
74    *
75    * @param name the name of the chunk to be used as a key of the message.
76    */

77   void setKeyChunkName(String JavaDoc name);
78
79 }
Popular Tags