public void customResultAvailable(INFMixedPropertyProvider result) { getPropertyValue(result).addResultListener(listener); } });
@Plan protected void wait(IPlan plan) { System.out.println("waiting for notification"); plan.waitForFactChanged("mybean").get(); System.out.println("received notification"); }
public void customResultAvailable(final IChatService chat) { // ret.setResult(chat); chat.status(nick, status, image).addResultListener(new ExceptionDelegationResultListener<Void, IChatService>(ret) { public void customResultAvailable(Void result) { ret.setResult(chat); } }); } });
/** * Plan that prints out goal text and passes. */ @Plan protected void printHello(IPlan plan) { System.out.println("Hello World."); plan.waitFor(1000).get(); System.out.println("Good bye."); } }
public void customResultAvailable(final ILibraryService ls) { ls.getClassLoader(null).addResultListener(new DelegationResultListener<ClassLoader>(ret) { public void customResultAvailable(ClassLoader result) { super.customResultAvailable(result); } }); } });
@Plan protected void wait(IPlan plan) { System.out.println("waiting for notification"); plan.waitForFactChanged("mybean").get(); System.out.println("received notification"); }
public void resultAvailable(ISettingsService settings) { settings.deregisterPropertiesProvider(PROEPRTIES_ID) .addResultListener(new DelegationResultListener<Void>(ret) { public void customResultAvailable(Void result) { SecurityService.this.platformpasses = null; ret.setResult(null); } }); }
public void intermediateResultAvailable(String item) { // System.out.println("Item offered: "+item); System.out.println(agent.getComponentIdentifier()+": "+(ls.claimItem(item).get()? "I won item: ": "I did not win item: ")+item); }
public void execute(Object args) { String[] tmp = (String[])args; secservice.setNetworkPassword(tmp[0], tmp[1]).addResultListener(new JCCResultListener<Void>(jcc) { public void customResultAvailable(Void result) { // doRefresh(); } }); } };
/** * The agent body. */ @AgentBody public void body() { String eword = "dog"; String gword = (String)bdiFeature.dispatchTopLevelGoal(capa.new Translate(eword)).get(); System.out.println("Translated: "+eword+" "+gword); List<String> syns = (List<String>)bdiFeature.adoptPlan("findSynonyms", new Object[]{eword}).get(); System.out.println("Found synonyms: "+eword+" "+syns); }
public void resultAvailable(IMathService service) { invokeAddService("IMathService searched via platform proxy.", service) .addResultListener(lis); } public void exceptionOccurred(Exception exception)
public IFuture<Void> execute(IInternalAccess ia) { regservice.getChatters().addResultListener(new DefaultResultListener<Map<String, IComponentIdentifier>>() { public void resultAvailable(Map<String, IComponentIdentifier> result) { System.out.println("The current chatters: "+result); } }); return IFuture.DONE; } });
@PlanBody protected void takeTrain(IPlan plan) { System.out.println("Trying to take train to Uni."); plan.dispatchSubgoal(new TakeXGoal(TakeXGoal.Type.TRAIN)).get(); System.out.println("Took train to Uni."); } }
public void customResultAvailable(final E e) { other.addResultListener(new ExceptionDelegationResultListener<U, V>(ret) { public void customResultAvailable(U u) { ret.setResult(function.apply(e, u)); } }); } });
/** * Test method. */ public IFuture<String> test() { System.out.println("invoked service: "+sid.getProviderId()+" cnt="+(++cnt)+" wait="+wait); comp.waitForDelay(wait).get(); return new Future<String>(sid.toString()); } }
public void resultAvailable(ISettingsService settings) { settings.deregisterPropertiesProvider(PROEPRTIES_ID) .addResultListener(new DelegationResultListener<Void>(ret) { public void customResultAvailable(Void result) { SecurityService.this.platformpasses = null; ret.setResult(null); } }); }
@Plan(trigger=@Trigger(goals=TestGoal2.class)) public Double inc(TestGoal2 g, IPlan plan) { // g.inc(); plan.waitFor(200).get(); return new Double(Math.random()); }
public void customResultAvailable(Collection<IPublishService> result) { getPublishService(instance, type, scope, result.iterator()).addResultListener(new DelegationResultListener<IPublishService>(ret)); } }));
public IFuture<Void> service() { // wait longer than default 30 secs // get must set no timeout to avoid being interrupted agent.getComponentFeature(IExecutionFeature.class).waitForDelay(35000).get(); return IFuture.DONE; } }