public class PlatformServiceRegistry
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<IComponentIdentifier> |
excluded
The excluded components.
|
protected java.util.Map<ClassInfo,java.util.Set<IService>> |
services
The map of published services sorted by type.
|
Constructor and Description |
---|
PlatformServiceRegistry() |
Modifier and Type | Method and Description |
---|---|
void |
addExcludedComponent(IComponentIdentifier cid)
Add an excluded component.
|
void |
addService(ClassInfo key,
IService service)
Add a service to the registry.
|
protected boolean |
checkPublicationScope(IComponentIdentifier cid,
IService ser)
Check if service is ok with respect to publication scope.
|
protected boolean |
checkSearchScope(IComponentIdentifier cid,
IService ser,
java.lang.String scope)
Check if service is ok with respect to search scope of caller.
|
static java.lang.String |
getApplicationName(IComponentIdentifier cid)
Get the application name.
|
static java.lang.String |
getDotName(IComponentIdentifier cid) |
static PlatformServiceRegistry |
getRegistry(IComponentIdentifier platform)
Get the registry from a component.
|
static PlatformServiceRegistry |
getRegistry(IInternalAccess ia)
Get the registry from a component.
|
protected <T> T |
getService(java.lang.Class<T> type)
Get a service per type.
|
protected java.util.Set<IService> |
getServices(java.lang.Class<?> type) |
static java.lang.String |
getSubcomponentName(IComponentIdentifier cid)
Get the subcomponent name.
|
boolean |
isIncluded(IComponentIdentifier cid,
IService ser)
Test if a service is included.
|
void |
removeExcludedComponent(IComponentIdentifier cid)
Remove an excluded component.
|
void |
removeService(ClassInfo key,
IService service)
Remove a service from the registry.
|
<T> IFuture<T> |
searchGlobalService(java.lang.Class<T> type,
IComponentIdentifier cid,
IAsyncFilter<T> filter)
Search for services.
|
<T> ITerminableIntermediateFuture<T> |
searchGlobalServices(java.lang.Class<T> type,
IComponentIdentifier cid,
IAsyncFilter<T> filter)
Search for services.
|
protected <T> IFuture<T> |
searchLoopService(IAsyncFilter<T> filter,
java.util.Iterator<T> it,
IComponentIdentifier cid,
java.lang.String scope) |
protected <T> ISubscriptionIntermediateFuture<T> |
searchLoopServices(IAsyncFilter<T> filter,
java.util.Iterator<T> it,
IComponentIdentifier cid,
java.lang.String scope) |
protected <T> IFuture<T> |
searchRemoteService(IComponentIdentifier caller,
java.lang.Class<T> type,
IAsyncFilter<T> filter)
Search for services on remote platforms.
|
protected <T> ITerminableIntermediateFuture<T> |
searchRemoteServices(IComponentIdentifier caller,
java.lang.Class<T> type,
IAsyncFilter<T> filter)
Search for services on remote platforms.
|
<T> T |
searchService(java.lang.Class<T> type,
IComponentIdentifier cid,
java.lang.String scope)
Search for services.
|
<T> IFuture<T> |
searchService(java.lang.Class<T> type,
IComponentIdentifier cid,
java.lang.String scope,
IAsyncFilter<T> filter)
Search for service.
|
<T> T |
searchService(java.lang.Class<T> type,
IComponentIdentifier cid,
java.lang.String scope,
IFilter<T> filter)
Search for service.
|
<T> java.util.Collection<T> |
searchServices(java.lang.Class<T> type,
IComponentIdentifier cid,
java.lang.String scope)
Search for services.
|
<T> ISubscriptionIntermediateFuture<T> |
searchServices(java.lang.Class<T> type,
IComponentIdentifier cid,
java.lang.String scope,
IAsyncFilter<T> filter)
Search for services.
|
<T> java.util.Collection<T> |
searchServices(java.lang.Class<T> type,
IComponentIdentifier cid,
java.lang.String scope,
IFilter<T> filter)
Search for service.
|
protected java.util.Map<ClassInfo,java.util.Set<IService>> services
protected java.util.Set<IComponentIdentifier> excluded
public void addExcludedComponent(IComponentIdentifier cid)
The
- component identifier.public void removeExcludedComponent(IComponentIdentifier cid)
The
- component identifier.public boolean isIncluded(IComponentIdentifier cid, IService ser)
ser
- The service.public void addService(ClassInfo key, IService service)
sid
- The service id.public void removeService(ClassInfo key, IService service)
sid
- The service id.public <T> T searchService(java.lang.Class<T> type, IComponentIdentifier cid, java.lang.String scope)
public <T> java.util.Collection<T> searchServices(java.lang.Class<T> type, IComponentIdentifier cid, java.lang.String scope)
public <T> T searchService(java.lang.Class<T> type, IComponentIdentifier cid, java.lang.String scope, IFilter<T> filter)
public <T> java.util.Collection<T> searchServices(java.lang.Class<T> type, IComponentIdentifier cid, java.lang.String scope, IFilter<T> filter)
public <T> IFuture<T> searchService(java.lang.Class<T> type, IComponentIdentifier cid, java.lang.String scope, IAsyncFilter<T> filter)
protected <T> IFuture<T> searchLoopService(IAsyncFilter<T> filter, java.util.Iterator<T> it, IComponentIdentifier cid, java.lang.String scope)
filter
- it
- public <T> ISubscriptionIntermediateFuture<T> searchServices(java.lang.Class<T> type, IComponentIdentifier cid, java.lang.String scope, IAsyncFilter<T> filter)
protected <T> ISubscriptionIntermediateFuture<T> searchLoopServices(IAsyncFilter<T> filter, java.util.Iterator<T> it, IComponentIdentifier cid, java.lang.String scope)
filter
- it
- public <T> IFuture<T> searchGlobalService(java.lang.Class<T> type, IComponentIdentifier cid, IAsyncFilter<T> filter)
public <T> ITerminableIntermediateFuture<T> searchGlobalServices(java.lang.Class<T> type, IComponentIdentifier cid, IAsyncFilter<T> filter)
protected boolean checkSearchScope(IComponentIdentifier cid, IService ser, java.lang.String scope)
protected boolean checkPublicationScope(IComponentIdentifier cid, IService ser)
protected <T> ITerminableIntermediateFuture<T> searchRemoteServices(IComponentIdentifier caller, java.lang.Class<T> type, IAsyncFilter<T> filter)
caller
- The component that started the search.type
- The type.filter
- The filter.protected <T> IFuture<T> searchRemoteService(IComponentIdentifier caller, java.lang.Class<T> type, IAsyncFilter<T> filter)
type
- The type.scope
- The scope.protected <T> T getService(java.lang.Class<T> type)
type
- The interface type.protected java.util.Set<IService> getServices(java.lang.Class<?> type)
public static java.lang.String getApplicationName(IComponentIdentifier cid)
public static java.lang.String getSubcomponentName(IComponentIdentifier cid)
cid
- The component id.public static java.lang.String getDotName(IComponentIdentifier cid)
public static PlatformServiceRegistry getRegistry(IComponentIdentifier platform)
public static PlatformServiceRegistry getRegistry(IInternalAccess ia)