|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectbrooklyn.entity.proxying.EntitySpec<T>
T - The type of entity to be createdpublic class EntitySpec<T extends Entity>
Gives details of an entity to be created. It describes the entity's configuration, and is
reusable to create multiple entities with the same configuration.
To create an EntitySpec, it is strongly encouraged to use create(Class) etc.
Users who need to implement this are strongly encouraged to extend
EntitySpec.
| Constructor Summary | |
|---|---|
EntitySpec(Class<T> type)
|
|
| Method Summary | ||
|---|---|---|
EntitySpec<T> |
addInitializer(Class<? extends EntityInitializer> initializerType)
The supplied class must have a public no-arg constructor. |
|
EntitySpec<T> |
addInitializer(EntityInitializer initializer)
|
|
EntitySpec<T> |
addInitializers(Collection<EntityInitializer> initializer)
|
|
EntitySpec<T> |
additionalInterfaces(Class<?>... vals)
|
|
EntitySpec<T> |
additionalInterfaces(Iterable<Class<?>> val)
|
|
EntitySpec<T> |
configure(CharSequence key,
Object val)
|
|
|
configure(brooklyn.config.ConfigKey.HasConfigKey<V> key,
Task<? extends V> val)
|
|
|
configure(brooklyn.config.ConfigKey.HasConfigKey<V> key,
V val)
|
|
|
configure(brooklyn.config.ConfigKey<V> key,
Task<? extends V> val)
|
|
|
configure(brooklyn.config.ConfigKey<V> key,
V val)
|
|
EntitySpec<T> |
configure(Map<?,?> val)
|
|
static
|
create(Class<T> type)
Creates a new EntitySpec instance for an entity of the given type. |
|
static
|
create(Class<T> type,
Class<U> implType)
Creates a new EntitySpec instance for an entity of the given type. |
|
static
|
create(EntitySpec<T> spec)
Wraps an entity spec so its configuration can be overridden without modifying the original entity spec. |
|
static
|
create(Map<?,?> config,
Class<T> type)
Creates a new EntitySpec instance with the given config, for an entity of the given type. |
|
EntitySpec<T> |
displayName(String val)
|
|
|
enricher(Enricher val)
adds a policy to the spec |
|
|
enricher(EnricherSpec<?> val)
adds a policy to the spec |
|
|
enrichers(Iterable<? extends Enricher> val)
adds the supplied policies to the spec |
|
|
enricherSpecs(Iterable<? extends EnricherSpec<?>> val)
adds the supplied policies to the spec |
|
Set<Class<?>> |
getAdditionalInterfaces()
|
|
Map<brooklyn.config.ConfigKey<?>,Object> |
getConfig()
|
|
String |
getDisplayName()
|
|
List<Enricher> |
getEnrichers()
|
|
List<EnricherSpec<?>> |
getEnricherSpecs()
|
|
Map<String,?> |
getFlags()
|
|
Class<? extends T> |
getImplementation()
|
|
List<EntityInitializer> |
getInitializers()
|
|
Entity |
getParent()
|
|
List<Policy> |
getPolicies()
|
|
List<PolicySpec<?>> |
getPolicySpecs()
|
|
Class<T> |
getType()
|
|
EntitySpec<T> |
immutable()
"seals" this spec, preventing any future changes |
|
EntitySpec<T> |
impl(Class<? extends T> val)
|
|
static
|
newInstance(Class<T> type)
|
|
EntitySpec<T> |
parent(Entity val)
|
|
|
policies(Iterable<? extends Policy> val)
adds the supplied policies to the spec |
|
|
policy(Policy val)
adds a policy to the spec |
|
|
policy(PolicySpec<?> val)
adds a policy to the spec |
|
|
policySpecs(Iterable<? extends PolicySpec<?>> val)
adds the supplied policies to the spec |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public EntitySpec(Class<T> type)
| Method Detail |
|---|
public static <T extends Entity> EntitySpec<T> create(Class<T> type)
EntitySpec instance for an entity of the given type. The returned
EntitySpec can then be customized.
type - An Entity interface
public static <T extends Entity,U extends T> EntitySpec<T> create(Class<T> type,
Class<U> implType)
EntitySpec instance for an entity of the given type. The returned
EntitySpec can then be customized.
type - An Entity interfaceimplType - An Entity implementation, which implements the type interface
public static <T extends Entity> EntitySpec<T> create(Map<?,?> config,
Class<T> type)
EntitySpec instance with the given config, for an entity of the given type.
This is primarily for groovy code; equivalent to EntitySpec.create(type).configure(config).
config - The spec's configuration (see configure(Map)).type - An Entity interfacepublic static <T extends Entity> EntitySpec<T> create(EntitySpec<T> spec)
public static <T extends Entity> EntitySpec<T> newInstance(Class<T> type)
public Class<T> getType()
public String getDisplayName()
@Nullable public Class<? extends T> getImplementation()
on the entity interface classes for how defaults are defined.,
for how implementations can be defined globallypublic Set<Class<?>> getAdditionalInterfaces()
getType()) that this entity implements;
important for when accessing entity through a proxy to determine which interfaces the proxy exposes.public List<EntityInitializer> getInitializers()
EntityInitializer objects which customize the entity to be createdpublic Entity getParent()
public Map<String,?> getFlags()
declarations on the entity typepublic Map<brooklyn.config.ConfigKey<?>,Object> getConfig()
public List<PolicySpec<?>> getPolicySpecs()
public List<Policy> getPolicies()
public List<EnricherSpec<?>> getEnricherSpecs()
public List<Enricher> getEnrichers()
public EntitySpec<T> displayName(String val)
public EntitySpec<T> impl(Class<? extends T> val)
public EntitySpec<T> additionalInterfaces(Class<?>... vals)
public EntitySpec<T> additionalInterfaces(Iterable<Class<?>> val)
public EntitySpec<T> addInitializer(EntityInitializer initializer)
public EntitySpec<T> addInitializers(Collection<EntityInitializer> initializer)
public EntitySpec<T> addInitializer(Class<? extends EntityInitializer> initializerType)
public EntitySpec<T> parent(Entity val)
public EntitySpec<T> configure(Map<?,?> val)
public EntitySpec<T> configure(CharSequence key,
Object val)
public <V> EntitySpec<T> configure(brooklyn.config.ConfigKey<V> key,
V val)
public <V> EntitySpec<T> configure(brooklyn.config.ConfigKey<V> key,
Task<? extends V> val)
public <V> EntitySpec<T> configure(brooklyn.config.ConfigKey.HasConfigKey<V> key,
V val)
public <V> EntitySpec<T> configure(brooklyn.config.ConfigKey.HasConfigKey<V> key,
Task<? extends V> val)
public <V> EntitySpec<T> policy(Policy val)
public <V> EntitySpec<T> policy(PolicySpec<?> val)
public <V> EntitySpec<T> policySpecs(Iterable<? extends PolicySpec<?>> val)
public <V> EntitySpec<T> policies(Iterable<? extends Policy> val)
public <V> EntitySpec<T> enricher(Enricher val)
public <V> EntitySpec<T> enricher(EnricherSpec<?> val)
public <V> EntitySpec<T> enricherSpecs(Iterable<? extends EnricherSpec<?>> val)
public <V> EntitySpec<T> enrichers(Iterable<? extends Enricher> val)
public EntitySpec<T> immutable()
public String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||