KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > objectserver > tx > TestTransactionalStageCoordinator


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

5 package com.tc.objectserver.tx;
6
7 import com.tc.async.impl.MockSink;
8 import com.tc.objectserver.context.ApplyCompleteEventContext;
9 import com.tc.objectserver.context.ApplyTransactionContext;
10 import com.tc.objectserver.context.CommitTransactionContext;
11 import com.tc.objectserver.context.LookupEventContext;
12 import com.tc.objectserver.context.RecallObjectsContext;
13
14 import java.util.Collections JavaDoc;
15
16 public class TestTransactionalStageCoordinator implements TransactionalStageCoordinator {
17
18   public MockSink lookupSink = new MockSink();
19   public MockSink recallSink = new MockSink();
20   public MockSink applySink = new MockSink();
21   public MockSink applyCompleteSink = new MockSink();
22   public MockSink commitSink = new MockSink();
23
24   public void addToApplyStage(ApplyTransactionContext context) {
25     applySink.add(context);
26   }
27
28   public void initiateApplyComplete() {
29     applyCompleteSink.add(new ApplyCompleteEventContext());
30   }
31
32   public void initiateCommit() {
33     commitSink.add(new CommitTransactionContext());
34   }
35
36   public void initiateLookup() {
37     lookupSink.addLossy(new LookupEventContext());
38   }
39
40   public void initiateRecallAll() {
41     recallSink.add(new RecallObjectsContext(Collections.EMPTY_LIST, true));
42   }
43 }
Popular Tags