public class MultiServiceRegistry extends java.lang.Object implements IServiceRegistry, IRegistryDataProvider
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<ClassInfo,java.util.Set<ServiceQueryInfo<?>>> |
queries
The persistent service queries.
|
protected java.util.Map<IComponentIdentifier,IServiceRegistry> |
registries
The locally cloned registries of remote platforms.
|
protected RegistrySearchFunctionality |
searchfunc
The default search functionality.
|
Constructor and Description |
---|
MultiServiceRegistry()
Create a new registry.
|
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(IRegistryListener listener)
Add an event listener.
|
void |
addExcludedComponent(IComponentIdentifier cid)
Add an excluded component.
|
<T> ISubscriptionIntermediateFuture<T> |
addQuery(ServiceQuery<T> query)
Add a service query to the registry.
|
IFuture<java.lang.Void> |
addService(ClassInfo key,
IService service)
Add a service to the registry.
|
void |
addSubregistry(IComponentIdentifier cid,
IServiceRegistry registry)
Add a new registry.
|
<T> java.util.Set<ServiceQueryInfo<T>> |
getQueries(ClassInfo type)
Get queries per type.
|
java.util.Map<ClassInfo,java.util.Set<IService>> |
getServiceMap()
Get the service map.
|
java.util.Iterator<IService> |
getServices(ClassInfo type)
Get services per type.
|
IServiceRegistry |
getSubregistry(IComponentIdentifier cid)
Get a subregistry.
|
boolean |
isIncluded(IComponentIdentifier cid,
IService ser)
Test if a service is included.
|
protected void |
registryAdded(IServiceRegistry registry)
Called when a new registry was added.
|
void |
removeEventListener(IRegistryListener listener)
Remove an event listener.
|
IFuture<java.lang.Void> |
removeExcludedComponent(IComponentIdentifier cid)
Remove an excluded component.
|
void |
removeQueries(IComponentIdentifier owner)
Remove all service queries of a specific component from the registry.
|
<T> void |
removeQuery(ServiceQuery<T> query)
Remove a service query from the registry.
|
void |
removeService(ClassInfo key,
IService service)
Remove a service from the registry.
|
void |
removeSubregistry(IComponentIdentifier cid)
Remove an existing registry.
|
<T> IFuture<T> |
searchGlobalService(ClassInfo type,
IComponentIdentifier cid,
IAsyncFilter<T> filter)
Search for services.
|
<T> ISubscriptionIntermediateFuture<T> |
searchGlobalServices(ClassInfo type,
IComponentIdentifier cid,
IAsyncFilter<T> filter)
Search for services.
|
<T> T |
searchService(ClassInfo type,
IComponentIdentifier cid,
java.lang.String scope)
Search for services.
|
<T> T |
searchService(ClassInfo type,
IComponentIdentifier cid,
java.lang.String scope,
boolean excluded)
Search for services.
|
<T> IFuture<T> |
searchService(ClassInfo type,
IComponentIdentifier cid,
java.lang.String scope,
IAsyncFilter<T> filter)
Search for service.
|
<T> T |
searchService(ClassInfo type,
IComponentIdentifier cid,
java.lang.String scope,
IFilter<T> filter)
Search for service.
|
<T> java.util.Collection<T> |
searchServices(ClassInfo type,
IComponentIdentifier cid,
java.lang.String scope)
Search for services.
|
<T> ISubscriptionIntermediateFuture<T> |
searchServices(ClassInfo type,
IComponentIdentifier cid,
java.lang.String scope,
IAsyncFilter<T> filter)
Search for services.
|
<T> java.util.Collection<T> |
searchServices(ClassInfo type,
IComponentIdentifier cid,
java.lang.String scope,
IFilter<T> filter)
Search for service.
|
java.lang.String |
toString()
Get the string representation.
|
protected java.util.Map<IComponentIdentifier,IServiceRegistry> registries
protected java.util.Map<ClassInfo,java.util.Set<ServiceQueryInfo<?>>> queries
protected RegistrySearchFunctionality searchfunc
public java.util.Map<ClassInfo,java.util.Set<IService>> getServiceMap()
getServiceMap
in interface IServiceRegistry
public java.util.Iterator<IService> getServices(ClassInfo type)
getServices
in interface IRegistryDataProvider
getServices
in interface IServiceRegistry
type
- The interface type. If type is null all services are returned.public IFuture<java.lang.Void> addService(ClassInfo key, IService service)
addService
in interface IServiceRegistry
sid
- The service id.public void removeService(ClassInfo key, IService service)
removeService
in interface IServiceRegistry
sid
- The service id.public void addExcludedComponent(IComponentIdentifier cid)
addExcludedComponent
in interface IServiceRegistry
The
- component identifier.public IFuture<java.lang.Void> removeExcludedComponent(IComponentIdentifier cid)
removeExcludedComponent
in interface IServiceRegistry
The
- component identifier.public boolean isIncluded(IComponentIdentifier cid, IService ser)
isIncluded
in interface IRegistryDataProvider
isIncluded
in interface IServiceRegistry
ser
- The service.public <T> ISubscriptionIntermediateFuture<T> addQuery(ServiceQuery<T> query)
addQuery
in interface IServiceRegistry
query
- ServiceQuery.public <T> void removeQuery(ServiceQuery<T> query)
removeQuery
in interface IServiceRegistry
query
- ServiceQuery.public void removeQueries(IComponentIdentifier owner)
removeQueries
in interface IServiceRegistry
owner
- The query owner.public <T> java.util.Set<ServiceQueryInfo<T>> getQueries(ClassInfo type)
getQueries
in interface IRegistryDataProvider
getQueries
in interface IServiceRegistry
type
- The interface type. If type is null all services are returned.public <T> T searchService(ClassInfo type, IComponentIdentifier cid, java.lang.String scope)
searchService
in interface IServiceRegistry
public <T> T searchService(ClassInfo type, IComponentIdentifier cid, java.lang.String scope, boolean excluded)
searchService
in interface IServiceRegistry
public <T> java.util.Collection<T> searchServices(ClassInfo type, IComponentIdentifier cid, java.lang.String scope)
searchServices
in interface IServiceRegistry
public <T> T searchService(ClassInfo type, IComponentIdentifier cid, java.lang.String scope, IFilter<T> filter)
searchService
in interface IServiceRegistry
public <T> java.util.Collection<T> searchServices(ClassInfo type, IComponentIdentifier cid, java.lang.String scope, IFilter<T> filter)
searchServices
in interface IServiceRegistry
public <T> IFuture<T> searchService(ClassInfo type, IComponentIdentifier cid, java.lang.String scope, IAsyncFilter<T> filter)
searchService
in interface IServiceRegistry
public <T> ISubscriptionIntermediateFuture<T> searchServices(ClassInfo type, IComponentIdentifier cid, java.lang.String scope, IAsyncFilter<T> filter)
searchServices
in interface IServiceRegistry
public <T> IFuture<T> searchGlobalService(ClassInfo type, IComponentIdentifier cid, IAsyncFilter<T> filter)
searchGlobalService
in interface IServiceRegistry
public <T> ISubscriptionIntermediateFuture<T> searchGlobalServices(ClassInfo type, IComponentIdentifier cid, IAsyncFilter<T> filter)
searchGlobalServices
in interface IServiceRegistry
public void addEventListener(IRegistryListener listener)
addEventListener
in interface IServiceRegistry
listener
- The listener.public void removeEventListener(IRegistryListener listener)
removeEventListener
in interface IServiceRegistry
listener
- The listener.public IServiceRegistry getSubregistry(IComponentIdentifier cid)
getSubregistry
in interface IServiceRegistry
cid
- The platform id.public void addSubregistry(IComponentIdentifier cid, IServiceRegistry registry)
registry
- The registry.public void removeSubregistry(IComponentIdentifier cid)
removeSubregistry
in interface IServiceRegistry
cid
- The component id to remove.protected void registryAdded(IServiceRegistry registry)
public java.lang.String toString()
toString
in class java.lang.Object