KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > ClientObjectManager


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.object;
5
6 import com.tc.exception.TCNonPortableObjectError;
7 import com.tc.object.dna.api.DNA;
8 import com.tc.object.tx.ClientTransactionManager;
9 import com.tc.object.tx.optimistic.OptimisticTransactionManager;
10
11 import java.lang.ref.ReferenceQueue JavaDoc;
12 import java.util.Collection JavaDoc;
13 import java.util.Map JavaDoc;
14
15 /**
16  * @author steve
17  */

18 public interface ClientObjectManager {
19
20   public Class JavaDoc getClassFor(String JavaDoc className, String JavaDoc loaderDesc) throws ClassNotFoundException JavaDoc;
21
22   public boolean isManaged(Object JavaDoc pojo);
23
24   public void markReferenced(TCObject tcobj);
25
26   public boolean isPortableClass(Class JavaDoc clazz);
27
28   public boolean isPortableInstance(Object JavaDoc instance);
29
30   public void checkPortabilityOfField(Object JavaDoc value, String JavaDoc fieldName, Class JavaDoc targetClass)
31       throws TCNonPortableObjectError;
32
33   public void checkPortabilityOfLogicalAction(Object JavaDoc param, String JavaDoc methodName, Class JavaDoc logicalType)
34       throws TCNonPortableObjectError;
35
36   public void replaceRootIDIfNecessary(String JavaDoc rootName, ObjectID newRootID);
37
38   public Object JavaDoc lookupObject(ObjectID id) throws ClassNotFoundException JavaDoc;
39
40   public Object JavaDoc lookupObjectNoDepth(ObjectID id) throws ClassNotFoundException JavaDoc;
41
42   public TCObject lookupOrCreate(Object JavaDoc obj);
43
44   public TCObject lookupOrShare(Object JavaDoc pojo);
45
46   public ObjectID lookupExistingObjectID(Object JavaDoc obj);
47
48   public Object JavaDoc lookupRoot(String JavaDoc name);
49
50   public Object JavaDoc lookupOrCreateRootNoDepth(String JavaDoc rootName, Object JavaDoc object);
51
52   public Object JavaDoc lookupOrCreateRoot(String JavaDoc name, Object JavaDoc obj);
53
54   public Object JavaDoc lookupOrCreateRoot(String JavaDoc name, Object JavaDoc obj, boolean dsoFinal);
55
56   public TCObject lookupIfLocal(ObjectID id);
57
58   public TCObject lookup(ObjectID id) throws ClassNotFoundException JavaDoc;
59
60   public TCObject lookupExistingOrNull(Object JavaDoc pojo);
61
62   public Collection JavaDoc getAllObjectIDsAndClear(Collection JavaDoc c);
63
64   public WeakObjectReference createNewPeer(TCClass clazz, DNA dna);
65
66   public WeakObjectReference createNewPeer(TCClass clazz, int size, ObjectID id, ObjectID parentID);
67
68   public TCClass getOrCreateClass(Class JavaDoc clazz);
69
70   public void setTransactionManager(ClientTransactionManager txManager);
71
72   public ClientTransactionManager getTransactionManager();
73
74   public ReferenceQueue JavaDoc getReferenceQueue();
75
76   public void shutdown();
77
78   public void unpause();
79
80   public void pause();
81
82   public void starting();
83
84   public Object JavaDoc deepCopy(Object JavaDoc source, OptimisticTransactionManager optimisticTxManager);
85
86   /**
87    * take a source and a parent (if non-static inner) and create a new empty instance
88    */

89   public Object JavaDoc createNewCopyInstance(Object JavaDoc source, Object JavaDoc parent);
90
91   public Object JavaDoc createParentCopyInstanceIfNecessary(Map JavaDoc visited, Map JavaDoc cloned, Object JavaDoc v);
92
93   public boolean isCreationInProgress();
94
95   public void addPendingCreateObjectsToTransaction();
96
97   public boolean hasPendingCreateObjects();
98
99   public Object JavaDoc createOrReplaceRoot(String JavaDoc rootName, Object JavaDoc root);
100 }
101
Popular Tags