public class InternalEntityFactory extends InternalFactory
InternalFactory.FactoryConstructionTracker
Constructor and Description |
---|
InternalEntityFactory(ManagementContextInternal managementContext,
EntityTypeRegistry entityTypeRegistry,
InternalPolicyFactory policyFactory) |
Modifier and Type | Method and Description |
---|---|
<T extends Entity> |
constructEntity(java.lang.Class<? extends T> clazz,
EntitySpec<T> spec)
Constructs an entity, i.e.
|
<T extends Entity> |
constructEntity(java.lang.Class<T> clazz,
java.lang.Iterable<java.lang.Class<?>> interfaces,
java.lang.String entityId)
Constructs a new-style entity (fails if no no-arg constructor).
|
<T extends Entity> |
createEntity(EntitySpec<T> spec)
creates a new entity instance from a spec, with all children, policies, etc,
fully initialized (
AbstractEntity.init() invoked) and ready for
management -- commonly the caller will next call
Entities.manage(Entity) (if it's in a managed application)
or Entities.startManagement(brooklyn.entity.Application, brooklyn.management.ManagementContext)
(if it's an application) |
<T extends Entity> |
createEntityProxy(EntitySpec<T> spec,
T entity) |
isNewStyle
public InternalEntityFactory(ManagementContextInternal managementContext, EntityTypeRegistry entityTypeRegistry, InternalPolicyFactory policyFactory)
public <T extends Entity> T createEntityProxy(EntitySpec<T> spec, T entity)
public <T extends Entity> T createEntity(EntitySpec<T> spec)
AbstractEntity.init()
invoked) and ready for
management -- commonly the caller will next call
Entities.manage(Entity)
(if it's in a managed application)
or Entities.startManagement(brooklyn.entity.Application, brooklyn.management.ManagementContext)
(if it's an application)public <T extends Entity> T constructEntity(java.lang.Class<? extends T> clazz, EntitySpec<T> spec)
createEntity(EntitySpec)
and also used during rebind.
If EntitySpec.id(String)
was set then uses that to override the entity's id,
but that behaviour is deprecated.
The new-style no-arg constructor is preferred, and
configuration from the EntitySpec
is not normally applied,
although for old-style entities flags from the spec are passed to the constructor.
public <T extends Entity> T constructEntity(java.lang.Class<T> clazz, java.lang.Iterable<java.lang.Class<?>> interfaces, java.lang.String entityId)
As constructEntity(Class, EntitySpec)
but when no spec is used.