Package org.apache.openjpa.conf
Class CacheMarshallerImpl
- java.lang.Object
-
- org.apache.openjpa.conf.CacheMarshallerImpl
-
- All Implemented Interfaces:
CacheMarshaller,Configurable
public class CacheMarshallerImpl extends Object implements CacheMarshaller, Configurable
DefaultCacheMarshallerimplementation that writes data to a specified file and reads data from a specified file or URL.- Since:
- 1.1.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.openjpa.conf.CacheMarshaller
CacheMarshaller.ValidationPolicy
-
-
Constructor Summary
Constructors Constructor Description CacheMarshallerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendConfiguration()StringgetId()The id that this marshaller is responsible for.FilegetOutputFile()CacheMarshaller.ValidationPolicygetValidationPolicy()Objectload()Load and return an instance of the type handled by this marshaller.voidsetConfiguration(Configuration conf)voidsetConsumeSerializationErrors(boolean consume)voidsetId(String id)The id that this marshaller is responsible for.voidsetInputResource(String resource)voidsetInputURL(URL url)voidsetOutputFile(File file)voidsetValidationPolicy(String policy)TheCacheMarshaller.ValidationPolicythat this marshaller should use.voidstartConfiguration()voidstore(Object o)Storeointo the cache.
-
-
-
Method Detail
-
load
public Object load()
Description copied from interface:CacheMarshallerLoad and return an instance of the type handled by this marshaller. If the type implementsConfigurable, then this method will invokeConfigurable.setConfiguration(org.apache.openjpa.lib.conf.Configuration),Configurable.startConfiguration(), andConfigurable.endConfiguration()on the instance before returning.- Specified by:
loadin interfaceCacheMarshaller
-
store
public void store(Object o)
Description copied from interface:CacheMarshallerStoreointo the cache.- Specified by:
storein interfaceCacheMarshaller
-
setOutputFile
public void setOutputFile(File file)
-
getOutputFile
public File getOutputFile()
-
setInputURL
public void setInputURL(URL url)
-
setInputResource
public void setInputResource(String resource)
-
setConsumeSerializationErrors
public void setConsumeSerializationErrors(boolean consume)
-
getId
public String getId()
Description copied from interface:CacheMarshallerThe id that this marshaller is responsible for.- Specified by:
getIdin interfaceCacheMarshaller
-
setId
public void setId(String id)
Description copied from interface:CacheMarshallerThe id that this marshaller is responsible for. A value for this parameter is required.- Specified by:
setIdin interfaceCacheMarshaller
-
setValidationPolicy
public void setValidationPolicy(String policy) throws InstantiationException, IllegalAccessException
Description copied from interface:CacheMarshallerTheCacheMarshaller.ValidationPolicythat this marshaller should use. A value for this parameter is required. The class will be instantiated via theConfigurationsmechanism, ensuring that if the class implementsConfigurableorGenericConfigurable, it will be taken through the appropriate lifecycle.- Specified by:
setValidationPolicyin interfaceCacheMarshaller- Throws:
InstantiationExceptionIllegalAccessException
-
getValidationPolicy
public CacheMarshaller.ValidationPolicy getValidationPolicy()
-
setConfiguration
public void setConfiguration(Configuration conf)
- Specified by:
setConfigurationin interfaceConfigurable
-
startConfiguration
public void startConfiguration()
- Specified by:
startConfigurationin interfaceConfigurable
-
endConfiguration
public void endConfiguration()
- Specified by:
endConfigurationin interfaceConfigurable
-
-