001: /*
002: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
003: * notice. All rights reserved.
004: */
005: package com.tc.object.bytecode;
006:
007: import com.tc.cluster.ClusterEventListener;
008: import com.tc.logging.TCLogger;
009: import com.tc.management.beans.sessions.SessionMonitorMBean;
010: import com.tc.object.ObjectID;
011: import com.tc.object.TCObject;
012: import com.tc.object.event.DmiManager;
013: import com.tc.properties.TCProperties;
014:
015: import java.lang.reflect.Field;
016:
017: /**
018: * Null implementation of the manager.
019: */
020: public final class NullManager implements Manager {
021:
022: public static final String CLASS = "com/tc/object/bytecode/NullManager";
023: public static final String TYPE = "L" + CLASS + ";";
024:
025: private static final Manager INSTANCE = new NullManager();
026:
027: /**
028: * Get instance of the null manager
029: *
030: * @return NullManager
031: */
032: public static Manager getInstance() {
033: return INSTANCE;
034: }
035:
036: private NullManager() {
037: //
038: }
039:
040: public final void init() {
041: //
042: }
043:
044: public final void stop() {
045: //
046: }
047:
048: public final Object lookupOrCreateRoot(String name, Object object) {
049: throw new UnsupportedOperationException();
050: }
051:
052: public final Object lookupOrCreateRootNoDepth(String name,
053: Object obj) {
054: throw new UnsupportedOperationException();
055: }
056:
057: public final Object createOrReplaceRoot(String name, Object object) {
058: throw new UnsupportedOperationException();
059: }
060:
061: public final void beginLock(String lockID, int type) {
062: //
063: }
064:
065: public final TCObject lookupExistingOrNull(Object obj) {
066: return null;
067: }
068:
069: public final void objectNotify(Object obj) {
070: obj.notify();
071: }
072:
073: public final void objectNotifyAll(Object obj) {
074: obj.notifyAll();
075: }
076:
077: public final void objectWait0(Object obj)
078: throws InterruptedException {
079: obj.wait();
080: }
081:
082: public final void objectWait1(Object obj, long millis)
083: throws InterruptedException {
084: obj.wait(millis);
085: }
086:
087: public final void objectWait2(Object obj, long millis, int nanos)
088: throws InterruptedException {
089: obj.wait(millis, nanos);
090: }
091:
092: public final void monitorEnter(Object obj, int type) {
093: //
094: }
095:
096: public final void monitorExit(Object obj) {
097: //
098: }
099:
100: public final void logicalInvoke(Object object, String methodName,
101: Object[] params) {
102: //
103: }
104:
105: public final boolean distributedMethodCall(Object receiver,
106: String method, Object[] params, boolean runOnAllNodes) {
107: return true;
108: }
109:
110: public final void distributedMethodCallCommit() {
111: //
112: }
113:
114: public final void checkWriteAccess(Object context) {
115: //
116: }
117:
118: public final boolean isManaged(Object object) {
119: return false;
120: }
121:
122: public final boolean isLogical(Object object) {
123: throw new UnsupportedOperationException();
124: }
125:
126: public final boolean isRoot(Field field) {
127: return false;
128: }
129:
130: public final Object deepCopy(Object source) {
131: throw new UnsupportedOperationException();
132: }
133:
134: public final Object lookupRoot(String name) {
135: throw new UnsupportedOperationException();
136: }
137:
138: public final void optimisticBegin() {
139: throw new UnsupportedOperationException();
140: }
141:
142: public final void optimisticCommit() {
143: throw new UnsupportedOperationException();
144: }
145:
146: public final void optimisticRollback() {
147: throw new UnsupportedOperationException();
148: }
149:
150: public final void beginVolatile(TCObject tcObject,
151: String fieldName, int type) {
152: // do nothing
153: }
154:
155: public final void commitLock(String lockName) {
156: // do nothing
157: }
158:
159: public final boolean isLocked(Object obj, int lockLevel) {
160: return false;
161: }
162:
163: public final int queueLength(Object obj) {
164: return 0;
165: }
166:
167: public final void commitVolatile(TCObject tcObject, String fieldName) {
168: //
169: }
170:
171: public final int waitLength(Object obj) {
172: return 0;
173: }
174:
175: public final boolean isHeldByCurrentThread(Object obj, int lockLevel) {
176: return false;
177: }
178:
179: public final void logicalInvokeWithTransaction(Object object,
180: Object lockObject, String methodName, Object[] params) {
181: throw new UnsupportedOperationException();
182: }
183:
184: public final boolean tryMonitorEnter(Object obj,
185: long timeoutInNanos, int type) {
186: throw new UnsupportedOperationException();
187: }
188:
189: public final boolean tryBeginLock(String lockID, int type) {
190: throw new UnsupportedOperationException();
191: }
192:
193: public final TCObject shareObjectIfNecessary(Object pojo) {
194: throw new UnsupportedOperationException();
195: }
196:
197: public final boolean isCreationInProgress() {
198: return false;
199: }
200:
201: public final boolean isPhysicallyInstrumented(Class clazz) {
202: return false;
203: }
204:
205: public final String getClientID() {
206: // XXX: even though this should *probably* throw UnsupportedOperationException, because some innocent tests use
207: // ManagerUtil (e.g. ConfigPropertiesTest), it was decided to return "" from this method.
208: return "";
209: }
210:
211: public final TCLogger getLogger(String loggerName) {
212: throw new UnsupportedOperationException();
213: }
214:
215: public final SessionMonitorMBean getSessionMonitorMBean() {
216: throw new UnsupportedOperationException();
217: }
218:
219: public final TCObject lookupOrCreate(Object obj) {
220: throw new UnsupportedOperationException();
221: }
222:
223: public final Object lookupObject(ObjectID id) {
224: throw new UnsupportedOperationException();
225: }
226:
227: public Object lookupObject(ObjectID id, ObjectID parentContext) {
228: throw new UnsupportedOperationException();
229: }
230:
231: public final TCProperties getTCProperites() {
232: throw new UnsupportedOperationException();
233: }
234:
235: public final void addClusterEventListener(ClusterEventListener cel) {
236: throw new UnsupportedOperationException();
237: }
238:
239: public final DmiManager getDmiManager() {
240: throw new UnsupportedOperationException();
241: }
242:
243: public final int localHeldCount(Object obj, int lockLevel) {
244: throw new UnsupportedOperationException();
245: }
246:
247: public boolean isDsoMonitored(Object obj) {
248: return false;
249: }
250:
251: public boolean isDsoMonitorEntered(Object obj) {
252: return false;
253: }
254:
255: public boolean isFieldPortableByOffset(Object pojo, long fieldOffset) {
256: throw new UnsupportedOperationException();
257: }
258:
259: }
|