org.apache.brooklyn.api.mgmt.EntityManager.getEntityTypeRegistry()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中org.apache.brooklyn.api.mgmt.EntityManager.getEntityTypeRegistry()方法的一些代码示例,展示了EntityManager.getEntityTypeRegistry()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EntityManager.getEntityTypeRegistry()方法的具体详情如下:
包路径:org.apache.brooklyn.api.mgmt.EntityManager
类名称:EntityManager
方法名:getEntityTypeRegistry

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);

相关文章