本文整理了Java中org.apache.brooklyn.api.entity.Entity.relations()
方法的一些代码示例,展示了Entity.relations()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.relations()
方法的具体详情如下:
包路径:org.apache.brooklyn.api.entity.Entity
类名称:Entity
方法名:relations
暂无
代码示例来源:origin: org.apache.brooklyn/brooklyn-core
public void testCustomEntityRelation() throws Exception {
TestEntity origT1 = origApp.createAndManageChild(EntitySpec.create(TestEntity.class));
TestEntity origT2 = origApp.createAndManageChild(EntitySpec.create(TestEntity.class));
origT1.relations().add(EntityRelations.HAS_TARGET, origT2);
TestApplication newApp = rebind();
Iterator<Entity> ci = newApp.getChildren().iterator();
Entity t1 = ci.next();
Entity t2 = ci.next();
Assert.assertEquals(t1.relations().getRelations(EntityRelations.HAS_TARGET), Collections.singleton(t2));
Assert.assertEquals(t2.relations().getRelations(EntityRelations.HAS_TARGET), Collections.emptySet());
Assert.assertEquals(t2.relations().getRelations(EntityRelations.TARGETTED_BY), Collections.singleton(t1));
}
代码示例来源:origin: io.brooklyn.clocker/brooklyn-clocker-docker
entity.relations().add(DockerContainer.RUNNING.getInverseRelationshipType(), this);
内容来源于网络,如有侵权,请联系作者删除!