public final class HippoServiceRegistry extends Object
Modifier and Type | Method and Description |
---|---|
static List<HippoServiceRegistration> |
getRegistrations(Class ifaceClass)
Retrieve a list of whiteboard services by it's default (class) name.
|
static <T> T |
getService(Class<T> ifaceClass)
Retrieve a service by it's default (class) name.
|
static <T> T |
getService(Class<T> ifaceClass,
String name) |
static int |
getVersion() |
static void |
registerService(Object service,
Class<?> ifaceClass)
Register a service under a
SingletonService annotated interface. |
static void |
registerService(Object service,
Class<?> ifaceClass,
String name) |
static void |
unregisterService(Object service,
Class<?> ifaceClass) |
static void |
unregisterService(Object service,
Class<?> ifaceClass,
String name) |
public static void registerService(Object service, Class<?> ifaceClass)
SingletonService
annotated interface.
If the service is an instance of the interface, it will be registered as the singleton.
If the interface has an WhiteboardService
annotation, it is still possible to
register the service.
service
- ifaceClass
- public static <T> T getService(Class<T> ifaceClass)
ifaceClass
- public static List<HippoServiceRegistration> getRegistrations(Class ifaceClass)
ifaceClass
- public static void registerService(Object service, Class<?> ifaceClass, String name)
public static void unregisterService(Object service, Class<?> ifaceClass, String name)
public static int getVersion()
HippoServiceRegistry
: Every time the registry gets a service added or removed
the version is incremented. This is for classes using the HippoServiceRegistry that they can easily check whether
they need to register or unregister new HippoServiceRegistration
sCopyright © 2012–2015 Hippo B.V. (http://www.onehippo.com). All rights reserved.