|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ServicesManager
Manages services and service providers. Services are an interface specifying a list of methods that a provider must implement. Providers are implementations of these services. A provider can be queried from the services manager in order to use a service (if one is available). If multiple plugins register a service, then the service with the highest priority takes precedence.
Method Summary | ||
---|---|---|
Collection<Class<?>> |
getKnownServices()
Get a list of known services. |
|
|
getRegistration(Class<T> service)
Queries for a provider registration. |
|
|
getRegistrations(Class<T> service)
Get registrations of providers for a service. |
|
List<RegisteredServiceProvider<?>> |
getRegistrations(Plugin plugin)
Get registrations of providers for a plugin. |
|
|
isProvidedFor(Class<T> service)
Returns whether a provider has been registered for a service. |
|
|
load(Class<T> service)
Queries for a provider. |
|
|
register(Class<T> service,
T provider,
Plugin plugin,
ServicePriority priority)
Register a provider of a service. |
|
void |
unregister(Class<?> service,
Object provider)
Unregister a particular provider for a particular service. |
|
void |
unregister(Object provider)
Unregister a particular provider. |
|
void |
unregisterAll(Plugin plugin)
Unregister all the providers registered by a particular plugin. |
Method Detail |
---|
<T> void register(Class<T> service, T provider, Plugin plugin, ServicePriority priority)
T
- Providerservice
- service classprovider
- provider to registerplugin
- plugin with the providerpriority
- priority of the providervoid unregisterAll(Plugin plugin)
plugin
- The pluginvoid unregister(Class<?> service, Object provider)
service
- The service interfaceprovider
- The service provider implementationvoid unregister(Object provider)
provider
- The service provider implementation<T> T load(Class<T> service)
T
- The service interfaceservice
- The service interface
<T> RegisteredServiceProvider<T> getRegistration(Class<T> service)
T
- The service interfaceservice
- The service interface
List<RegisteredServiceProvider<?>> getRegistrations(Plugin plugin)
plugin
- The plugin
<T> Collection<RegisteredServiceProvider<T>> getRegistrations(Class<T> service)
T
- The service interfaceservice
- The service interface
Collection<Class<?>> getKnownServices()
<T> boolean isProvidedFor(Class<T> service)
load(service)
later, as that
would be a non-thread safe situation.
T
- serviceservice
- service to check
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |