01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.objectserver.core.impl;
06:
07: import com.tc.async.api.Stage;
08: import com.tc.exception.ImplementMe;
09: import com.tc.l2.api.L2Coordinator;
10: import com.tc.logging.TCLogger;
11: import com.tc.logging.TCLogging;
12: import com.tc.object.net.ChannelStats;
13: import com.tc.object.net.DSOChannelManager;
14: import com.tc.objectserver.api.ObjectManager;
15: import com.tc.objectserver.core.api.ServerConfigurationContext;
16: import com.tc.objectserver.handshakemanager.ServerClientHandshakeManager;
17: import com.tc.objectserver.l1.api.ClientStateManager;
18: import com.tc.objectserver.lockmanager.api.LockManager;
19: import com.tc.objectserver.persistence.api.ManagedObjectStore;
20: import com.tc.objectserver.tx.ServerTransactionManager;
21: import com.tc.objectserver.tx.TransactionBatchReaderFactory;
22: import com.tc.objectserver.tx.TransactionalObjectManager;
23:
24: import java.util.HashMap;
25: import java.util.Map;
26:
27: public class TestServerConfigurationContext implements
28: ServerConfigurationContext {
29:
30: public ObjectManager objectManager;
31: public LockManager lockManager;
32: public DSOChannelManager channelManager;
33: public ClientStateManager clientStateManager;
34: public ServerTransactionManager transactionManager;
35: public ManagedObjectStore objectStore;
36: public ServerClientHandshakeManager clientHandshakeManager;
37: public Map stages = new HashMap();
38: public ChannelStats channelStats;
39: public TransactionalObjectManager txnObjectManager;
40: public L2Coordinator l2Coordinator;
41:
42: public void addStage(String name, Stage stage) {
43: stages.put(name, stage);
44: }
45:
46: public ObjectManager getObjectManager() {
47: return this .objectManager;
48: }
49:
50: public LockManager getLockManager() {
51: return this .lockManager;
52: }
53:
54: public DSOChannelManager getChannelManager() {
55: return this .channelManager;
56: }
57:
58: public ClientStateManager getClientStateManager() {
59: return this .clientStateManager;
60: }
61:
62: public ServerTransactionManager getTransactionManager() {
63: return this .transactionManager;
64: }
65:
66: public ManagedObjectStore getObjectStore() {
67: return this .objectStore;
68: }
69:
70: public ServerClientHandshakeManager getClientHandshakeManager() {
71: return this .clientHandshakeManager;
72: }
73:
74: public Stage getStage(String name) {
75: return (Stage) this .stages.get(name);
76: }
77:
78: public TCLogger getLogger(Class clazz) {
79: return TCLogging.getLogger(getClass());
80: }
81:
82: public ChannelStats getChannelStats() {
83: return this .channelStats;
84: }
85:
86: public TransactionBatchReaderFactory getTransactionBatchReaderFactory() {
87: throw new ImplementMe();
88: }
89:
90: public TransactionalObjectManager getTransactionalObjectManager() {
91: return txnObjectManager;
92: }
93:
94: public L2Coordinator getL2Coordinator() {
95: return l2Coordinator;
96: }
97:
98: }
|