本文整理了Java中org.apache.brooklyn.core.entity.Entities.invokeEffectorWithArgs()
方法的一些代码示例,展示了Entities.invokeEffectorWithArgs()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entities.invokeEffectorWithArgs()
方法的具体详情如下:
包路径:org.apache.brooklyn.core.entity.Entities
类名称:Entities
方法名:invokeEffectorWithArgs
暂无
代码示例来源:origin: io.brooklyn.etcd/brooklyn-etcd
@Override
public Boolean call() throws Exception {
LOG.debug("Calling joinCluster effector on {} for {}", firstNode, member);
if (member.hasJoinedCluster()) return true;
String address = Preconditions.checkNotNull(getNodeAddress(member));
if (Entities.invokeEffectorWithArgs(EtcdClusterImpl.this, firstNode, EtcdNode.JOIN_ETCD_CLUSTER, name, address).blockUntilEnded(timeout)) {
Duration.seconds(15).countdownTimer().waitForExpiryUnchecked();
addNode(member, name);
return true;
} else {
return false;
}
}
}
代码示例来源:origin: io.brooklyn.etcd/brooklyn-etcd
protected void onServerPoolMemberRemoved(final Entity member) {
Map<Entity, String> nodes = MutableMap.copyOf(sensors().get(ETCD_CLUSTER_NODES));
Duration timeout = config().get(BrooklynConfigKeys.START_TIMEOUT);
String name = nodes.get(member);
if (nodes.containsKey(member)) {
synchronized (clusterMutex) {
Optional<Entity> otherNode = Iterables.tryFind(nodes.keySet(), Predicates.and(
Predicates.instanceOf(EtcdNode.class),
EntityPredicates.attributeEqualTo(EtcdNode.ETCD_NODE_HAS_JOINED_CLUSTER, Boolean.TRUE),
Predicates.not(EntityPredicates.idEqualTo(member.getId()))));
if (otherNode.isPresent()) {
boolean ended = Entities.invokeEffectorWithArgs(this, otherNode.get(), EtcdNode.LEAVE_ETCD_CLUSTER, name).blockUntilEnded(timeout);
if (!ended) {
LOG.warn("Timeout invoking leaveCluster for {} on {}", member, otherNode.get());
}
}
removeNode(member, name);
}
}
}
代码示例来源:origin: org.apache.brooklyn/brooklyn-policy
@Override
public void run() {
try {
Entities.invokeEffectorWithArgs(entity, entity, MemberReplaceable.REPLACE_MEMBER, failedEntity.getId()).get();
consecutiveReplacementFailureTimes.clear();
} catch (Exception e) {
if (Exceptions.getFirstThrowableOfType(e, StopFailedRuntimeException.class) != null) {
LOG.info("ServiceReplacer: ignoring error reported from stopping failed node "+failedEntity);
return;
}
highlightViolation(violationText+" and replace attempt failed: "+Exceptions.collapseText(e));
onReplacementFailed("Replace failure ("+Exceptions.collapseText(e)+") at "+entity+": "+reason);
}
}
});
代码示例来源:origin: org.apache.brooklyn/brooklyn-core
@Test
public void testInvokeEffectorStartFailing_EntitiesInvoke() {
FailingEntity entity = createFailingEntity();
assertTaskFails( Entities.invokeEffectorWithArgs(entity, entity, Startable.START, locs) );
}
代码示例来源:origin: org.apache.brooklyn/brooklyn-core
log.debug("Child " + entity + " of " + this + " being started in filtered location list: " + l2);
tasks.add(Entities.invokeEffectorWithArgs(this, entity, Startable.START, l2));
代码示例来源:origin: org.apache.brooklyn/brooklyn-core
@Test
public void testInvokeEffectorStartWithArgs() {
Entities.invokeEffectorWithArgs(app, app, Startable.START, locs).getUnchecked();
Asserts.assertEqualsIgnoringOrder(locs, app.getLocations());
}
代码示例来源:origin: org.apache.brooklyn/brooklyn-core
if (Entities.invokeEffectorWithArgs(this, child, Startable.START, locations).blockUntilEnded(timeout)) {
LOG.debug("Successfully started {} by {}", child, this);
} else {
代码示例来源:origin: org.apache.brooklyn/brooklyn-core
if (Entities.invokeEffectorWithArgs(this, child, Startable.START, locations).blockUntilEnded(timeout)) {
LOG.debug("Successfully started {} by {}", child, this);
} else {
内容来源于网络,如有侵权,请联系作者删除!