站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > 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
  extended byorg.jboss.ejb.CacheKey
      extended byorg.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

Field Summary
protected  Long fastKey
           
 
Fields inherited from class org.jboss.ejb.CacheKey
hashCode, id, mo
 
Constructor Summary
FastKey()
           
FastKey(Object id)
           
 
Method Summary
 boolean equals(Object object)
          This method uses the id implementation of equals if the mo is null since this indicates that the id class did implement equals.
 Object getPrimaryKey()
           
 int hashCode()
          these should be overwritten by extending Cache key since they define what the cache does in the first place
protected  Long nextFastKey()
           
 void readExternal(ObjectInput in)
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class org.jboss.ejb.CacheKey
getId, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

fastKey

protected Long fastKey
Constructor Detail

FastKey

public FastKey()

FastKey

public FastKey(Object id)
Method Detail

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.