public class ContainerMatcher
extends java.lang.Object
ModuleDescriptor
to. This implementation examines the deployment properties for a stream to determine
the preferences for each individual module. The deployment properties can (optionally) specify two preferences:
criteria and count.
The criteria indicates that a module should only be deployed to a container for which the criteria evaluates to
true
. The criteria value should be a valid SpEL expression. If a criteria value is not provided, any
container can deploy the module.
If a count for a module is not specified, by default one instance of that module will be deployed to one container. A
count of 0 indicates that all containers for which the criteria evaluates to true
should deploy the module.
If no criteria expression is specified, all containers will deploy the module.
In cases where all containers are not deploying a module, an attempt at container round robin distribution for module
deployments will be made (but not guaranteed).Constructor and Description |
---|
ContainerMatcher()
Creates a container matcher instance and prepares the SpEL evaluation context to support Map properties directly.
|
ContainerMatcher(ContainerFilter... containerFilters)
Creates a container matcher instance with the provided
ContainerFilter s
and prepares the SpEL evaluation context to support Map properties directly. |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<Container> |
match(ModuleDescriptor moduleDescriptor,
ModuleDeploymentProperties deploymentProperties,
java.lang.Iterable<Container> containers)
Matches the provided module against one of the candidate containers.
|
public ContainerMatcher()
public ContainerMatcher(ContainerFilter... containerFilters)
ContainerFilter
s
and prepares the SpEL evaluation context to support Map properties directly.public java.util.Collection<Container> match(ModuleDescriptor moduleDescriptor, ModuleDeploymentProperties deploymentProperties, java.lang.Iterable<Container> containers)
moduleDescriptor
- the module to match againstdeploymentProperties
- deployment properties for the module; this provides
hints such as the number of containers and other
matching criteriacontainers
- iterable list of containers to match against