/** * Called to initialize the panel. */ public IFuture<Void> init(IControlCenter jcc, final IExternalAccess component) { IFuture<Void> fut = super.init(jcc, component); assert fut.isDone(); final Future<Void> ret = new Future<Void>(); SwingUtilities.invokeLater(new Runnable() { public void run() { CleanerViewerPanel.this.panel = new CleanerPanel(component); Timer timer = new Timer(50, new ActionListener() { public void actionPerformed(ActionEvent e) { CleanerViewerPanel.this.panel.invalidate(); CleanerViewerPanel.this.panel.repaint(); } }); timer.start(); ret.setResult(null); } }); return ret; }
/** * Called to initialize the panel. */ public IFuture<Void> init(IControlCenter jcc, final IExternalAccess component) { IFuture<Void> fut = super.init(jcc, component); assert fut.isDone(); final Future<Void> ret = new Future<Void>(); SwingUtilities.invokeLater(new Runnable() { public void run() { CleanerViewerPanel.this.panel = new CleanerPanel(component); Timer timer = new Timer(50, new ActionListener() { public void actionPerformed(ActionEvent e) { CleanerViewerPanel.this.panel.invalidate(); CleanerViewerPanel.this.panel.repaint(); } }); timer.start(); ret.setResult(null); } }); return ret; }
value = dif.getProxy()!=null && dif.getProxy().isDone() && dif.getProxy().getException()==null ? Boolean.TRUE : Boolean.FALSE;
value = dif.getProxy()!=null && dif.getProxy().isDone() && dif.getProxy().getException()==null ? Boolean.TRUE : Boolean.FALSE;
if(con instanceof IFuture<?> && ((IFuture<?>)con).isDone() && ((IFuture<?>)con).getException()==null)
if(con instanceof IFuture<?> && ((IFuture<?>)con).isDone() && ((IFuture<?>)con).getException()==null)
sync = fut.isDone(); if(sync)
assert fut.isDone();
if(!fut.isDone()) throw new RuntimeException("Future belief not available: "+rscope[0]+" in "+rscope[1]);
public void resultAvailable(Object result) { // Only need to check, when proxy already created if(dif.getProxy()!=null && dif.getProxy().isDone() && dif.getProxy().getException()==null) { IComponentIdentifier proxy = dif.getProxy().get(null); IComponentManagementService cms = (IComponentManagementService)result; cms.getComponentDescription(proxy) .addResultListener(new IResultListener<IComponentDescription>() { public void resultAvailable(IComponentDescription result) { } public void exceptionOccurred(Exception exception) { dif.setProxy(null); informListeners(dif); } }); } } public void exceptionOccurred(Exception exception)
/** * Check if local proxy is still available. * @param dif The discovery info. */ public void checkProxy(final DiscoveryInfo dif) { // Only need to check, when proxy already created if(dif.getProxy()!=null && dif.getProxy().isDone() && dif.getProxy().getException()==null) { IComponentIdentifier proxy = dif.getProxy().get(); cms.getComponentDescription(proxy) .addResultListener(new IResultListener<IComponentDescription>() { public void resultAvailable(IComponentDescription result) { } public void exceptionOccurred(Exception exception) { dif.setProxy(null); informListeners(dif); } }); } }
/** * Check if local proxy is still available. * @param dif The discovery info. */ public void checkProxy(final DiscoveryInfo dif) { // Only need to check, when proxy already created if(dif.getProxy()!=null && dif.getProxy().isDone() && dif.getProxy().getException()==null) { IComponentIdentifier proxy = dif.getProxy().get(null); cms.getComponentDescription(proxy) .addResultListener(new IResultListener<IComponentDescription>() { public void resultAvailable(IComponentDescription result) { } public void exceptionOccurred(Exception exception) { dif.setProxy(null); informListeners(dif); } }); } }
/** * Components with autonomous behavior may override this method * to implement a recurring execution cycle. * @return true, if the execution should continue, false, if the component may become idle. */ protected boolean executeCycle() { assert isComponentThread(); // Evaluate conditions in addition to executing steps. boolean again = false; IInternalBDIAgentFeature bdif = getComponent().getComponentFeature(IInternalBDIAgentFeature.class); boolean inited = ((IInternalBDILifecycleFeature)getComponent().getComponentFeature(ILifecycleComponentFeature.class)).isInited(); if(inited && bdif.getRuleSystem()!=null && bdif.getRuleSystem().isEventAvailable()) { // System.out.println("executeCycle.PAE start"); IFuture<Void> fut = bdif.getRuleSystem().processAllEvents(); if(!fut.isDone()) getComponent().getLogger().warning("No async actions allowed."); again = true; } return again; }
if(!future.isDone())