KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > async > impl > MockSink


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.impl;
5
6 import com.tc.async.api.AddPredicate;
7 import com.tc.async.api.EventContext;
8 import com.tc.async.api.Sink;
9 import com.tc.exception.ImplementMe;
10 import com.tc.stats.Stats;
11
12 import java.util.ArrayList JavaDoc;
13 import java.util.Collection JavaDoc;
14 import java.util.List JavaDoc;
15
16 /**
17  * @author orion
18  */

19 public class MockSink implements Sink {
20
21   public List JavaDoc queue = new ArrayList JavaDoc();
22
23   public boolean addLossy(EventContext context) {
24     queue.add(context);
25     return true;
26   }
27
28   public void addMany(Collection JavaDoc contexts) {
29     queue.addAll(contexts);
30   }
31
32   public void add(EventContext context) {
33     queue.add(context);
34   }
35
36   public void setAddPredicate(AddPredicate predicate) {
37     throw new ImplementMe();
38   }
39
40   public AddPredicate getPredicate() {
41     throw new ImplementMe();
42   }
43
44   public int size() {
45     return queue.size();
46   }
47
48   public EventContext getContext(int index) {
49     return (EventContext) queue.get(index);
50   }
51
52   public void turnTracingOn() {
53     throw new ImplementMe();
54   }
55
56   public void turnTracingOff() {
57     throw new ImplementMe();
58   }
59
60   public void clear() {
61     throw new ImplementMe();
62
63   }
64
65   public void pause(List JavaDoc pauseEvents) {
66     throw new ImplementMe();
67
68   }
69
70   public void unpause() {
71     throw new ImplementMe();
72
73   }
74
75   public void enableStatsCollection(boolean enable) {
76     throw new ImplementMe();
77   }
78
79   public Stats getStats(long frequency) {
80     throw new ImplementMe();
81   }
82
83   public Stats getStatsAndReset(long frequency) {
84     throw new ImplementMe();
85   }
86
87   public boolean isStatsCollectionEnabled() {
88     throw new ImplementMe();
89   }
90
91   public void resetStats() {
92     throw new ImplementMe();
93   }
94
95 }
Popular Tags