当前页面:
在线文档首页 >
JBoss 3.2.7 server API Documentation 英文版文档
FastKey (JBoss Server API) - JBoss 3.2.7 server API Documentation 英文版文档
org.jboss.ejb
Class FastKey
java.lang.Object
org.jboss.ejb.CacheKey
org.jboss.ejb.FastKey
- All Implemented Interfaces:
- Externalizable, Serializable
- public class FastKey
- extends CacheKey
- implements Externalizable
FastKey
FastKey is a hack to enable fool proof and fast operation of caches for Entity
In the case of complex PK if a developer misses hash and equals the maps won't
properly work in jboss. Here we provide an wrapper to the DB Key and the hash
is over-written so that we never miss a hit in cache and have constant speed.
- Version:
- $Revision: 1.1 $
- Author:
- Marc Fleury
- See Also:
org.jboss.ejb.plugins.NoPassivationInstanceCache.java
,
Serialized Form
fastKey
protected Long fastKey
FastKey
public FastKey()
FastKey
public FastKey(Object id)
getPrimaryKey
public Object getPrimaryKey()
nextFastKey
protected Long nextFastKey()
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException
- Specified by:
writeExternal
in interface Externalizable
- Overrides:
writeExternal
in class CacheKey
- Throws:
IOException
readExternal
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
- Specified by:
readExternal
in interface Externalizable
- Overrides:
readExternal
in class CacheKey
- Throws:
IOException
ClassNotFoundException
hashCode
public int hashCode()
- Description copied from class:
CacheKey
- these should be overwritten by extending Cache key
since they define what the cache does in the first place
- Overrides:
hashCode
in class CacheKey
equals
public boolean equals(Object object)
- Description copied from class:
CacheKey
- This method uses the id implementation of equals if the mo is
null since this indicates that the id class did implement equals.
If mo is not null, then the MarshalledObject equals is used to
compare keys based on their serialized form. Relying on the
serialized form does not always work.
- Overrides:
equals
in class CacheKey
Copyright © 2002 JBoss Group, LLC. All Rights Reserved.