public class MappingPdxSerializer extends Object implements com.gemstone.gemfire.pdx.PdxSerializer, ApplicationContextAware
PdxSerializer implementation that uses a Spring Data GemFire GemfireMappingContext
to read and write entities.ApplicationContext,
ApplicationContextAware,
ConversionService,
EntityInstantiator,
PersistentEntity,
PersistentPropertyAccessor,
PersistentEntityParameterValueProvider,
SpELContext,
PdxReader,
PdxSerializer,
PdxWriter| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
log |
| Constructor and Description |
|---|
MappingPdxSerializer()
Creates a new
MappingPdxSerializer using the default
GemfireMappingContext and DefaultConversionService. |
MappingPdxSerializer(GemfireMappingContext mappingContext,
ConversionService conversionService)
|
| Modifier and Type | Method and Description |
|---|---|
Object |
fromData(Class<?> type,
com.gemstone.gemfire.pdx.PdxReader reader) |
protected ConversionService |
getConversionService() |
protected com.gemstone.gemfire.pdx.PdxSerializer |
getCustomSerializer(Class<?> type)
Looks up and returns a custom PdxSerializer based on the class type of the object to (de)serialize.
|
protected Map<Class<?>,com.gemstone.gemfire.pdx.PdxSerializer> |
getCustomSerializers() |
protected EntityInstantiators |
getGemfireInstantiators() |
protected EntityInstantiator |
getInstantiatorFor(PersistentEntity entity)
Looks up and returns an EntityInstantiator to construct and initialize an instance of the object defined
by the given PersistentEntity (meta-data).
|
protected GemfireMappingContext |
getMappingContext() |
protected GemfirePersistentEntity<?> |
getPersistentEntity(Class<?> entityType)
Looks up and returns the PersistentEntity meta-data for the given entity class type.
|
void |
setApplicationContext(ApplicationContext applicationContext) |
void |
setCustomSerializers(Map<Class<?>,com.gemstone.gemfire.pdx.PdxSerializer> customSerializers)
Configures custom PDX serializers to use for specific class types.
|
void |
setGemfireInstantiators(Map<Class<?>,EntityInstantiator> gemfireInstantiators)
Configures the
EntityInstantiators used to create the instances read by this PdxSerializer. |
boolean |
toData(Object value,
com.gemstone.gemfire.pdx.PdxWriter writer) |
public MappingPdxSerializer()
MappingPdxSerializer using the default
GemfireMappingContext and DefaultConversionService.public MappingPdxSerializer(GemfireMappingContext mappingContext, ConversionService conversionService)
mappingContext - must not be null.conversionService - must not be null.public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext in interface ApplicationContextAwareBeansExceptionprotected ConversionService getConversionService()
public void setCustomSerializers(Map<Class<?>,com.gemstone.gemfire.pdx.PdxSerializer> customSerializers)
customSerializers - a mapping of domain object class types and their corresponding PDX serializer.protected Map<Class<?>,com.gemstone.gemfire.pdx.PdxSerializer> getCustomSerializers()
public void setGemfireInstantiators(Map<Class<?>,EntityInstantiator> gemfireInstantiators)
EntityInstantiators used to create the instances read by this PdxSerializer.gemfireInstantiators - must not be null.protected EntityInstantiators getGemfireInstantiators()
protected GemfireMappingContext getMappingContext()
public Object fromData(Class<?> type, com.gemstone.gemfire.pdx.PdxReader reader)
fromData in interface com.gemstone.gemfire.pdx.PdxSerializerpublic boolean toData(Object value, com.gemstone.gemfire.pdx.PdxWriter writer)
toData in interface com.gemstone.gemfire.pdx.PdxSerializerprotected com.gemstone.gemfire.pdx.PdxSerializer getCustomSerializer(Class<?> type)
type - the Class type of the object to (de)serialize.getCustomSerializers(),
PdxSerializerprotected EntityInstantiator getInstantiatorFor(PersistentEntity entity)
entity - the PersistentEntity object used to lookup the custom EntityInstantiator.EntityInstantiator,
PersistentEntityprotected GemfirePersistentEntity<?> getPersistentEntity(Class<?> entityType)
entityType - the Class type of the actual persistent entity, application domain object class.getMappingContext(),
GemfirePersistentEntityCopyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.