public void customResultAvailable(IComponentManagementService cms) { // NOTE: in current implementation application waits for subcomponents // to be finished and cms implements a hack to get the external // access of an uninited parent. // (NOTE1: parent cannot wait for subcomponents to be all created // before setting itself inited=true, because subcomponents need // the parent external access.) // (NOTE2: subcomponents must be created one by one as they // might depend on each other (e.g. bdi factory must be there for jcc)). createComponent(components, cms, model, 0, ret, cids); } public void exceptionOccurred(Exception exception)
public void customResultAvailable(Collection<IComponentIdentifier> result) { cids.addAll(result); createComponent(components, cms, model, i+1, fut, cids); } }));
public void customResultAvailable(IComponentManagementService cms) { final List<IComponentIdentifier> cids = new ArrayList<IComponentIdentifier>(); Future<Void> fut = new Future<Void>(); fut.addResultListener(new ExceptionDelegationResultListener<Void, IComponentIdentifier>(ret) { public void customResultAvailable(Void result) { if(cids.size()>0) { ret.setResult(cids.get(0)); } else { ret.setException(new RuntimeException("Component not created: "+component)); } } }); createComponent(new ComponentInstanceInfo[]{component}, cms, getModel(), 0, fut, cids); } }));