S - The service typepublic abstract class AbstractCloudServiceConnectorFactory<S> extends AbstractFactoryBean<S> implements CloudServiceConnectorFactory<S>
This factory uses the service creator provided through the constructor to create services. If the service name is provided it creates a service object based on the service bound to that name. Otherwise, it creates a singleton service and fails if it doesn't find a unique service of the expected type.
| Modifier and Type | Field and Description |
|---|---|
protected String |
serviceId |
logger| Constructor and Description |
|---|
AbstractCloudServiceConnectorFactory(Class<S> serviceConnectorType,
ServiceConnectorConfig serviceConnectorConfiguration) |
AbstractCloudServiceConnectorFactory(String serviceId,
Class<S> serviceConnectorType,
ServiceConnectorConfig serviceConnectorConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected S |
createInstance() |
S |
createService() |
Class<?> |
getObjectType() |
String |
getServiceId() |
void |
setCloud(Cloud cloud)
Set the cloud, for internal testing purpose only.
|
void |
setServiceConnectorType(Class<? extends S> serviceConnectorType) |
destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingletonprotected String serviceId
public AbstractCloudServiceConnectorFactory(String serviceId, Class<S> serviceConnectorType, ServiceConnectorConfig serviceConnectorConfiguration)
serviceId - Optional service name property. If this property is null, a unique service of the expected type
(redis, for example) needs to be bound to the application.serviceConnectorType - serviceConnectorConfiguration - public AbstractCloudServiceConnectorFactory(Class<S> serviceConnectorType, ServiceConnectorConfig serviceConnectorConfiguration)
public void setCloud(Cloud cloud)
For normal usage, the InitializingBean approach will create (if needed) a CloudFactory and obtain a Cloud from it.
cloud - public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanafterPropertiesSet in class AbstractFactoryBean<S>Exceptionprotected S createInstance() throws Exception
createInstance in class AbstractFactoryBean<S>Exceptionpublic S createService()
createService in interface CloudServiceConnectorFactory<S>public Class<?> getObjectType()
getObjectType in interface FactoryBean<S>getObjectType in class AbstractFactoryBean<S>public String getServiceId()
getServiceId in interface CloudServiceConnectorFactory<S>