Class AbstractStringProcessService<I,O>
java.lang.Object
de.iip_ecosphere.platform.services.environment.AbstractService
de.iip_ecosphere.platform.services.environment.AbstractRunnablesService
de.iip_ecosphere.platform.services.environment.AbstractProcessService<I,String,String,O>
de.iip_ecosphere.platform.services.environment.AbstractStringProcessService<I,O>
- Type Parameters:
I- the input data typeO- the output data type
- All Implemented Interfaces:
MonitoringService,ParameterConfigurerProvider,Service,ServiceBase
public abstract class AbstractStringProcessService<I,O>
extends AbstractProcessService<I,String,String,O>
Implements an abstract asynchronous process-based service which require a String-based communication with
the actual service process for a single pair of input-output types, e.g., via JSON.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested classes/interfaces inherited from class de.iip_ecosphere.platform.services.environment.AbstractProcessService
AbstractProcessService.RunnableWithStop -
Field Summary
Fields inherited from interface de.iip_ecosphere.platform.services.environment.switching.ServiceBase
APPLICATION_SEPARATOR, DEFAULT_APPLICATION_INSTANCE_ID -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractStringProcessService(de.iip_ecosphere.platform.transport.serialization.TypeTranslator<I, String> inTrans, de.iip_ecosphere.platform.transport.serialization.TypeTranslator<String, O> outTrans, de.iip_ecosphere.platform.transport.connectors.ReceptionCallback<O> callback, YamlService yaml) Creates an instance of the service with the required type translators. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidHandles the input stream upon process creation.voidRequests to process the given data item.voidRedirects an input stream to another stream (in parallel).Methods inherited from class de.iip_ecosphere.platform.services.environment.AbstractProcessService
addProcessSpecCmdArg, attachIngestor, attachMetricsProvider, configure, createAndConfigureProcess, createProcess, createProcess, getCallbacks, getExecutableName, getExecutableName, getExecutablePrefix, getExecutablePrefix, getExecutableSuffix, getInputTranslator, getOsArch, getOutputTranslator, getPid, getProcessId, getProcessSpec, getServiceIn, getServiceSpec, getWaitTimeBeforeDestroy, handleErrorStream, handleOutputStream, notifyCallbacks, processQuiet, redirectIO, redirectIO, selectNotNull, selectNotNull, setInheritIo, stop, waitAndDestroy, waitAndDestroyMethods inherited from class de.iip_ecosphere.platform.services.environment.AbstractRunnablesService
registerMethods inherited from class de.iip_ecosphere.platform.services.environment.AbstractService
activate, addConfigurer, addConfigurer, addConfigurer, addTypeSubstitution, createGenericInstance, createGenericInstance, createGenericInstanceByPlugin, createGenericMultiInstance, createGenericMultiInstance, createGenericMultiInstanceByPlugin, createInstance, createInstance, createInstance, createInstanceByPlugin, getArg, getDescription, getId, getKind, getName, getNetMgtKeyAddress, getResourceAsStream, getState, getStringArg, getSubstitutedType, getTypeCreator, getTypeSubstitutions, getVersion, initializeFrom, isDeployable, isTopLevel, notifyReconfigured, passivate, reconf, reconfigure, reconfigure, rollbackReconfigurationOnFailure, setLibJars, setState, start, transferDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.iip_ecosphere.platform.services.environment.Service
activate, addTypeSubstitution, createType, createType, getDescription, getKind, getName, getNetMgtKeyAddress, getParameterConfigurer, getParameterNames, getSubstitutedType, getTypeCreator, getTypeSubstitutions, getVersion, isDeployable, isTopLevel, migrate, passivate, reconfigure, switchTo, updateMethods inherited from interface de.iip_ecosphere.platform.services.environment.switching.ServiceBase
getId, getState, setState
-
Constructor Details
-
AbstractStringProcessService
protected AbstractStringProcessService(de.iip_ecosphere.platform.transport.serialization.TypeTranslator<I, String> inTrans, de.iip_ecosphere.platform.transport.serialization.TypeTranslator<String, O> outTrans, de.iip_ecosphere.platform.transport.connectors.ReceptionCallback<O> callback, YamlService yaml) Creates an instance of the service with the required type translators.- Parameters:
inTrans- the input translatoroutTrans- the output translatorcallback- called when data from the service is availableyaml- the service description
-
-
Method Details
-
process
Description copied from class:AbstractProcessServiceRequests to process the given data item.- Specified by:
processin classAbstractProcessService<I,String, String, O> - Parameters:
data- the data to process- Throws:
IOException- if processing/transferring to the service fails
-
redirectIO
Redirects an input stream to another stream (in parallel).- Parameters:
in- the input stream of the spawned process (e.g., input/error)
-
handleInputStream
Description copied from class:AbstractProcessServiceHandles the input stream upon process creation.- Specified by:
handleInputStreamin classAbstractProcessService<I,String, String, O> - Parameters:
in- the process input stream
-