KickJava   Java API By Example, From Geeks To Geeks.

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


1 /**
2  * Dream
3  * Copyright (C) 2003-2004 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: dream@objectweb.org
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  * Attribute controller for queue implementation with a push input. It defines
31  * an overflow policy attribute with three default values (specific
32  * implementations can define other).
33  */

34 public interface PushQueueAttributeController extends AttributeController
35 {
36
37   /**
38    * An overflow policy that block incoming messages until a message is
39    * delivered on the output. <br>
40    * Warning when using this overflow policy a
41    * {@link org.objectweb.dream.InterruptedPushException}may be thrown.
42    */

43   String JavaDoc BLOCK_OVERFLOW_POLICY = "block";
44
45   /**
46    * An overflow policy that drops a message message from the queue when it is
47    * full.
48    */

49   String JavaDoc DROP_QUEUE_MESSAGE_OVERFLOW_POLICY = "drop-queue-message";
50
51   /**
52    * An overflow policy that drops the first message of the queue when it is
53    * full.
54    */

55   String JavaDoc DROP_FIRST_OVERFLOW_POLICY = "drop-first";
56
57   /**
58    * An overflow policy that drops the last message of the queue when it is
59    * full.
60    */

61   String JavaDoc DROP_LAST_OVERFLOW_POLICY = "drop-last";
62
63   /**
64    * An overflow policy that drops the current message when the queue is full:
65    * this means that the message will not be inserted into the queue.
66    */

67   String JavaDoc DROP_PROCESSED_MESSAGE_OVERFLOW_POLICY = "drop-processed-message";
68
69   /**
70    * An overflow policy that causes the <code>Push</code> server interface to
71    * throw a {@link BufferOverflowException}
72    */

73   String JavaDoc EXCEPTION_OVERFLOW_POLICY = "exception";
74
75   /**
76    * Returns the overflow policy.
77    *
78    * @return the overflow policy.
79    */

80   String JavaDoc getOverflowPolicy();
81
82   /**
83    * Sets the overflow policy.
84    *
85    * @param policy the overflow policy.
86    * @throws IllegalArgumentException if the given string is not reconized as a
87    * valid policy.
88    */

89   void setOverflowPolicy(String JavaDoc policy);
90
91 }
Popular Tags