public class DefaultContainerMatcher extends java.lang.Object implements ContainerMatcher
ContainerMatcher
that returns a collection of containers to deploy a
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 |
---|
DefaultContainerMatcher()
Creates a container matcher instance 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 DefaultContainerMatcher()
public java.util.Collection<Container> match(ModuleDescriptor moduleDescriptor, ModuleDeploymentProperties deploymentProperties, java.lang.Iterable<Container> containers)
match
in interface ContainerMatcher
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