本文整理匯總了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);
}