Package org.n52.io.handler
Class ConfigTypedFactory<T>
- java.lang.Object
-
- org.n52.io.handler.ConfigTypedFactory<T>
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
DefaultIoFactory
public abstract class ConfigTypedFactory<T> extends Object implements org.springframework.context.ApplicationContextAware
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedConfigTypedFactory(File configFile)protectedConfigTypedFactory(InputStream is)protectedConfigTypedFactory(String defaultConfig)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Tcreate(String type)TgetCacheEntry(String type)protected static InputStreamgetDefaultConfigFile(String configLocation)protected abstract StringgetFallbackConfigResource()Tries to load a default config file which can be found by the target type's classloader.Set<String>getKnownTypes()protected abstract Class<?>getTargetType()booleanhasCacheEntry(String type)protected TinitInstance(T instance)booleanisKnown(String type)voidsetApplicationContext(org.springframework.context.ApplicationContext context)
-
-
-
Field Detail
-
mappings
protected Properties mappings
-
-
Constructor Detail
-
ConfigTypedFactory
protected ConfigTypedFactory(File configFile)
-
ConfigTypedFactory
protected ConfigTypedFactory(InputStream is)
-
ConfigTypedFactory
protected ConfigTypedFactory(String defaultConfig)
-
-
Method Detail
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext context)
- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
getDefaultConfigFile
protected static InputStream getDefaultConfigFile(String configLocation)
-
isKnown
public boolean isKnown(String type)
-
hasCacheEntry
public boolean hasCacheEntry(String type)
-
create
public T create(String type) throws DatasetFactoryException
- Throws:
DatasetFactoryException
-
getFallbackConfigResource
protected abstract String getFallbackConfigResource()
Tries to load a default config file which can be found by the target type's classloader.- Returns:
- a relative path to the config within the jar
- See Also:
getTargetType()
-
getTargetType
protected abstract Class<?> getTargetType()
- Returns:
- the type this factory creates
-
-