KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > async > api > Sink


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.async.api;
5
6 import com.tc.stats.Monitorable;
7
8 import java.util.Collection JavaDoc;
9 import java.util.List JavaDoc;
10
11 /**
12  * @author steve
13  */

14 public interface Sink extends Monitorable {
15   /**
16    * The context may or may not be added to the sink depending on the state of the sink. The
17    * implementation can make the decision based on various factors.
18    *
19    * @param context
20    * @return
21    */

22   public boolean addLossy(EventContext context);
23
24   /**
25    * Add More than one context at a time. This is more efficient then adding one at a time
26    *
27    * @param contexts
28    */

29   public void addMany(Collection JavaDoc contexts);
30
31   /**
32    * Add a event to the Sink (no, really!)
33    *
34    * @param context
35    */

36   public void add(EventContext context);
37
38   /**
39    * The predicate allows the Sink to reject the EventContext rather than handle it
40    *
41    * @param predicate
42    */

43   public void setAddPredicate(AddPredicate predicate);
44
45   /**
46    * Get the predicate (I hate the useless javadocs)
47    *
48    * @return
49    */

50   public AddPredicate getPredicate();
51
52   /**
53    * returns the current size of the queue
54    *
55    * @return
56    */

57   public int size();
58   
59   public void clear();
60
61   public void pause(List JavaDoc pauseEvents);
62   
63   public void unpause();
64 }
Popular Tags