public interface LayerAssembly
ApplicationAssembly.layer(String)
.Modifier and Type | Method and Description |
---|---|
ApplicationAssembly |
application() |
EntityDeclaration |
entities(Predicate<? super EntityAssembly> specification)
Given a Specification for EntityAssembly's, returns a EntityDeclaration that can
be used to work with all of the assemblies in this Layer matched by the specification.
|
ImportedServiceDeclaration |
importedServices(Predicate<? super ImportedServiceAssembly> specification)
Given a Specification for ImportedServiceAssembly's, returns a ImportedServiceDeclaration that can
be used to work with all of the assemblies in this Layer matched by the specification.
|
ModuleAssembly |
module(String name)
Get an assembly for a particular Module.
|
String |
name() |
ObjectDeclaration |
objects(Predicate<? super ObjectAssembly> specification)
Given a Specification for ObjectAssembly's, returns a ObjectDeclaration that can
be used to work with all of the assemblies in this Layer matched by the specification.
|
ServiceDeclaration |
services(Predicate<? super ServiceAssembly> specification)
Given a Specification for ServiceAssembly's, returns a ServiceDeclaration that can
be used to work with all of the assemblies in this Layer matched by the specification.
|
LayerAssembly |
setMetaInfo(Object info)
Set metadata for the
Layer . |
LayerAssembly |
setName(String name)
Sets the name of the
Layer being assembled. |
TransientDeclaration |
transients(Predicate<? super TransientAssembly> specification)
Given a Specification for TransientAssembly's, returns a TransientDeclaration that can
be used to work with all of the assemblies in this Layer matched by the specification.
|
LayerAssembly |
uses(LayerAssembly... layerAssembly)
Declaration of which other
Layers that this Layer is able to use. |
ValueDeclaration |
values(Predicate<? super ValueAssembly> specification)
Given a Specification for ValueAssembly's, returns a ValueDeclaration that can
be used to work with all of the assemblies in this Layer matched by the specification.
|
<ThrowableType extends Throwable> |
visit(AssemblyVisitor<ThrowableType> visitor)
Deprecated.
New mechanism is considered, using Java 8 Stream API.
|
LayerAssembly |
withActivators(Class<? extends Activator<Layer>>... activators)
Set the layer activators.
|
ModuleAssembly module(String name)
name
- The name of the Module to retrieve or create.ApplicationAssembly application()
ApplicationAssembly
that this LayerAssembly
belongs to.String name()
Layer
that is being assembled.LayerAssembly setName(String name)
Layer
being assembled.
By convention, a Layer
should include the word "Layer" as the suffix, e.g "DomainLayer", so tooling
can use camel-case detection and present the name and not require it to explicitly say that it is a layer.name
- The name that the Layer should have.LayerAssembly
instance to support fluent APIsLayerAssembly setMetaInfo(Object info)
Layer
.
Any arbitrary object can be attached as metainfo on a Layer
that is available in runtime, by calling
MetaInfoHolder.metaInfo(Class)
. Multiple registrations of the same type is
not possible, and the lookup will search registered meta-info objects against the lookup type, prioritizing
interfaces over classes and the most sub-typed nterface first.info
- The meta-info type to be looked up. Typically a type that is explicitly used for meta-info.LayerAssembly
instance to support fluent APIsLayerAssembly uses(LayerAssembly... layerAssembly)
Layers
that this Layer
is able to use.
This is how architecture reinforcement works. Any composites that are declared
Visibility.application
in a "used" layer can be reached from this Layer.layerAssembly
- The Layer(s)
that this Layer
can reach/see.LayerAssembly
instance to support fluent APIsLayerAssembly withActivators(Class<? extends Activator<Layer>>... activators)
activators
- the layer activators@Deprecated <ThrowableType extends Throwable> void visit(AssemblyVisitor<ThrowableType> visitor) throws ThrowableType extends Throwable
ThrowableType
- The exceptions that may be thrown.visitor
- The visitor to be called.ThrowableType
- when there is an underlying problem in the model.ThrowableType extends Throwable
EntityDeclaration entities(Predicate<? super EntityAssembly> specification)
specification
- The Specification that specifies the EntityComposite types of interest.ServiceDeclaration services(Predicate<? super ServiceAssembly> specification)
specification
- The Specification that specifies the ServiceComposite types of interest.TransientDeclaration transients(Predicate<? super TransientAssembly> specification)
specification
- The Specification that specifies the TransientComposite types of interest.ValueDeclaration values(Predicate<? super ValueAssembly> specification)
specification
- The Specification that specifies the ValueComposite types of interest.ObjectDeclaration objects(Predicate<? super ObjectAssembly> specification)
specification
- The Specification that specifies the Object types of interest.ImportedServiceDeclaration importedServices(Predicate<? super ImportedServiceAssembly> specification)
specification
- The Specification that specifies the Imported Service types of interest.