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.bytecode;
05:
06: import com.tc.objectserver.managedobject.PhysicalManagedObjectState;
07: import com.tc.util.Assert;
08:
09: public class ClassSpec {
10:
11: private static final String PHYSICAL_MO_STATE_CLASS_NAME = PhysicalManagedObjectState.class
12: .getName();
13:
14: private final String className;
15: private final String loaderDesc;
16: private final String classIdentifier;
17: private int classID = Integer.MIN_VALUE;
18: private String generatedClassName;
19: private String super ClassName = PHYSICAL_MO_STATE_CLASS_NAME;
20:
21: public ClassSpec(String className, String loaderDesc, long strIdx) {
22: this .className = className;
23: this .loaderDesc = loaderDesc;
24: this .classIdentifier = "com.tc.state.idx" + strIdx + "."
25: + className;
26: }
27:
28: public void setGeneratedClassID(int classID) {
29: this .classID = classID;
30: this .generatedClassName = this .classIdentifier + "_V" + classID;
31: }
32:
33: public String getGeneratedClassName() {
34: Assert.assertNotNull(this .generatedClassName);
35: return this .generatedClassName;
36: }
37:
38: public String getClassName() {
39: return className;
40: }
41:
42: public String getLoaderDesc() {
43: return loaderDesc;
44: }
45:
46: public String getClassIdentifier() {
47: return classIdentifier;
48: }
49:
50: public int getClassID() {
51: Assert.assertFalse(this .classID == Integer.MIN_VALUE);
52: return this .classID;
53: }
54:
55: public Object getLock() {
56: return classIdentifier.intern();
57: }
58:
59: public void setSuperClassName(String className) {
60: this .super ClassName = className;
61: }
62:
63: public String getSuperClassName() {
64: return this .super ClassName;
65: }
66:
67: public boolean isDirectSubClassOfPhysicalMOState() {
68: return (PHYSICAL_MO_STATE_CLASS_NAME
69: .equals(this.superClassName));
70: }
71: }
|