KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > objectserver > managedobject > AbstractManagedObjectState


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.objectserver.managedobject;
5
6 import com.tc.objectserver.core.api.ManagedObjectState;
7
8 /**
9  * Base class for implementations of ManagedObjectState implementations.
10  */

11 public abstract class AbstractManagedObjectState implements ManagedObjectState {
12
13   public final ManagedObjectChangeListener getListener() {
14     return getStateFactory().getListener();
15   }
16
17   public final ManagedObjectStateFactory getStateFactory() {
18     return ManagedObjectStateFactory.getInstance();
19   }
20
21   /**
22    * This is only for testing, its highly inefficient
23    */

24   public final boolean equals(Object JavaDoc o) {
25     if (this == o) return true;
26     if (getClass().getName().equals(o.getClass().getName())) { return basicEquals((AbstractManagedObjectState) o); }
27     return false;
28   }
29
30   protected abstract boolean basicEquals(AbstractManagedObjectState o);
31
32 }
33
Popular Tags