public class SimpleServiceManager extends Object implements ServiceManager
ServiceManager.| Constructor and Description | 
|---|
| SimpleServiceManager(PluginManager pluginManager)Construct a simple  ServiceManager. | 
| Modifier and Type | Method and Description | 
|---|---|
| <T> Optional<ProviderRegistration<T>> | getRegistration(Class<T> service)Gets the  ProviderRegistrationfor the given service, if available. | 
| <T> Optional<T> | provide(Class<T> service)Return a provider for the given service, if one is available. | 
| <T> T | provideUnchecked(Class<T> service)Return a provider for the given service, raising an unchecked exception
 if a provider does not exist. | 
| <T> void | setProvider(Object plugin,
           Class<T> service,
           T provider)Register a provider with the service manager. | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisRegistered@Inject public SimpleServiceManager(PluginManager pluginManager)
ServiceManager.pluginManager - The plugin manager to get the
            PluginContainer for a given pluginpublic <T> void setProvider(Object plugin, Class<T> service, T provider)
ServiceManagerServices are by definition replaceable at any given time.
Services should only be registered during initialization. If services are registered later, then they may not be utilized.
setProvider in interface ServiceManagerT - The type of serviceplugin - The instance of a pluginservice - The serviceprovider - The implementationpublic <T> Optional<T> provide(Class<T> service)
ServiceManagerThe returned provider may be a proxy to the real underlying proxy, depending on the implementation of the service manager.
provide in interface ServiceManagerT - The type of serviceservice - The servicepublic <T> Optional<ProviderRegistration<T>> getRegistration(Class<T> service)
ServiceManagerProviderRegistration for the given service, if available.getRegistration in interface ServiceManagerT - The type of serviceservice - The serviceProviderRegistration, if available.public <T> T provideUnchecked(Class<T> service) throws ProvisioningException
ServiceManagerThe returned provider may be a proxy to the real underlying proxy, depending on the implementation of the service manager.
provideUnchecked in interface ServiceManagerT - The type of serviceservice - The serviceProvisioningException - Thrown if a provider cannot be provisioned