Follow these guidelines to use custom domain
classes for your cached entry keys and values.
Each member’s CLASSPATH
must include classes for all objects the
- For Java applications, use the
standard Java CLASSPATH.
- For the cacheserver process, use
the CLASSPATH environment variable or the cacheserver's
-classpath parameter. See Pivotal GemFire Servers.
Data is sent between clients and servers in serialized form and the server stores
client data in serialized form. The server does not need to deserialize data to send
it to another client or to access it through a PDXInstance
, but it
does need to deserialize it to access it in other ways. The server
must include the classes for:
- All entry keys
- Entry values in regions that the
server persists to disk
- Entry values the server accesses
for any reason other than access using a PdxInstance or
transfer of the full entry value to a client
For information on PdxInstances, see Data Serialization.
serializes data entry keys and values for distribution, so all data that GemFire moves out of
the local cache for any reason must be serializable. Additionally, partitioned
regions store data in serialized form. Almost every configuration requires
For information on the requirements and options for data serialization, see Data Serialization.
Classes Used as Keys
The region uses hashing on keys. If you define a custom class to use as a key, for
the class, override:
The default hashCode inherited from Object
uses identity, which is different in every system member. In partitioned
regions, hashing based on identity puts data in the wrong place. For
details, see the Java API documentation for