public class DefaultServiceRegistry<T> extends Object implements ServiceRegistry<T>
Constructor and Description |
---|
DefaultServiceRegistry(Class<T> serviceType) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(ServiceRegistryListener<T> listener)
Adds a new registry listener.
|
boolean |
addService(T service)
Adds a new service to this registry.
|
List<ServiceRegistryListener<T>> |
getListeners() |
T |
getService(String className)
Gets a registered service instance for the given class name.
|
Set<T> |
getServices()
Gets all registered services.
|
Class<T> |
getServiceType()
Gets the service type.
|
void |
removeListener(ServiceRegistryListener<T> listener)
Removes an existing registry listener.
|
boolean |
removeService(T service)
Removes an existing service from this registry.
|
public Class<T> getServiceType()
getServiceType
in interface ServiceRegistry<T>
public Set<T> getServices()
getServices
in interface ServiceRegistry<T>
public T getService(String className)
getService
in interface ServiceRegistry<T>
className
- The name of the service's class.null
if no such exists.public boolean addService(T service)
addService
in interface ServiceRegistry<T>
service
- The service to be added.true
if the service has been added.public boolean removeService(T service)
removeService
in interface ServiceRegistry<T>
service
- The service to be removed.true
if the service has been removed.public List<ServiceRegistryListener<T>> getListeners()
getListeners
in interface ServiceRegistry<T>
public void addListener(ServiceRegistryListener<T> listener)
addListener
in interface ServiceRegistry<T>
listener
- The registry listener to be added.public void removeListener(ServiceRegistryListener<T> listener)
removeListener
in interface ServiceRegistry<T>
listener
- The registry listener to be removed.Copyright © 2014–2015 European Space Agency (ESA). All rights reserved.