org.robokind.api.common.services
Interface ServiceFactory<ServiceClass,ServiceConfig>

Type Parameters:
ServiceConfig - Type of Configuration class this factory takes
ServiceClass - Type of Service this factory creates
All Known Implementing Classes:
EmptyFactory

public interface ServiceFactory<ServiceClass,ServiceConfig>

A ServiceFactory creates some service with the given Class and the given VersionProperty, using a ServiceConfig

Author:
Matthew Stevenson

Method Summary
 ServiceClass build(ServiceConfig config)
          Builds a new instance of a Service from the given ServiceConfig.
 Class<ServiceConfig> getConfigurationClass()
          Returns the Class of ServiceConfig required to build to this type of Service.
 Class<ServiceClass> getServiceClass()
          Returns the Class of the Service connected to.
 VersionProperty getServiceVersion()
          Returns the VersionProperty of the Service this connects to.
 

Method Detail

getServiceVersion

VersionProperty getServiceVersion()
Returns the VersionProperty of the Service this connects to.

Returns:
VersionProperty of the Service this connects to

build

ServiceClass build(ServiceConfig config)
                   throws Exception
Builds a new instance of a Service from the given ServiceConfig. The Service built is defined by the ServiceVersion. * Examples: Servo Controllers, Microphones, Text-to-speech, Face Tracking.

Parameters:
config - Configuration parameters used to build to the IO.
Returns:
input and/or output interface specified by the config
Throws:
Exception

getServiceClass

Class<ServiceClass> getServiceClass()
Returns the Class of the Service connected to.

Returns:
Class of the Service connected to

getConfigurationClass

Class<ServiceConfig> getConfigurationClass()
Returns the Class of ServiceConfig required to build to this type of Service.

Returns:
Class of ServiceConfig required to build to this type of Service


Copyright © 2011-2013. All Rights Reserved.