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

Field Summary
static String PROP_SERVICE_CLASS
          Property String for the Class of the Service connected to.
static String PROP_SERVICE_VERSION
          Property String for the Service VersionProperty.
 
Method Summary
 ServiceClass build(ServiceConfig config)
          Builds a new instance of a Service from the given ServiceConfig.
 Class<ServiceClass> getServiceClass()
          Returns the Class of the Service connected to.
 Class<ServiceConfig> getServiceConfigurationClass()
          Returns the Class of ServiceConfig required to build to this type of Service.
 VersionProperty getServiceVersion()
          Returns the VersionProperty of the Service this connects to.
 

Field Detail

PROP_SERVICE_VERSION

static final String PROP_SERVICE_VERSION
Property String for the Service VersionProperty.

See Also:
Constant Field Values

PROP_SERVICE_CLASS

static final String PROP_SERVICE_CLASS
Property String for the Class of the Service connected to.

See Also:
Constant Field Values
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)
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

getServiceClass

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

Returns:
Class of the Service connected to

getServiceConfigurationClass

Class<ServiceConfig> getServiceConfigurationClass()
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. All Rights Reserved.