public interface EntityInitializer
EntitySpec
programmatically, or declared as part
of YAML recipes in a brooklyn.initializers
section.
In the case of the latter, implementing classes should define a no-arg constructor
or a Map
constructor so that YAML parameters can be supplied.
Note that initializers are only invoked on first creation; they are not called
during a rebind. Instead, the typical pattern is that initializers will create
EntityAdjunct
instances such as Policy
and Feed
which will be attached during rebind.
Modifier and Type | Method and Description |
---|---|
void |
apply(EntityLocal entity)
Applies initialization logic to a just-built entity.
|
void apply(EntityLocal entity)
entity
- guaranteed to be the actual implementation instance,
thus guaranteed to be castable to EntityInternal which is often desired,
or to the type at hand (it is not even a proxy)