public class PdxTest extends Object
| Modifier and Type | Field and Description |
|---|---|
static ClassLoader |
fixedLoader |
static boolean |
pdx661Behavior |
static ClassLoader |
version1Loader |
static ClassLoader |
version2Loader |
| Constructor and Description |
|---|
PdxTest() |
| Modifier and Type | Method and Description |
|---|---|
static ClassLoader |
createClassLoader(long version)
Create and return (but don't install) a class loader for the given version (either 1
for a version1 loader or 2 for a version2 loader.
|
static Map<String,Object> |
getFieldMap(Object anObject)
Return a map of all fields (including inherited fields) of anObject.
|
static String |
getFieldValue(Object anObj,
String fieldName)
Return the toString() representation of the field fieldName from the given object anObj
or null.
|
static String |
getNewValueStr(com.gemstone.gemfire.cache.EntryEvent eEvent) |
static String |
getOldValueStr(com.gemstone.gemfire.cache.EntryEvent eEvent) |
static Object |
getVersionedInstance(String className)
Use reflection to create a new instance of a versioned class whose
name is specified by className.
|
static parReg.query.NewPortfolio |
getVersionedNewPortfolio(String className,
String name,
int index)
Use reflection to create a new instance of PdxVersionedNewPortfolio.
|
static QueryObject |
getVersionedQueryObject(String className,
long base,
int valueGeneration,
int byteArraySize,
int levels)
Use reflection to create a new instance of PdxVersionedQueryObject.
|
static BaseValueHolder |
getVersionedValueHolder(String className,
Object anObj,
RandomValues rv)
Use reflection to create a new instance of VersionedValueHolder or
a subclass assuming it has a constructor with args (Object, RandomValues).
|
static BaseValueHolder |
getVersionedValueHolder(String className,
String key,
RandomValues rv)
Use reflection to create a new instance of VersionedValueHolder or
a subclass assuming it has a constructor with args (String, RandomValues).
|
static ClassLoader |
initClassLoader()
If PdxPrms.initClassLoader is true, then randomly choose a versioned
class path and create and install a class loader for it on this thread.
|
static void |
invokeFromData(Object anObj,
com.gemstone.gemfire.pdx.PdxReader reader)
Using reflection, invoke the instance method myFromData on anObj passing
reader as an argument.
|
static void |
invokeToData(Object anObj,
com.gemstone.gemfire.pdx.PdxWriter writer)
Using reflection, invoke the instance method myToData on anObj passing
writer as an argument.
|
static Object |
restoreFromFieldMap(Map<String,Object> fieldMap)
Return an object with fields restored to the values in the map
(obtained from getFieldMap(Object).
|
static BaseValueHolder |
toValueHolder(Object anObj)
Given an object (assumed to be either a ValueHolder, PdxInstance or null)
return either the ValueHolder or the ValueHolder represented by the
PdxInstance or null.
|
public static boolean pdx661Behavior
public static ClassLoader fixedLoader
public static ClassLoader version1Loader
public static ClassLoader version2Loader
public static ClassLoader initClassLoader()
public static ClassLoader createClassLoader(long version)
version - Either 1 or 2 to indicate a class loader for version1 or version2public static Object getVersionedInstance(String className)
className - The name of the versioned class to create.public static BaseValueHolder getVersionedValueHolder(String className, String key, RandomValues rv)
className - The specific class to create (really any class with constructor
with args (String, RandomValues).key - The String argument to the constructor.rv - The RandomValues instance to pass to the constructor.public static BaseValueHolder getVersionedValueHolder(String className, Object anObj, RandomValues rv)
className - The specific class to create (really any class with constructor
with args (String, RandomValues).anObj - The Object argument to the constructor.rv - The RandomValues instance to pass to the constructor.public static parReg.query.NewPortfolio getVersionedNewPortfolio(String className, String name, int index)
name - Argument for the constructor.index - Argument for the constructor.public static QueryObject getVersionedQueryObject(String className, long base, int valueGeneration, int byteArraySize, int levels)
public static BaseValueHolder toValueHolder(Object anObj)
anObj - The ValueHolder, PdxInstance or nullpublic static Map<String,Object> getFieldMap(Object anObject)
anObject - The object with fields to include in the return map.public static Object restoreFromFieldMap(Map<String,Object> fieldMap)
fieldMap - Map of field name (key) and field value (map value) for all
fields for anObject. In addition, the map contains the key
"className" and value (String), the class name for anObject.public static String getOldValueStr(com.gemstone.gemfire.cache.EntryEvent eEvent)
public static String getNewValueStr(com.gemstone.gemfire.cache.EntryEvent eEvent)
public static void invokeToData(Object anObj, com.gemstone.gemfire.pdx.PdxWriter writer) throws com.gemstone.gemfire.GemFireRethrowable
anObj - The object to receive the myToData method invocation.writer - The object to use as the argument to _toDatacom.gemstone.gemfire.GemFireRethrowablepublic static void invokeFromData(Object anObj, com.gemstone.gemfire.pdx.PdxReader reader)
anObj - The object to receive the myFromData method invocation.writer - The object to use as the argument to _fromDataThrowablepublic static String getFieldValue(Object anObj, String fieldName) throws NoSuchFieldException
anObj - The object that contains the field fieldNamefieldName - Return the toString() value of fieldName in anObj.NoSuchFieldExceptionCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.