本文整理了Java中org.apache.brooklyn.api.mgmt.EntityManager.getEntityTypeRegistry()
方法的一些代码示例,展示了EntityManager.getEntityTypeRegistry()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EntityManager.getEntityTypeRegistry()
方法的具体详情如下:
包路径:org.apache.brooklyn.api.mgmt.EntityManager
类名称:EntityManager
方法名:getEntityTypeRegistry
[英]Returns the type registry, used to identify the entity implementation when instantiating an entity of a given type.
[中]返回类型注册表,用于在实例化给定类型的实体时标识实体实现。
代码示例来源:origin: org.apache.brooklyn/brooklyn-core
@Override
public EntityTypeRegistry getEntityTypeRegistry() {
if (isInitialManagementContextReal()) {
return initialManagementContext.getEntityManager().getEntityTypeRegistry();
} else {
throw new IllegalStateException("Non-deployment context "+this+" (with no initial management context supplied) is not valid for this operation.");
}
}
代码示例来源:origin: org.apache.brooklyn/brooklyn-core
/**
* Gets the entity type name, to be returned by {@code getEntityType().getName()}.
* To be called by brooklyn internals only.
* Can be overridden to customize the name.
*/
protected String getEntityTypeName() {
try {
Class<?> typeClazz = getManagementContext().getEntityManager().getEntityTypeRegistry().getEntityTypeOf(getClass());
String typeName = typeClazz.getCanonicalName();
if (typeName == null) typeName = typeClazz.getName();
return typeName;
} catch (IllegalArgumentException e) {
String typeName = getClass().getCanonicalName();
if (typeName == null) typeName = getClass().getName();
LOG.debug("Entity type interface not found for entity "+this+"; instead using "+typeName+" as entity type name");
return typeName;
}
}
代码示例来源:origin: org.apache.brooklyn/brooklyn-core
private static <T extends Entity> Class<? extends T> getEntityImplementedBy(ManagementContext mgmt, Class<T> type) {
return mgmt.getEntityManager().getEntityTypeRegistry().getImplementedBy(type);
}
}
代码示例来源:origin: org.apache.brooklyn/brooklyn-core
@BeforeMethod(alwaysRun=true)
public void setUp() throws Exception {
mgmt = new LocalManagementContextForTests();
InternalPolicyFactory policyFactory = new InternalPolicyFactory(mgmt);
factory = new InternalEntityFactory(mgmt, mgmt.getEntityManager().getEntityTypeRegistry(), policyFactory);
}
代码示例来源:origin: org.apache.brooklyn/brooklyn-core
managementContext = new LocalManagementContextForTests();
InternalPolicyFactory policyFactory = new InternalPolicyFactory(managementContext);
InternalEntityFactory factory = new InternalEntityFactory(managementContext, managementContext.getEntityManager().getEntityTypeRegistry(), policyFactory);
内容来源于网络,如有侵权,请联系作者删除!