本文整理了Java中org.apache.druid.java.util.common.lifecycle.Lifecycle.addMaybeStartManagedInstance()
方法的一些代码示例,展示了Lifecycle.addMaybeStartManagedInstance()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Lifecycle.addMaybeStartManagedInstance()
方法的具体详情如下:
包路径:org.apache.druid.java.util.common.lifecycle.Lifecycle
类名称:Lifecycle
方法名:addMaybeStartManagedInstance
[英]Adds a "managed" instance (annotated with LifecycleStart and LifecycleStop) to the Lifecycle at Stage.NORMAL and starts it if the lifecycle has already been started.
[中]在阶段将“托管”实例(用LifecycleStart和LifecycleStop注释)添加到生命周期。正常,如果生命周期已经启动,则启动它。
代码示例来源:origin: apache/incubator-druid
@Override
public synchronized T get()
{
if (value == null) {
final T retVal = unscoped.get();
synchronized (instances) {
if (lifecycle == null) {
instances.add(retVal);
} else {
try {
lifecycle.addMaybeStartManagedInstance(retVal, stage);
}
catch (Exception e) {
log.warn(e, "Caught exception when trying to create a[%s]", key);
return null;
}
}
}
value = retVal;
}
return value;
}
};
代码示例来源:origin: apache/incubator-druid
emitter = emitters.computeIfAbsent(uri, u -> {
try {
return innerLifecycle.addMaybeStartManagedInstance(
new HttpPostEmitter(
config.buildHttpEmitterConfig(u.toString()),
代码示例来源:origin: apache/incubator-druid
@Override
public void start() throws Exception
{
lifecycle.addMaybeStartManagedInstance(
new ObjectToBeLifecycled(1, startOrder, stopOrder), Lifecycle.Stage.NORMAL
);
lifecycle.addMaybeStartManagedInstance(
new ObjectToBeLifecycled(2, startOrder, stopOrder), Lifecycle.Stage.INIT
);
lifecycle.addMaybeStartManagedInstance(
new ObjectToBeLifecycled(3, startOrder, stopOrder), Lifecycle.Stage.LAST
);
lifecycle.addMaybeStartStartCloseInstance(new ObjectToBeLifecycled(4, startOrder, stopOrder));
lifecycle.addMaybeStartManagedInstance(new ObjectToBeLifecycled(5, startOrder, stopOrder));
lifecycle.addMaybeStartStartCloseInstance(
new ObjectToBeLifecycled(6, startOrder, stopOrder), Lifecycle.Stage.LAST
);
lifecycle.addMaybeStartManagedInstance(new ObjectToBeLifecycled(7, startOrder, stopOrder));
}
代码示例来源:origin: apache/incubator-druid
return lifecycle.addMaybeStartManagedInstance(
new NettyHttpClient(
new ResourcePool<>(
代码示例来源:origin: apache/incubator-druid
lifecycle.addMaybeStartManagedInstance(this);
代码示例来源:origin: org.apache.druid/druid-api
@Override
public synchronized T get()
{
if (value == null) {
final T retVal = unscoped.get();
synchronized (instances) {
if (lifecycle == null) {
instances.add(retVal);
} else {
try {
lifecycle.addMaybeStartManagedInstance(retVal, stage);
}
catch (Exception e) {
log.warn(e, "Caught exception when trying to create a[%s]", key);
return null;
}
}
}
value = retVal;
}
return value;
}
};
代码示例来源:origin: org.apache.druid/java-util
emitter = emitters.computeIfAbsent(uri, u -> {
try {
return innerLifecycle.addMaybeStartManagedInstance(
new HttpPostEmitter(
config.buildHttpEmitterConfig(u.toString()),
代码示例来源:origin: org.apache.druid/druid-server
lifecycle.addMaybeStartManagedInstance(this);
代码示例来源:origin: org.apache.druid/java-util
return lifecycle.addMaybeStartManagedInstance(
new NettyHttpClient(
new ResourcePool<>(
内容来源于网络,如有侵权,请联系作者删除!