public void exceptionOccurred(Exception exception) { ret.setException(exception); } });
/** * Called when an exception occurred. * @param exception The exception. */ public void customExceptionOccurred(Exception exception) { if(undone) { future.setExceptionIfUndone(exception); } else { future.setException(exception); } }
public void exceptionOccurred(Exception exception) { ret.setException(exception); } })
public void exceptionOccurred(Exception exception) { // if(selector instanceof TypeResultSelector && ((TypeResultSelector) selector).getType().toString().indexOf("ILocalService")!=-1) // { // System.out.println("remote search failed locally: "+componentid+", "+exception); // } ret.setException(exception); } });
public void exceptionOccurred(Exception exception) { ret.setException(exception); } });
public void exceptionOccurred(Exception exception) { ret.setException(exception); } });
public void exceptionOccurred(Exception exception) { ret.setException(exception); } });
public void exceptionOccurred(Exception exception) { ret.setException(exception); } })
/** * */ protected void notifyException(Exception exception) { if(!isFinished()) { finished = Boolean.TRUE; future.setException(exception); } } }
/** * Notify that the search has finished. */ public void serviceSearchFinished() { if(freeservices.size()+busyservices.size()==0) { results.setException(new RuntimeException("No service found.")); } else { checkPerformCall(null); } }
/** * */ protected void notifyException(Exception exception) { if(!isFinished()) { finished = Boolean.TRUE; future.setException(exception); } } }
/** * Notify that the search has finished. */ public void serviceSearchFinished() { if(freeservices.size()+busyservices.size()==0) { results.setException(new RuntimeException("No service found.")); } else { checkPerformCall(null); } }
/** * Be informed when one of the other methods futures is terminated. * Returns an initial result when this future is registered. * Is finished, when the terminate action of the other future was called. */ public IIntermediateFuture<Void> terminateCalled() { IntermediateFuture<Void> ret = new IntermediateFuture<Void>(); if(termfut!=null) { ret.setException(new RuntimeException("Must not be called twice before result is available")); } else { ret.addIntermediateResult(null); termfut = ret; } return ret; } }
public void terminated(Exception reason) { // System.out.println("termination command called2: "+termfut); if(termfut!=null) { if(!agent.getComponentFeature(IExecutionFeature.class).isComponentThread()) { System.err.println("adapter1: "+agent.getComponentIdentifier()); System.err.println("adapter1a: "+IInternalExecutionFeature.LOCAL.get()); Thread.dumpStack(); termfut.setException(new RuntimeException("Terminate called on wrong thread.")); } else { termfut.setFinished(); } termfut = null; } }
public void terminated(Exception reason) { // System.out.println(agent.getComponentIdentifier()+": getResult2 "+termfut); if(termfut!=null) { if(!agent.getComponentFeature(IExecutionFeature.class).isComponentThread()) { System.err.println("adapter0: "+agent.getComponentIdentifier()); System.err.println("adapter0a: "+IInternalExecutionFeature.LOCAL.get()); Thread.dumpStack(); termfut.setException(new RuntimeException("Terminate called on wrong thread.")); } else { termfut.setFinished(); } termfut = null; } } });
public void customIntermediateResultAvailable(Object result) { if(shutdowned) { fut.setException(new ComponentTerminatedException(id)); } else { fut.addIntermediateResult((T)BasicServiceInvocationHandler.createRequiredServiceProxy(instance, instance.getExternalAccess(), adapter, (IService)result, null, new RequiredServiceInfo(type), null, realtime)); } } });
public void customIntermediateResultAvailable(Object result) { if(shutdowned) { fut.setException(new ComponentTerminatedException(id)); } else { fut.addIntermediateResult((T)BasicServiceInvocationHandler.createRequiredServiceProxy(instance, instance.getExternalAccess(), adapter, (IService)result, null, new RequiredServiceInfo(type), null, realtime)); } } });
@Classname("convertPathToRelative") public IIntermediateFuture<String> execute(IInternalAccess ia) { IntermediateFuture<String> ret = new IntermediateFuture<String>(); try { for(String path: paths) { ret.addIntermediateResult(SUtil.convertPathToRelative(path)); } ret.setFinished(); } catch(Exception e) { // Protect remote platform from execution errors. Thread.dumpStack(); e.printStackTrace(); ret.setException(e); } return ret; } });
/** * Execute the command. * @param lrms The local remote management service. * @return An optional result command that will be * sent back to the command origin. */ public IIntermediateFuture<IRemoteCommand> execute(IExternalAccess component, RemoteServiceManagementService rsms) { final IntermediateFuture<IRemoteCommand> ret = new IntermediateFuture<IRemoteCommand>(); try { rsms.getRemoteReferenceModule().addRemoteReference(rr, holder); ret.addIntermediateResult(new RemoteResultCommand(null, null, null, callid, false, null, getNonFunctionalProperties())); ret.setFinished(); // ret.setResult(new RemoteResultCommand(null, null, callid, false)); } catch(Exception e) { e.printStackTrace(); ret.setException(e); } return ret; }
/** * Execute the command. * @param lrms The local remote management service. * @return An optional result command that will be * sent back to the command origin. */ public IIntermediateFuture<IRemoteCommand> execute(IMicroExternalAccess component, RemoteServiceManagementService rsms) { final IntermediateFuture<IRemoteCommand> ret = new IntermediateFuture<IRemoteCommand>(); try { rsms.getRemoteReferenceModule().addRemoteReference(rr, holder); ret.addIntermediateResult(new RemoteResultCommand(null, null, null, callid, false, null, getNonFunctionalProperties())); ret.setFinished(); // ret.setResult(new RemoteResultCommand(null, null, callid, false)); } catch(Exception e) { e.printStackTrace(); ret.setException(e); } return ret; }