public class Context extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEPLOYMENT_PACKAGES
Name of the system property that lists the packages to be searched for provider deployments.
|
static String |
MICROSERVICE_PROVIDERS_REGISTRY
Property key where a registry with Microservice providers is.
|
static String |
MICROSERVICES
Property key where a registry with local Microservices is.
|
| Constructor and Description |
|---|
Context()
Creates the context and binds the registries to global properties.
|
| Modifier and Type | Method and Description |
|---|---|
List<ServiceHandle> |
assureHandles(MicroserviceMetaData metaData)
Makes that there are handles created for all the local services that meet the given the query.
|
Set<SilverService> |
getAllProviders(Class<? extends SilverService> clazz)
Gets all providers based on the interface or class specification.
|
ServiceHandle |
getInboundServiceHandle(int handle)
Gets the
ServiceHandle for the given handle number. |
Set<MicroserviceMetaData> |
getMicroservices()
Gets an unmodifiable copy of the current local Microservices registry.
|
Map<String,Object> |
getProperties()
Gets the global properties.
|
SilverService |
getProvider(Class<? extends SilverService> clazz)
Gets a provider based on the interface or class specification.
|
Map<String,MicroserviceProvider> |
getProvidersRegistry()
Gets the registry of Microservices providers.
|
Set<Object> |
lookupLocalMicroservice(MicroserviceMetaData metaData)
Looks up Microservices based on the provided meta-data query.
|
Set<Object> |
lookupMicroservice(MicroserviceMetaData metaData)
Looks up Microservices based on the provided meta-data query.
|
void |
registerMicroservice(MicroserviceMetaData metaData)
Adds a Microservice to the registry.
|
public static final String MICROSERVICE_PROVIDERS_REGISTRY
public static final String DEPLOYMENT_PACKAGES
public static final String MICROSERVICES
public Context()
public Map<String,Object> getProperties()
public Map<String,MicroserviceProvider> getProvidersRegistry()
public void registerMicroservice(MicroserviceMetaData metaData)
metaData - Description of the service to be registered.public Set<MicroserviceMetaData> getMicroservices()
public Set<Object> lookupMicroservice(MicroserviceMetaData metaData)
metaData - Meta-data query.public Set<Object> lookupLocalMicroservice(MicroserviceMetaData metaData)
metaData - Meta-data query.public SilverService getProvider(Class<? extends SilverService> clazz)
SilverService are used for the query.
The first class from the registry that meets the query is returned.clazz - An interface or class the implementation of which we are looking for.public Set<SilverService> getAllProviders(Class<? extends SilverService> clazz)
SilverService are used for the query.clazz - An interface or class the implementation of which we are looking for.public List<ServiceHandle> assureHandles(MicroserviceMetaData metaData)
metaData - The query for which to look up the service handles.Service Handles that meet the specified query.public ServiceHandle getInboundServiceHandle(int handle)
ServiceHandle for the given handle number.handle - The handle number.ServiceHandle with the given handle number.Copyright © 2015–2016 px3. All rights reserved.