org.jboss.ejb
Class CacheKey

java.lang.Object
  |
  +--org.jboss.ejb.CacheKey
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable
Direct Known Subclasses:
FastKey

public class CacheKey
extends java.lang.Object
implements java.io.Externalizable

CacheKey CacheKey is an encapsulation of both the PrimaryKey and a cache specific key This implementation is a safe implementation in the sense that it doesn't rely on the user supplied hashcode and equals. It is also fast since the hashCode operation is pre-calculated.

Version:
$Revision: 1.9 $
Author:
Marc Fleury
See Also:
org.jboss.ejb.plugins.NoPassivationInstanceCache.java, Serialized Form

Field Summary
 int hashCode
           
 java.lang.Object id
           
 java.rmi.MarshalledObject mo
           
 
Constructor Summary
CacheKey()
           
CacheKey(java.lang.Object id)
           
 
Method Summary
 boolean equals(java.lang.Object object)
           
 int hashCode()
          these should be overwritten by extending Cache key since they define what the cache does in the first place
 void readExternal(java.io.ObjectInput in)
           
 java.lang.String toString()
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

public java.lang.Object id

mo

public java.rmi.MarshalledObject mo

hashCode

public int hashCode
Constructor Detail

CacheKey

public CacheKey()

CacheKey

public CacheKey(java.lang.Object id)
Method Detail

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable

hashCode

public int hashCode()
these should be overwritten by extending Cache key since they define what the cache does in the first place
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2000 The JBoss Organization. All Rights Reserved.