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.persistence.impl;
06:
07: import com.tc.exception.ImplementMe;
08: import com.tc.io.serializer.api.StringIndex;
09: import com.tc.objectserver.persistence.api.ClassPersistor;
10: import com.tc.objectserver.persistence.api.ClientStatePersistor;
11: import com.tc.objectserver.persistence.api.ManagedObjectPersistor;
12: import com.tc.objectserver.persistence.api.PersistenceTransactionProvider;
13: import com.tc.objectserver.persistence.api.PersistentCollectionFactory;
14: import com.tc.objectserver.persistence.api.PersistentMapStore;
15: import com.tc.objectserver.persistence.api.Persistor;
16: import com.tc.objectserver.persistence.api.TransactionPersistor;
17: import com.tc.util.sequence.MutableSequence;
18:
19: public class InMemoryPersistor implements Persistor {
20:
21: private final PersistenceTransactionProvider persistenceTransactionProvider;
22: private final ClientStatePersistor clientStatePersistor;
23: private final StringIndex stringIndex;
24: private final ClassPersistor clazzPersistor;
25: private final PersistentCollectionFactory persistentCollectionFactory;
26: private final PersistentMapStore clusterStateStore;
27:
28: public InMemoryPersistor() {
29: this .persistenceTransactionProvider = new NullPersistenceTransactionProvider();
30: this .clientStatePersistor = new InMemoryClientStatePersistor();
31: this .stringIndex = new StringIndexImpl(
32: new NullStringIndexPersistor());
33: this .clazzPersistor = new InMemoryClassPersistor();
34: this .persistentCollectionFactory = new InMemoryCollectionFactory();
35: this .clusterStateStore = new InMemoryPersistentMapStore();
36:
37: }
38:
39: public void close() {
40: return;
41: }
42:
43: public PersistenceTransactionProvider getPersistenceTransactionProvider() {
44: return this .persistenceTransactionProvider;
45: }
46:
47: public ClientStatePersistor getClientStatePersistor() {
48: return this .clientStatePersistor;
49: }
50:
51: public ManagedObjectPersistor getManagedObjectPersistor() {
52: throw new ImplementMe();
53: }
54:
55: public TransactionPersistor getTransactionPersistor() {
56: throw new ImplementMe();
57: }
58:
59: public MutableSequence getGlobalTransactionIDSequence() {
60: throw new ImplementMe();
61: }
62:
63: public StringIndex getStringIndex() {
64: return stringIndex;
65: }
66:
67: public ClassPersistor getClassPersistor() {
68: return this .clazzPersistor;
69: }
70:
71: public PersistentCollectionFactory getPersistentCollectionFactory() {
72: return persistentCollectionFactory;
73: }
74:
75: public PersistentMapStore getClusterStateStore() {
76: return clusterStateStore;
77: }
78:
79: }
|