Class SharedServerResources
java.lang.Object
org.apache.tika.pipes.core.server.SharedServerResources
- All Implemented Interfaces:
Closeable,AutoCloseable
Holds shared resources for a shared PipesServer.
These resources are thread-safe and shared among all ConnectionHandlers:
- AutoDetectParser, Detector - immutable after initialization
- FetcherManager, EmitterManager - use ConcurrentHashMap internally
- MetadataFilter, ContentHandlerFactory - stateless
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes what the config loaded and holds open: the filter chain and the engines.createMergedParseContext(ParseContext requestContext, String presetName) Creates a merged ParseContext with defaults from tika-config overlaid with request values.Null when no"inference"bindings are configured.static SharedServerResourcesload(TikaLoader tikaLoader, PipesConfig pipesConfig) Loads shared server resources from configuration.
-
Method Details
-
load
public static SharedServerResources load(TikaLoader tikaLoader, PipesConfig pipesConfig) throws TikaException, IOException, SAXException Loads shared server resources from configuration.- Parameters:
tikaLoader- the tika loaderpipesConfig- the pipes configuration- Returns:
- initialized shared resources
- Throws:
TikaException- if initialization failsIOException- if I/O error occursSAXException- if XML parsing error occurs
-
createMergedParseContext
public ParseContext createMergedParseContext(ParseContext requestContext, String presetName) throws TikaConfigException Creates a merged ParseContext with defaults from tika-config overlaid with request values.- Parameters:
requestContext- the ParseContext from FetchEmitTuplepresetName- name of the preset to overlay at config-tier trust, or null- Returns:
- a new ParseContext with defaults + preset + request overrides
- Throws:
TikaConfigException
-
getTikaLoader
-
getPipesConfig
-
getAutoDetectParser
-
getDetector
-
getRMetaParser
-
getFetcherManager
-
getEmitterManager
-
getDefaultMetadataFilter
-
close
Closes what the config loaded and holds open: the filter chain and the engines.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getInferenceDispatcher
Null when no"inference"bindings are configured. -
getDefaultContentHandlerFactory
-
getDefaultMetadataWriteLimiterFactory
-
getEmitStrategy
-
getExceptionReporting
-
getConfigStore
-