本文整理汇总了Java中com.intellij.openapi.util.Ref.wait方法的典型用法代码示例。如果您正苦于以下问题:Java Ref.wait方法的具体用法?Java Ref.wait怎么用?Java Ref.wait使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.util.Ref
的用法示例。
在下文中一共展示了Ref.wait方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: acquire
import com.intellij.openapi.util.Ref; //导入方法依赖的package包/类
public EntryPoint acquire(@NotNull Target target, @NotNull Parameters configuration) throws Exception {
ApplicationManagerEx.getApplicationEx().assertTimeConsuming();
Ref<RunningInfo> ref = Ref.create(null);
Pair<Target, Parameters> key = Pair.create(target, configuration);
if (!getExistingInfo(ref, key)) {
startProcess(target, configuration, key);
if (ref.isNull()) {
try {
//noinspection SynchronizationOnLocalVariableOrMethodParameter
synchronized (ref) {
while (ref.isNull()) {
ref.wait(1000);
ProgressManager.checkCanceled();
}
}
}
catch (InterruptedException e) {
ProgressManager.checkCanceled();
}
}
}
if (ref.isNull()) throw new RuntimeException("Unable to acquire remote proxy for: " + getName(target));
RunningInfo info = ref.get();
if (info.handler == null) {
String message = info.name;
if (message != null && message.startsWith("ERROR: transport error 202:")) {
message = "Unable to start java process in debug mode: -Xdebug parameters are already in use.";
}
throw new ExecutionException(message);
}
return acquire(info);
}