Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.plugin.ServicesManager Interface Reference
Inheritance diagram for org.bukkit.plugin.ServicesManager:
org.bukkit.plugin.SimpleServicesManager

Public Member Functions

public< T > void register (Class< T > service, T provider, Plugin plugin, ServicePriority priority)
 
void unregisterAll (Plugin plugin)
 
void unregister (Class<?> service, Object provider)
 
void unregister (Object provider)
 
public< T > T load (Class< T > service)
 
public< T > RegisteredServiceProvider< T > getRegistration (Class< T > service)
 
List< RegisteredServiceProvider<?> > getRegistrations (Plugin plugin)
 
public< T > Collection< RegisteredServiceProvider< T > > getRegistrations (Class< T > service)
 
Collection< Class<?> > getKnownServices ()
 
public< T > boolean isProvidedFor (Class< T > service)
 

Detailed Description

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.

Definition at line 14 of file ServicesManager.java.

Member Function Documentation

Collection<Class<?> > org.bukkit.plugin.ServicesManager.getKnownServices ( )

Get a list of known services. A service is known if it has registered providers for it.

Returns
list of known services

Implemented in org.bukkit.plugin.SimpleServicesManager.

public<T> RegisteredServiceProvider<T> org.bukkit.plugin.ServicesManager.getRegistration ( Class< T >  service)

Queries for a provider registration. This may return if no provider has been registered for a service.

Parameters
<T>The service interface
serviceThe service interface
Returns
provider registration or null
List<RegisteredServiceProvider<?> > org.bukkit.plugin.ServicesManager.getRegistrations ( Plugin  plugin)

Get registrations of providers for a plugin.

Parameters
pluginThe plugin
Returns
provider registration or null

Implemented in org.bukkit.plugin.SimpleServicesManager.

public<T> Collection<RegisteredServiceProvider<T> > org.bukkit.plugin.ServicesManager.getRegistrations ( Class< T >  service)

Get registrations of providers for a service. The returned list is unmodifiable.

Parameters
<T>The service interface
serviceThe service interface
Returns
list of registrations
public<T> boolean org.bukkit.plugin.ServicesManager.isProvidedFor ( Class< T >  service)

Returns whether a provider has been registered for a service. Do not check this first only to call load(service) later, as that would be a non-thread safe situation.

Parameters
<T>service
serviceservice to check
Returns
whether there has been a registered provider
public<T> T org.bukkit.plugin.ServicesManager.load ( Class< T >  service)

Queries for a provider. This may return if no provider has been registered for a service. The highest priority provider is returned.

Parameters
<T>The service interface
serviceThe service interface
Returns
provider or null
public<T> void org.bukkit.plugin.ServicesManager.register ( Class< T >  service,
provider,
Plugin  plugin,
ServicePriority  priority 
)

Register a provider of a service.

Parameters
<T>Provider
serviceservice class
providerprovider to register
pluginplugin with the provider
prioritypriority of the provider
void org.bukkit.plugin.ServicesManager.unregister ( Class<?>  service,
Object  provider 
)

Unregister a particular provider for a particular service.

Parameters
serviceThe service interface
providerThe service provider implementation

Implemented in org.bukkit.plugin.SimpleServicesManager.

void org.bukkit.plugin.ServicesManager.unregister ( Object  provider)

Unregister a particular provider.

Parameters
providerThe service provider implementation

Implemented in org.bukkit.plugin.SimpleServicesManager.

void org.bukkit.plugin.ServicesManager.unregisterAll ( Plugin  plugin)

Unregister all the providers registered by a particular plugin.

Parameters
pluginThe plugin

Implemented in org.bukkit.plugin.SimpleServicesManager.


The documentation for this interface was generated from the following file: