ServicesManager
public class SimpleServicesManager extends java.lang.Object implements ServicesManager
Constructor | Description |
---|---|
SimpleServicesManager() |
Modifier and Type | Method | Description |
---|---|---|
java.util.Set<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.List<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.
|
public <T> void register(java.lang.Class<T> service, T provider, Plugin plugin, ServicePriority priority)
register
in interface ServicesManager
T
- Providerservice
- service classprovider
- provider to registerplugin
- plugin with the providerpriority
- priority of the providerpublic void unregisterAll(Plugin plugin)
unregisterAll
in interface ServicesManager
plugin
- The pluginpublic void unregister(java.lang.Class<?> service, java.lang.Object provider)
unregister
in interface ServicesManager
service
- The service interfaceprovider
- The service provider implementationpublic void unregister(java.lang.Object provider)
unregister
in interface ServicesManager
provider
- The service provider implementationpublic <T> T load(java.lang.Class<T> service)
load
in interface ServicesManager
T
- The service interfaceservice
- The service interfacepublic <T> RegisteredServiceProvider<T> getRegistration(java.lang.Class<T> service)
getRegistration
in interface ServicesManager
T
- The service interfaceservice
- The service interfacepublic java.util.List<RegisteredServiceProvider<?>> getRegistrations(Plugin plugin)
getRegistrations
in interface ServicesManager
plugin
- The pluginpublic <T> java.util.List<RegisteredServiceProvider<T>> getRegistrations(java.lang.Class<T> service)
getRegistrations
in interface ServicesManager
T
- The service interfaceservice
- The service interfacepublic java.util.Set<java.lang.Class<?>> getKnownServices()
getKnownServices
in interface ServicesManager
public <T> boolean isProvidedFor(java.lang.Class<T> service)
isProvidedFor
in interface ServicesManager
T
- serviceservice
- service to checkCopyright © 2018. All rights reserved.