Interface ServiceDescriptor<S extends Service>

Type Parameters:
S - the actual type of service being created
All Known Implementing Classes:
AbstractGenericMultiServicePluginDescriptor, AbstractGenericServicePluginDescriptor, AbstractServicePluginDescriptor, AbstractSpecificServicePluginDescriptor

public interface ServiceDescriptor<S extends Service>
A service creation descriptor, in particular for plugins. If you describe a generic MIMO service, implement createService(YamlService, Object...), for a generic SISO service createService(TypeTranslator, TypeTranslator, ReceptionCallback, YamlService, Object...) and if you describe a specific service implement createService(String, InputStream) as well as the fallbacks createService(String) and createService().
Author:
Holger Eichelberger, SSE
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a specific service, second fallback.
    Creates a generic service (still to be wrapped) from a YAML service description.
    <I, O> S
    createService(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, Object... args)
    Creates a generic service (still to be wrapped) from type translators, callback and YAML service description.
    createService(String serviceId)
    Creates a specific service from a service id, fallback.
    createService(String serviceId, InputStream ymlFile)
    Creates a specific service from a service id and a YAML artifact.
  • Method Details

    • createService

      S createService(YamlService yaml, Object... args)
      Creates a generic service (still to be wrapped) from a YAML service description.
      Parameters:
      yaml - the YAML service description
      args - generic arguments to be passed to and interpreted by the service
      Returns:
      the service instance, may be null if creation/casting is not possible
    • createService

      <I, O> S createService(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, Object... args)
      Creates a generic service (still to be wrapped) from type translators, callback and YAML service description.
      Type Parameters:
      I - input type
      O - output type
      Parameters:
      inTrans - the input translator
      outTrans - the output translator
      callback - called when a processed item is received from the service
      yaml - the YAML service description
      args - generic arguments to be passed to and interpreted by the service
      Returns:
      the service instance, may be null if creation/casting is not possible
    • createService

      S createService(String serviceId, InputStream ymlFile)
      Creates a specific service from a service id and a YAML artifact.
      Parameters:
      serviceId - the service id
      ymlFile - the YML file containing the YAML artifact with the service descriptor
      Returns:
      the service instance, may be null if creation/casting is not possible
    • createService

      S createService(String serviceId)
      Creates a specific service from a service id, fallback.
      Parameters:
      serviceId - the service id
      Returns:
      the service instance, may be null if creation/casting is not possible
    • createService

      S createService()
      Creates a specific service, second fallback.
      Returns:
      the service instance, may be null if creation/casting is not possible