|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.robokind.api.common.services.ServiceContext<ServiceClass,ServiceConfig,Param>
ServiceClass
- Class of Service created in this ServiceContextServiceConfig
- Class of ServiceConfig used in this ServiceContextParam
- Class of the parameter used by this ServiceContextpublic class ServiceContext<ServiceClass,ServiceConfig,Param>
An ServiceContext keeps track of an attempt to create a new Service. It contains a complementary pair of ConfigurationLoader and ServiceFactory where: the loader takes the given Param type the loader and factory share the same ServiceConfig class the factory returns the given Service class
Constructor Summary | |
---|---|
ServiceContext()
Creates an empty ServiceContext |
|
ServiceContext(ConfigurationLoader<ServiceConfig,Param> loader,
ServiceFactory<ServiceClass,ServiceConfig> factory)
Creates a new ServiceContext from the given ConfigurationLoader and ServiceFactory. |
Method Summary | |
---|---|
boolean |
buildService()
Builds a Service using the ServiceFactory and ServiceConfig. |
VersionProperty |
getConfigFormat()
|
Class<ServiceConfig> |
getConfigurationClass()
|
Param |
getLoadParameter()
Returns the load parameter. |
ServiceClass |
getService()
Returns the Service from this context. |
Class<ServiceClass> |
getServiceClass()
|
ServiceConfig |
getServiceConfiguration()
Returns the ServiceConfig loaded from the LoadParameter. |
ConfigurationLoader<ServiceConfig,Param> |
getServiceConfigurationLoader()
Returns the ConfigurationLoader for this ServiceContext. |
ServiceFactory<ServiceClass,ServiceConfig> |
getServiceFactory()
Return the ServiceFactory used by this ServiceContext. |
VersionProperty |
getServiceVersion()
|
boolean |
loadConfiguration()
Loads the ServiceConfig using the ConfigurationLoader and LoadParameter. |
void |
setLoadParameter(Param param)
Sets the load parameter. |
void |
setServiceConfiguration(ServiceConfig config)
Sets the ServiceConfig to use instead of loading a config. |
void |
setServiceConfigurationLoader(ConfigurationLoader<ServiceConfig,Param> loader)
Sets the ConfigurationLoader for this ServiceContext. |
void |
setServiceFactory(ServiceFactory<ServiceClass,ServiceConfig> factory)
Sets the ServiceFactory to be used by this ServiceContext. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServiceContext()
public ServiceContext(ConfigurationLoader<ServiceConfig,Param> loader, ServiceFactory<ServiceClass,ServiceConfig> factory)
loader
- ConfigurationLoader of the correct typefactory
- ServiceFactory of the correct typeMethod Detail |
---|
public ConfigurationLoader<ServiceConfig,Param> getServiceConfigurationLoader()
public void setServiceConfigurationLoader(ConfigurationLoader<ServiceConfig,Param> loader)
loader
- ConfigurationLoader to usepublic ServiceFactory<ServiceClass,ServiceConfig> getServiceFactory()
public void setServiceFactory(ServiceFactory<ServiceClass,ServiceConfig> factory)
factory
- ServiceFactory to be used by this ServiceContextpublic Param getLoadParameter()
public void setLoadParameter(Param param)
param
- parameter passed to the ConfigurationLoader to load
the ServiceConfigpublic boolean loadConfiguration()
public ServiceConfig getServiceConfiguration()
public void setServiceConfiguration(ServiceConfig config)
config
- ServiceConfig to setpublic boolean buildService()
public ServiceClass getService()
public VersionProperty getServiceVersion()
public Class<ServiceClass> getServiceClass()
public VersionProperty getConfigFormat()
public Class<ServiceConfig> getConfigurationClass()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |