public void customResultAvailable(final IComponentManagementService cms) { cms.getExternalAccess(cid).addResultListener(new IResultListener<IExternalAccess>() { public void resultAvailable(IExternalAccess exta) { ret.setResult(exta.getComponentIdentifier()); } public void exceptionOccurred(Exception exception) { createProxyHolder().addResultListener((new DelegationResultListener<IComponentIdentifier>(ret))); } }); } });
public void customResultAvailable(IComponentManagementService rcms) { // todo: problem, the call will get a wrong caller due to IComponentIdentidier.LOCAL.get() // will deliver the platform (as this second call is performed by the cms itself) rcms.createComponent(name, modelname, cinfo, resultlistener).addResultListener(new DelegationResultListener<IComponentIdentifier>(inited)); } }));
public void resultAvailable(Object result) { ((IComponentManagementService)result).destroyComponent(desc.getName()); } });
public void customResultAvailable(IComponentManagementService rcms) { rcms.getComponentDescription(cid).addResultListener(new DelegationResultListener<IComponentDescription>(ret)); } });
public void run() { try { ThreadSuspendable sus = new ThreadSuspendable(); CreationInfo ci = new CreationInfo("created", null); ci.setParent(agent.getComponentIdentifier()); ci.setResourceIdentifier(agent.getModel().getResourceIdentifier()); final String name = TesterAgent.class.getName()+".class"; IComponentIdentifier ida = cms.createComponent(name, ci).getFirstResult(); IComponentIdentifier idb = cms.createComponent(name, ci).getFirstResult(); IComponentDescription desca = cms.getComponentDescription(ida).get(); IComponentDescription descb = cms.getComponentDescription(ida).get(); System.out.println("chain a: "+ida+" "+desca.getCause().getOrigin()); System.out.println("chain b: "+idb+" "+descb.getCause().getOrigin()); } catch(ComponentTerminatedException e) { // avoid exception being printed during start test. } } }).start();
IComponentIdentifier worker = cms.createComponent("/jadex/bdi/testcases/misc/EndStateWorker.agent.xml", new CreationInfo(args, getComponentIdentifier())).getFirstResult(); IComponentDescription[] results = cms.searchComponents( new CMSComponentDescription(worker, null, false, false, false, false, false, null, null, null, null, -1, null, null, false), null).get(); TestReport report = new TestReport("termination", "Test if the worker agent has been terminated");
public void resultAvailable(IComponentManagementService cms) { cms.suspendComponent(desc.getName()); }
if(remotecms!=ComponentManagementService.this) remotecms.searchComponents(adesc, con, false).addResultListener(lis);
public void customResultAvailable(IComponentManagementService rcms) { rcms.getChildren(cid).addResultListener(new DelegationResultListener<IComponentIdentifier[]>(ret)); } public void exceptionOccurred(Exception exception)
public void customResultAvailable(IComponentManagementService rcms) { rcms.getChildrenDescriptions(cid).addResultListener(new DelegationResultListener<IComponentDescription[]>(ret)); } public void exceptionOccurred(Exception exception)
cms.getChildrenDescriptions(cid).addResultListener(new SwingResultListener<IComponentDescription[]>(new IResultListener<IComponentDescription[]>() cms.getRootIdentifier().addResultListener(new SwingResultListener<IComponentIdentifier>(new IResultListener<IComponentIdentifier>()
public void customResultAvailable(IComponentManagementService cms) { cms.getComponentDescription(sender).addResultListener(new ExceptionDelegationResultListener<IComponentDescription, IResourceIdentifier>(ret) { public void customResultAvailable(IComponentDescription result) { ret.setResult(result.getResourceIdentifier()); }; public void exceptionOccurred(Exception exception) { // Hack??? ret.setResult(null); // super.exceptionOccurred(exception); } }); } });
public void resultAvailable(IComponentManagementService cms) { cms.suspendComponent(desc.getName()); }
if(remotecms!=DecoupledComponentManagementService.this) remotecms.searchComponents(adesc, con, false).addResultListener(lis);
public void customResultAvailable(IComponentManagementService rcms) { rcms.getChildren(cid).addResultListener(createResultListener(new DelegationResultListener<IComponentIdentifier[]>(ret))); } public void exceptionOccurred(Exception exception)
public void customResultAvailable(IComponentManagementService rcms) { rcms.getChildrenDescriptions(cid).addResultListener(createResultListener(new DelegationResultListener<IComponentDescription[]>(ret))); } public void exceptionOccurred(Exception exception)
public void customResultAvailable(IComponentManagementService cms) { // fetch target component via component identifier. cms.getExternalAccess(cid).addResultListener(new ExceptionDelegationResultListener<IExternalAccess, Object>(ret) { public void customResultAvailable(IExternalAccess result) { ret.setResult(result); } }); } });
public void customResultAvailable(IComponentManagementService rcms) { // todo: problem, the call will get a wrong caller due to IComponentIdentidier.LOCAL.get() // will deliver the platform (as this second call is performed by the cms itself) rcms.createComponent(name, modelname, cinfo, resultlistener).addResultListener(new DelegationResultListener<IComponentIdentifier>(inited)); } }));
public void resultAvailable(IComponentManagementService cms) { // cms.setComponentException(cid, e); // System.err.println("fatal error -> destroy: "+getComponentIdentifier()); // e.printStackTrace(); cms.destroyComponent(desc.getName()); }
public void customResultAvailable(IComponentManagementService cms) { cms.getComponentDescription(sender).addResultListener(new ExceptionDelegationResultListener<IComponentDescription, IResourceIdentifier>(ret) { public void customResultAvailable(IComponentDescription result) { ret.setResult(result.getResourceIdentifier()); }; public void exceptionOccurred(Exception exception) { // Hack??? ret.setResult(null); // super.exceptionOccurred(exception); } }); } });