SimpleServicesManager
public interface ServicesManager
Modifier and Type | Method | Description |
---|---|---|
java.util.Collection<java.lang.Class<?>> |
getKnownServices() |
Get a list of known services.
|
<T> RegisteredServiceProvider<T> |
getRegistration(java.lang.Class<T> service) |
Queries for a provider registration.
|
<T> java.util.Collection<RegisteredServiceProvider<T>> |
getRegistrations(java.lang.Class<T> service) |
Get registrations of providers for a service.
|
java.util.List<RegisteredServiceProvider<?>> |
getRegistrations(Plugin plugin) |
Get registrations of providers for a plugin.
|
<T> boolean |
isProvidedFor(java.lang.Class<T> service) |
Returns whether a provider has been registered for a service.
|
<T> T |
load(java.lang.Class<T> service) |
Queries for a provider.
|
<T> void |
register(java.lang.Class<T> service,
T provider,
Plugin plugin,
ServicePriority priority) |
Register a provider of a service.
|
void |
unregister(java.lang.Class<?> service,
java.lang.Object provider) |
Unregister a particular provider for a particular service.
|
void |
unregister(java.lang.Object provider) |
Unregister a particular provider.
|
void |
unregisterAll(Plugin plugin) |
Unregister all the providers registered by a particular plugin.
|
<T> void register(java.lang.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(java.lang.Class<?> service, java.lang.Object provider)
service
- The service interfaceprovider
- The service provider implementationvoid unregister(java.lang.Object provider)
provider
- The service provider implementation<T> T load(java.lang.Class<T> service)
T
- The service interfaceservice
- The service interface<T> RegisteredServiceProvider<T> getRegistration(java.lang.Class<T> service)
T
- The service interfaceservice
- The service interfacejava.util.List<RegisteredServiceProvider<?>> getRegistrations(Plugin plugin)
plugin
- The plugin<T> java.util.Collection<RegisteredServiceProvider<T>> getRegistrations(java.lang.Class<T> service)
T
- The service interfaceservice
- The service interfacejava.util.Collection<java.lang.Class<?>> getKnownServices()
<T> boolean isProvidedFor(java.lang.Class<T> service)
load(service)
later, as that
would be a non-thread safe situation.T
- serviceservice
- service to checkCopyright © 2018. All rights reserved.