Class ResourceCapableCacheDataImporterExporter
java.lang.Object
org.springframework.geode.data.AbstractCacheDataImporterExporter
org.springframework.geode.data.support.ResourceCapableCacheDataImporterExporter
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.config.BeanPostProcessor
,org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ApplicationContextAware
,org.springframework.context.EnvironmentAware
,org.springframework.context.ResourceLoaderAware
,CacheDataExporter
,CacheDataImporter
,CacheDataImporterExporter
- Direct Known Subclasses:
JsonCacheDataImporterExporter
public abstract class ResourceCapableCacheDataImporterExporter
extends AbstractCacheDataImporterExporter
implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware
An
AbstractCacheDataImporterExporter
extension and implementation capable of handling and managing import
and export Resources
.- Since:
- 1.3.1
- See Also:
-
File
GemFireCache
Region
InitializingBean
ApplicationContext
ConfigurableApplicationContext
ResourceLoaderAware
Expression
ExpressionParser
SpelParserConfiguration
SpelExpressionParser
Resource
ResourceLoader
ResourceReader
ResourceResolver
ResourceWriter
AbstractCacheDataImporterExporter
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Abstract base class containing functionality common to allcache
basedResourceResolvers
, whether for import or export.static class
Abstract base class extended by exportResourceCapableCacheDataImporterExporter.CacheResourceResolver
implementations, providing a template to resolve theResource
used for export.static class
Abstract base class extended by importResourceResolver
implementations, providing a template to resolve theResource
to import.protected static interface
static class
Resolves theResource
to import from the classpath.static interface
Marker interface extendingResourceCapableCacheDataImporterExporter.CacheResourceResolver
for cache data exports.static class
Resolves theResource
used for export from the filesystem.static interface
Marker interface extendingResourceCapableCacheDataImporterExporter.CacheResourceResolver
for cache data imports. -
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
Fields inherited from class org.springframework.geode.data.AbstractCacheDataImporterExporter
CACHE_DATA_EXPORT_ENABLED_PROPERTY_NAME, CACHE_DATA_IMPORT_ACTIVE_PROFILES_PROPERTY_NAME, CACHE_DATA_IMPORT_ENABLED_PROPERTY_NAME, DEFAULT_CACHE_DATA_EXPORT_ENABLED, DEFAULT_CACHE_DATA_IMPORT_ACTIVE_PROFILES, DEFAULT_CACHE_DATA_IMPORT_ENABLED
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Initializes the export and importResourceResolvers
as needed along with thereader
andwriter
for theResource
used on import and export.Gets the configured reference to theResourceCapableCacheDataImporterExporter.ExportResourceResolver
.Gets the configured reference to theResourceCapableCacheDataImporterExporter.ImportResourceResolver
.protected Optional<org.springframework.core.io.ResourceLoader>
protected ResourceReader
Gets the configuredResourceReader
used to read data from aResource
on import.protected ResourceWriter
Gets the configuredResourceWriter
used to write data to theResource
on export.void
setExportResourceResolver
(ResourceCapableCacheDataImporterExporter.ExportResourceResolver exportResourceResolver) Sets a reference to the configuredResourceCapableCacheDataImporterExporter.ExportResourceResolver
.void
setImportResourceResolver
(ResourceCapableCacheDataImporterExporter.ImportResourceResolver importResourceResolver) Sets a reference to the configuredResourceCapableCacheDataImporterExporter.ImportResourceResolver
.void
setResourceLoader
(org.springframework.core.io.ResourceLoader resourceLoader) void
setResourceReader
(ResourceReader resourceReader) Sets a reference to the configuredResourceReader
.void
setResourceWriter
(ResourceWriter resourceWriter) Set a reference to the configuredResourceWriter
.Methods inherited from class org.springframework.geode.data.AbstractCacheDataImporterExporter
doExportFrom, doImportInto, exportFrom, getApplicationContext, getEnvironment, getLogger, getRegionPredicate, importInto, isExportEnabled, isImportEnabled, isImportProfilesActive, requireApplicationContext, requireEnvironment, setApplicationContext, setEnvironment
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.config.BeanPostProcessor
postProcessBeforeInitialization
Methods inherited from interface org.springframework.geode.data.CacheDataExporter
postProcessBeforeDestruction
Methods inherited from interface org.springframework.geode.data.CacheDataImporter
postProcessAfterInitialization
Methods inherited from interface org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor
requiresDestruction
-
Field Details
-
CACHE_DATA_EXPORT_RESOURCE_LOCATION_PROPERTY_NAME
- See Also:
-
CACHE_DATA_IMPORT_RESOURCE_LOCATION_PROPERTY_NAME
- See Also:
-
RESOURCE_NAME_PATTERN
- See Also:
-
-
Constructor Details
-
ResourceCapableCacheDataImporterExporter
public ResourceCapableCacheDataImporterExporter()
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()Initializes the export and importResourceResolvers
as needed along with thereader
andwriter
for theResource
used on import and export.- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
setExportResourceResolver
@Autowired(required=false) public void setExportResourceResolver(@Nullable ResourceCapableCacheDataImporterExporter.ExportResourceResolver exportResourceResolver) Sets a reference to the configuredResourceCapableCacheDataImporterExporter.ExportResourceResolver
.- Parameters:
exportResourceResolver
- configuredResourceCapableCacheDataImporterExporter.ExportResourceResolver
used by this importer/exporter to resolveResources
on export.- See Also:
-
getExportResourceResolver
@NonNull protected ResourceCapableCacheDataImporterExporter.ExportResourceResolver getExportResourceResolver()Gets the configured reference to theResourceCapableCacheDataImporterExporter.ExportResourceResolver
. The configuredResourceCapableCacheDataImporterExporter.ExportResourceResolver
is guaranteed to be non-null only if theafterPropertiesSet()
initialization method was called after construction of this importer/exporter. This is definitely true in a Spring context.- Returns:
- the configured reference to the
ResourceCapableCacheDataImporterExporter.ExportResourceResolver
. - See Also:
-
setImportResourceResolver
@Autowired(required=false) public void setImportResourceResolver(@Nullable ResourceCapableCacheDataImporterExporter.ImportResourceResolver importResourceResolver) Sets a reference to the configuredResourceCapableCacheDataImporterExporter.ImportResourceResolver
.- Parameters:
importResourceResolver
- configuredResourceCapableCacheDataImporterExporter.ImportResourceResolver
used by this importer/exporter to resolveResources
on import.- See Also:
-
getImportResourceResolver
@NonNull protected ResourceCapableCacheDataImporterExporter.ImportResourceResolver getImportResourceResolver()Gets the configured reference to theResourceCapableCacheDataImporterExporter.ImportResourceResolver
. The configuredResourceCapableCacheDataImporterExporter.ImportResourceResolver
is guaranteed to be non-null only if theafterPropertiesSet()
initialization method was called after construction of this importer/exporter. This is definitely true in a Spring context.- Returns:
- the configured reference to the
ResourceCapableCacheDataImporterExporter.ImportResourceResolver
. - See Also:
-
setResourceLoader
public void setResourceLoader(@Nullable org.springframework.core.io.ResourceLoader resourceLoader) - Specified by:
setResourceLoader
in interfaceorg.springframework.context.ResourceLoaderAware
- Parameters:
resourceLoader
-ResourceLoader
used to resolve and loadResources
.- See Also:
-
ResourceLoader
-
getResourceLoader
-
setResourceReader
Sets a reference to the configuredResourceReader
.- Parameters:
resourceReader
- configuredResourceReader
used by this importer/exporter to read from aResource
on import.- See Also:
-
getResourceReader
Gets the configuredResourceReader
used to read data from aResource
on import. The configuredResourceReader
is guaranteed to be non-null only if theafterPropertiesSet()
initialization method was called after construction of this importer/exporter. This is definitely true in a Spring context.- Returns:
- the configured
ResourceReader
. - See Also:
-
setResourceWriter
Set a reference to the configuredResourceWriter
.- Parameters:
resourceWriter
- configuredResourceWriter
used by this importer/exporter to write to aResource
on export.- See Also:
-
getResourceWriter
Gets the configuredResourceWriter
used to write data to theResource
on export. The configuredResourceWriter
is guaranteed to be non-null only if theafterPropertiesSet()
initialization method was called after construction of this importer/exporter. This is definitely true in a Spring context.- Returns:
- the configured
ResourceWriter
. - See Also:
-