public class ServicesFactoryImpl extends Object implements ServicesFactory
Constructor and Description |
---|
ServicesFactoryImpl() |
Modifier and Type | Method and Description |
---|---|
<T> T |
getInstance(Class<T> type)
Get service instance associated with given type, usually service interface or base abstract class. |
void |
init(Iterable<Module> modules)
Allows to configure and initialize a set of modules
|
void |
release()
Release all services. |
<T> void |
setInstance(Class<T> type,
T instance)
Associate concrete instance with service. |
public <T> T getInstance(Class<T> type) throws ServiceException
ServicesFactory
Get service instance associated with given type, usually service interface or base abstract class.
getInstance
in interface ServicesFactory
T
- service type.type
- Base class implemented by service.ServiceException
- if factory cannot create requested service.public <T> void setInstance(Class<T> type, T instance)
ServicesFactory
Associate concrete instance with service.
setInstance
in interface ServicesFactory
T
- service type.type
- Base class implemented by service.instance
- service instance.public void release()
ServicesFactory
Release all services.
release
in interface ServicesFactory
Copyright © 2015 JBoss by Red Hat. All Rights Reserved.