Brooklyn

brooklyn.entity.proxying
[Java] Interface EntityTypeRegistry


public interface EntityTypeRegistry

A registry of the entity implementations to be used when creating an entity of a given type. A given implementation can only be associated with one entity type interface.


Method Summary
java.lang.Class getEntityTypeOf(java.lang.Class type)

Returns the interface of this entity implementation.

java.lang.Class getImplementedBy(java.lang.Class type)

Returns the implementation to be used for the given entity type.

EntityTypeRegistry registerImplementation(java.lang.Class type, java.lang.Class implClazz)

Registers the implementation to use for a given entity type.

 

Method Detail

getEntityTypeOf

public java.lang.Class getEntityTypeOf(java.lang.Class type)
Returns the interface of this entity implementation. E.g. for use as the fully qualified name in entity.getEntityType().getName().
throws:
IllegalArgumentException If no interface is registered against this implementation, and no super-type of the class is annotated with ImplementedBy to point at the given class


getImplementedBy

public java.lang.Class getImplementedBy(java.lang.Class type)
Returns the implementation to be used for the given entity type.
throws:
IllegalArgumentException If no implementation registered, and the given interface is not annotated with ImplementedBy
throws:
IllegalStateException If the given type is not an interface, or if the implementation class is not a concrete class implementing it
Parameters:
entity - the DriverDependentEntity to create the EntityDriver for.
location - the Location where the DriverDependentEntity is running.
Returns:
the creates EntityDriver.


registerImplementation

public EntityTypeRegistry registerImplementation(java.lang.Class type, java.lang.Class implClazz)
Registers the implementation to use for a given entity type. The implementation must be a non-abstract class implementing the given type, and must have a no-argument constructor.
throws:
IllegalArgumentException If this implementation has already been registered for a different type
throws:
IllegalStateException If the implClazz is not a concrete class, or does not implement type


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.