org.apache.jdo.impl.fostore
Class FOStoreSchemaUID

java.lang.Object
  extended byorg.apache.jdo.impl.fostore.FOStoreSchemaUID

class FOStoreSchemaUID
extends java.lang.Object

A FOStoreSchemaUID is an internal name used to distinguish persistence capable classes based on the structure of their persistent fields as indicated by the enhancer. This is very similar to, and the implementation is based on, the process of computing a serialVersionUID as described in Object Serialization Specification, Section 4.4, Stream Unique Identifiers. // NOI18N

Author:
Dave Bristor

Field Summary
private  long fsuid
          The 'value' of this FOStoreSchemaUID
private static javax.jdo.spi.JDOImplHelper helper
          JDOImplHelper instance
private static java.util.HashMap loaderMap
          Map from ClassLoader to a HashMap that in turn maps from Class to FOStoreSchemaUID.
(package private) static org.apache.commons.logging.Log logger
          Logger
private static org.apache.jdo.util.I18NHelper msg
          I18N support.
private static FOStoreSchemaUID NOT_PERSISTENT
           
 
Constructor Summary
private FOStoreSchemaUID(java.lang.Class cls)
           
private FOStoreSchemaUID(long value)
           
 
Method Summary
private  long computeUID(java.lang.Class cls)
           
private  void computeUID(java.lang.Class cls, java.io.DataOutputStream out)
           
 boolean equals(java.lang.Object o)
           
 int hashCode()
          Computes a hashcode for this FOStoreSchemaUID.
(package private) static FOStoreSchemaUID lookup(java.lang.Class cls, FOStoreModel model)
          Provides a FOStoreSchemaUID corresponding to the given class.
(package private) static FOStoreSchemaUID read(java.io.DataInput in)
           
 java.lang.String toString()
           
(package private)  void write(java.io.DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

fsuid

private final long fsuid
The 'value' of this FOStoreSchemaUID


loaderMap

private static final java.util.HashMap loaderMap
Map from ClassLoader to a HashMap that in turn maps from Class to FOStoreSchemaUID.


msg

private static final org.apache.jdo.util.I18NHelper msg
I18N support.


logger

static final org.apache.commons.logging.Log logger
Logger


NOT_PERSISTENT

private static final FOStoreSchemaUID NOT_PERSISTENT

helper

private static final javax.jdo.spi.JDOImplHelper helper
JDOImplHelper instance

Constructor Detail

FOStoreSchemaUID

private FOStoreSchemaUID(long value)

FOStoreSchemaUID

private FOStoreSchemaUID(java.lang.Class cls)
Method Detail

lookup

static FOStoreSchemaUID lookup(java.lang.Class cls,
                               FOStoreModel model)
Provides a FOStoreSchemaUID corresponding to the given class. Any class which has a distinct FOStoreSchemaUID. All other classes share a common FOStoreSchemaUID. (A class can be PersistenceCapable but not enhanced by virtue of being in an inheritance chain, in which a class which does not have a JDO model inherits a class that does have a JDO model.) This should only be invoked by client code, never by server code, because it involves client-side concepts such as PersistenceCapable.

Parameters:
cls - Class for which a FOStoreSchemaUID is needed.
model - FOStoreModel for determining whether cls was enhanced.
Returns:
FOStoreSchemaUID corresponding to given Class.

computeUID

private long computeUID(java.lang.Class cls)

computeUID

private void computeUID(java.lang.Class cls,
                        java.io.DataOutputStream out)
                 throws java.io.IOException
Throws:
java.io.IOException

toString

public java.lang.String toString()

write

void write(java.io.DataOutput out)
     throws java.io.IOException
Throws:
java.io.IOException

read

static FOStoreSchemaUID read(java.io.DataInput in)
                      throws java.io.IOException
Throws:
java.io.IOException

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()
Computes a hashcode for this FOStoreSchemaUID. The result is the exclusive OR of the two halves of the primitive long value represented by this Long object. That is, the hashcode is the value of the expression:
 (int)(this.longValue()^(this.longValue()>>>32))
 
This is the same algoritm as is used for java.lang.Long.

Returns:
a hash code value for this object.