01: /*
02: * Copyright (c) 2001 by Matt Welsh and The Regents of the University of
03: * California. All rights reserved.
04: *
05: * Permission to use, copy, modify, and distribute this software and its
06: * documentation for any purpose, without fee, and without written agreement is
07: * hereby granted, provided that the above copyright notice and the following
08: * two paragraphs appear in all copies of this software.
09: *
10: * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
11: * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
12: * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
13: * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14: *
15: * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
16: * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
17: * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
18: * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
19: * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
20: *
21: * Author: Matt Welsh <mdw@cs.berkeley.edu>
22: *
23: */
24:
25: package seda.sandStorm.api;
26:
27: /**
28: * This event indicates that a sink was clogged when trying to process
29: * the given element. A sink is considered clogged if it is full (that is,
30: * its length threshold has been reached), or some other condition is
31: * preventing the given element from being serviced.
32: *
33: * <p>As opposed to SinkFullException, which is thrown immediately
34: * if attempting to enqueue onto a full sink, SinkCloggedEvent is
35: * pushed to an application if a sink becomes full asynchronously,
36: * or if some other condition caused the sink to become clogged.
37: *
38: * @see SinkFullException
39: * @author Matt Welsh
40: */
41: public class SinkCloggedEvent implements QueueElementIF {
42:
43: /**
44: * The sink which clogged.
45: */
46: public SinkIF sink;
47:
48: /**
49: * The element which clogged.
50: */
51: public QueueElementIF element;
52:
53: /**
54: * Create a new SinkCloggedEvent with the given sink and element.
55: */
56: public SinkCloggedEvent(SinkIF sink, QueueElementIF element) {
57: this.sink = sink;
58: this.element = element;
59: }
60: }
|