KickJava   Java API By Example, From Geeks To Geeks.

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


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.object.bytecode.Clearable;
7 import com.tc.util.Assert;
8
9 import java.lang.ref.ReferenceQueue JavaDoc;
10
11 public class TCObjectLogical extends TCObjectImpl {
12
13   public TCObjectLogical(ReferenceQueue JavaDoc queue, ObjectID id, Object JavaDoc peer, TCClass tcc) {
14     super(queue, id, peer, tcc);
15   }
16
17   public void logicalInvoke(int method, String JavaDoc methodName, Object JavaDoc[] parameters) {
18     this.markAccessed();
19     getObjectManager().getTransactionManager().logicalInvoke(this, method, methodName, parameters);
20   }
21
22   protected boolean isEvictable() {
23     if (getPeerObject() instanceof Clearable) {
24       return true;
25     } else {
26       return false;
27     }
28   }
29   
30   protected int clearReferences(Object JavaDoc pojo, int toClear) {
31     Assert.assertTrue(pojo instanceof Clearable);
32     Clearable clearable = (Clearable) pojo;
33     return clearable.clearReferences(toClear);
34   }
35
36 }
37
Popular Tags