public class ServiceRegistryImpl extends Object implements ServiceRegistry
Constructor and Description |
---|
ServiceRegistryImpl() |
Modifier and Type | Method and Description |
---|---|
Set<Map.Entry<ServiceKey<?>,javax.inject.Provider<?>>> |
entrySet()
Registered service entries.
|
<T> T |
getOrNull(ServiceKey<T> key)
Retrieve an existing service or
null if not exists. |
Set<ServiceKey<?>> |
keySet()
Registered service keys.
|
<T> T |
put(ServiceKey<T> key,
javax.inject.Provider<T> service)
Put a service in this registry.
|
<T> T |
put(ServiceKey<T> key,
T service)
Put a service in this registry.
|
<T> T |
putIfAbsent(ServiceKey<T> key,
javax.inject.Provider<T> service)
Put/register a service in this registry if there isn't the same service already registered.
|
<T> T |
putIfAbsent(ServiceKey<T> type,
T service)
Put/register a service in this registry if there isn't the same service already registered.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get, get, getOrNull, put, put, putIfAbsent, putIfAbsent, require, require, require
@Nonnull public Set<ServiceKey<?>> keySet()
ServiceRegistry
keySet
in interface ServiceRegistry
@Nonnull public Set<Map.Entry<ServiceKey<?>,javax.inject.Provider<?>>> entrySet()
ServiceRegistry
entrySet
in interface ServiceRegistry
@Nullable public <T> T getOrNull(@Nonnull ServiceKey<T> key)
ServiceRegistry
null
if not exists.getOrNull
in interface ServiceRegistry
T
- Service/resource type.key
- Service/resource key.null
.@Nullable public <T> T put(@Nonnull ServiceKey<T> key, T service)
ServiceRegistry
put
in interface ServiceRegistry
T
- Service type.key
- Service/resource key.service
- Service instance.null
.@Nullable public <T> T put(@Nonnull ServiceKey<T> key, javax.inject.Provider<T> service)
ServiceRegistry
put
in interface ServiceRegistry
T
- Service type.key
- Service/resource key.service
- Service instance.null
.@Nullable public <T> T putIfAbsent(@Nonnull ServiceKey<T> type, T service)
ServiceRegistry
putIfAbsent
in interface ServiceRegistry
T
- Service type.type
- Service/resource key.service
- Service instance.null
.@Nullable public <T> T putIfAbsent(@Nonnull ServiceKey<T> key, javax.inject.Provider<T> service)
ServiceRegistry
putIfAbsent
in interface ServiceRegistry
T
- Service type.key
- Service/resource key.service
- Service instance.null
.Copyright © 2019. All rights reserved.