|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.specrunner.SRServices
public final class SRServices
Centralizes the services provided by the SpecRunner framework. To get full
list of available services list use method getServices(). For
specific services, i.e. if you need an instance of IStringAlignerFactory, use
SRServices.get(IStringAlignerFactory.class).
This is thread-safe!
| Nested Class Summary | |
|---|---|
static class |
SRServices.ShutDown
Shutdown hook thread. |
| Method Summary | ||
|---|---|---|
protected static void |
addHook(SRServices service)
Add shutdown hook to the environment. |
|
|
bind(Class<T> clazz,
T instance)
Bind a service to the SpecRunner. |
|
static SRServices |
get()
Gets the instance of SRServices. |
|
static
|
get(Class<T> clazz)
Shortcut static method to recover a service (thread-safe). |
|
static IComparatorManager |
getComparatorManager()
Shortcut method to comparator manager. |
|
static IConverterManager |
getConverterManager()
Shortcut method to converter manager. |
|
static IExpressionFactory |
getExpressionFactory()
Shortcut method to expression factory. |
|
static IFeatureManager |
getFeatureManager()
Shortcut method to feature manager. |
|
Map<Class<?>,Object> |
getServices()
The map of all available services. |
|
static ISpecRunner |
getSpecRunner()
Shortcut method to the topmost interface. |
|
static ISpecRunnerPlugin |
getSpecRunnerPlugin()
Shortcut method to the topmost interface for programmatic plugins. |
|
String |
getThreadName()
Get the thread associated to this service.. |
|
|
lookup(Class<T> clazz)
Lookup for a service by its type. |
|
static void |
release()
Release all reusable resources pending. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public <T> void bind(Class<T> clazz,
T instance)
@Before annotation
instead of @BeforeClass. Features, however, can be set on
@BeforeClass without side-effects.
T - The type to be bound.clazz - The service type.instance - The service instance.public <T> T lookup(Class<T> clazz)
T - The service type.clazz - The service type.
IllegalArgumentException if the service was not
previously bound.public Map<Class<?>,Object> getServices()
public String getThreadName()
public static <T> T get(Class<T> clazz)
T - A class type.clazz - see lookup.
lookup.public static SRServices get()
SRServices.
protected static void addHook(SRServices service)
service - A service to be shut down.public static IFeatureManager getFeatureManager()
public static IConverterManager getConverterManager()
public static IComparatorManager getComparatorManager()
public static IExpressionFactory getExpressionFactory()
public static ISpecRunner getSpecRunner()
throws SpecRunnerException
SpecRunnerException - On recovering errors.
public static ISpecRunnerPlugin getSpecRunnerPlugin()
throws SpecRunnerException
SpecRunnerException - On recovering errors.public static void release()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||