01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.objectserver.managedobject;
05:
06: import com.tc.objectserver.core.api.ManagedObjectState;
07:
08: /**
09: * Base class for implementations of ManagedObjectState implementations.
10: */
11: public abstract class AbstractManagedObjectState implements
12: ManagedObjectState {
13:
14: public final ManagedObjectChangeListener getListener() {
15: return getStateFactory().getListener();
16: }
17:
18: public final ManagedObjectStateFactory getStateFactory() {
19: return ManagedObjectStateFactory.getInstance();
20: }
21:
22: /**
23: * This is only for testing, its highly inefficient
24: */
25: public final boolean equals(Object o) {
26: if (this == o)
27: return true;
28: if (getClass().getName().equals(o.getClass().getName())) {
29: return basicEquals((AbstractManagedObjectState) o);
30: }
31: return false;
32: }
33:
34: protected abstract boolean basicEquals(AbstractManagedObjectState o);
35:
36: }
|