本文整理了Java中jadex.commons.future.Future.isDone()
方法的一些代码示例,展示了Future.isDone()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Future.isDone()
方法的具体详情如下:
包路径:jadex.commons.future.Future
类名称:Future
方法名:isDone
[英]Test if done, i.e. result is available.
[中]测试是否完成,即结果是否可用。
代码示例来源:origin: net.sourceforge.jadex/jadex-bridge
public void exceptionOccurred(Exception exception)
{
// if(type.toString().indexOf("IFile")!=-1)
// System.out.println("Ex result: "+exception);
if(!ret.isDone())
{
ret.setException(exception);
}
}
});
代码示例来源:origin: org.activecomponents.jadex/jadex-platform
protected void checkFinish()
{
if(ongoing==0 && finished && !ret.isDone())
{
ret.setExceptionIfUndone(new SecurityException("Unable to retrieve certificate: "+name));
}
}
});
代码示例来源:origin: net.sourceforge.jadex/jadex-platform
protected void checkFinish()
{
if(ongoing==0 && finished && !ret.isDone())
{
ret.setExceptionIfUndone(new SecurityException("Unable to retrieve certificate: "+name));
}
}
});
代码示例来源:origin: net.sourceforge.jadex/jadex-bridge
public void finished()
{
// if(type.getName().indexOf("IRepositoryAccess")!=-1)
// System.out.println("fin");
if(!ret.isDone())
{
ret.setExceptionIfUndone(new ServiceNotFoundException(type.getName()));
}
}
代码示例来源:origin: net.sourceforge.jadex/jadex-bridge
public IFuture<Void> execute(IInternalAccess ia)
{
if(!ret.isDone())
{
ret.sendForwardCommand(IForwardCommandFuture.Type.UPDATETIMER);
ia.waitForDelay(w, this, realtime);
}
return IFuture.DONE;
}
};
代码示例来源:origin: org.activecomponents.jadex/jadex-commons
public void resultAvailable(E result)
{
synchronized(resultIndicator) {
if (!resultIndicator.isDone()) {
resultIndicator.setResult(null);
action.accept(result);
ret.setResult(null);
}
}
}
代码示例来源:origin: org.activecomponents.jadex/jadex-bridge
public IFuture<Void> execute(IInternalAccess ia)
{
if(!ret.isDone())
{
ret.sendForwardCommand(IForwardCommandFuture.Type.UPDATETIMER);
ia.getComponentFeature(IExecutionFeature.class).waitForDelay(w, this, realtime);
}
return IFuture.DONE;
}
};
代码示例来源:origin: org.activecomponents.jadex/jadex-commons
public void resultAvailable(E result)
{
synchronized(resultIndicator) {
if (!resultIndicator.isDone()) {
resultIndicator.setResult(null);
U apply = fn.apply(result);
ret.setResult(apply);
}
}
}
代码示例来源:origin: org.activecomponents.jadex/jadex-platform
if(!ofut.isDone())
ofuture = ofut;
代码示例来源:origin: net.sourceforge.jadex/jadex-platform
if(!ofut.isDone())
ofuture = ofut;
代码示例来源:origin: net.sourceforge.jadex/jadex-platform-base
public void run()
{
if(!ret.isDone())
{
try
{
transport.getConnectionManager().ping(adr);
ret.setResultIfUndone(adr);
}
catch(Exception e)
{
crl.exceptionOccurred(e);
}
}
}
});
代码示例来源:origin: net.sourceforge.jadex/jadex-kernel-base
public void run()
{
try
{
IFuture<T> result = step.execute(interpreter.getInternalAccess());
result.addResultListener(new DelegationResultListener<T>(ret));
}
catch(Exception e)
{
if(!ret.isDone())
{
ret.setException(e);
}
else
{
adapter.getLogger().warning("Exception occurred: "+e);
e.printStackTrace();
}
}
}
});
代码示例来源:origin: net.sourceforge.jadex/jadex-platform
public void run()
{
if(!ret.isDone())
{
try
{
transport.getConnectionManager().ping(adr);
// System.err.println("selectServer/setResultIfUndone: "+access.getComponentIdentifier()+", "+System.currentTimeMillis()+", "+Thread.currentThread());
ret.setResultIfUndone(adr);
}
catch(Exception e)
{
crl.exceptionOccurred(e);
}
}
}
});
代码示例来源:origin: net.sourceforge.jadex/jadex-platform
public IFuture<Void> execute(IInternalAccess ia)
{
if(!future.isDone())
{
WaitingCallInfo wci = rms.removeWaitingCall(callid);
if(future instanceof ITerminableFuture)
{
((ITerminableFuture<?>)future).terminate(new TimeoutException("No reply received and timeout occurred: "
+receiver+", "+callid+", "+wci));
}
else
{
future.setExceptionIfUndone(new TimeoutException("No reply received and timeout occurred: "
+receiver+", "+callid+", "+wci));
}
}
return IFuture.DONE;
}
});
代码示例来源:origin: net.sourceforge.jadex/jadex-platform-base
public void run()
{
if(!ret.isDone())
{
try
{
String curadrs = transport.getConnectionManager().getServers(adr);
log(Level.INFO, "Relay transport got server addresses from: "+adr+", "+curadrs);
ret.setResultIfUndone(curadrs);
}
catch(Exception e)
{
crl.exceptionOccurred(e);
}
}
}
});
代码示例来源:origin: org.activecomponents.jadex/jadex-platform
public void run()
{
if(!ret.isDone())
{
try
{
transport.getConnectionManager().ping(adr);
if(ret.setResultIfUndone(adr))
{
log(Level.INFO, "Relay transport selected server address: "+adr);
}
}
catch(Exception e)
{
crl.exceptionOccurred(e);
}
}
}
});
代码示例来源:origin: net.sourceforge.jadex/jadex-platform
public void run()
{
if(!ret.isDone())
{
try
{
String curadrs = transport.getConnectionManager().getServers(adr);
log(Level.INFO, "Relay transport got server addresses from: "+adr+", "+curadrs);
// System.err.println("fetchServerAddresses/setResultIfUndone: "+access.getComponentIdentifier()+", "+System.currentTimeMillis()+", "+Thread.currentThread());
ret.setResultIfUndone(curadrs);
}
catch(Exception e)
{
crl.exceptionOccurred(e);
}
}
}
});
代码示例来源:origin: net.sourceforge.jadex/jadex-platform-base
public IFuture<Void> execute(IInternalAccess ia)
{
if(!future.isDone())
{
WaitingCallInfo wci = rms.removeWaitingCall(callid);
if(future instanceof ITerminableFuture)
{
((ITerminableFuture<?>)future).terminate(new TimeoutException("No reply received and timeout occurred: "
+receiver+", "+callid+", "+wci));
}
else
{
future.setExceptionIfUndone(new TimeoutException("No reply received and timeout occurred: "
+receiver+", "+callid+", "+wci));
}
}
return IFuture.DONE;
}
});
代码示例来源:origin: org.activecomponents.jadex/jadex-platform
public IFuture<Void> execute(IInternalAccess ia)
{
if(!future.isDone())
{
WaitingCallInfo wci = rms.removeWaitingCall(callid);
if(future instanceof ITerminableFuture)
{
((ITerminableFuture<?>)future).terminate(new TimeoutException("No reply received and timeout occurred: "
+receiver+", "+callid+", "+wci+", "+timeout));
}
else
{
future.setExceptionIfUndone(new TimeoutException("No reply received and timeout occurred: "
+receiver+", "+callid+", "+wci+", "+timeout));
}
}
return IFuture.DONE;
}
});
代码示例来源:origin: org.activecomponents.jadex/jadex-platform
public void run()
{
if(!ret.isDone())
{
try
{
// System.out.println("http get: "+adr);
String curadrs = transport.getConnectionManager().getServers(adr);
if(ret.setResultIfUndone(curadrs))
{
log(Level.INFO, "Relay transport got server addresses from: "+adr+", "+curadrs);
}
}
catch(Exception e)
{
crl.exceptionOccurred(e);
}
// finally
// {
// System.out.println("finished http get: "+adr);
// }
}
}
});
内容来源于网络,如有侵权,请联系作者删除!