public IFuture<T> execute(Void args) { return agent.scheduleStep(new IComponentStep<T>() { public IFuture<T> execute(IInternalAccess ia) { return ia.getComponentFeature(IRequiredServicesFeature.class).getRequiredService(reqservicename); } }); } };
public void resultAvailable(IExternalAccess exta) { exta.scheduleStep(new IComponentStep<Void>() { public IFuture<Void> execute(IInternalAccess ia) { parenta = (IInternalExecutionFeature)ia.getComponentFeature(IExecutionFeature.class); parenta.addSubcomponent(ExecutionComponentFeature.this); parenta.wakeup(); return IFuture.DONE; } }); }
/** * Get the service call service with delay. */ public static <T> IFuture<T> waitForService(final IExternalAccess agent, final IResultCommand<IFuture<T>, Void> searchcmd, final int max, final int delay) { return agent.scheduleStep(new IComponentStep<T>() { public IFuture<T> execute(IInternalAccess ia) { return waitForService(ia, searchcmd, 0, max, delay); } }); }
public static void removeConsoleListener(IExternalAccess platformaccess, final String id) { platformaccess.scheduleStep(new ImmediateComponentStep<Void>() { @Classname("removeListener") public IFuture<Void> execute(IInternalAccess ia) { ConsoleListener cl = new ConsoleListener(id, ia, null); SUtil.removeSystemOutListener(cl); SUtil.removeSystemErrListener(cl); return IFuture.DONE; } }); }
/** * Get all declared services of the given provider. * @return The corresponding services. */ public static IIntermediateFuture<IService> getDeclaredServices(IExternalAccess provider) { return (IIntermediateFuture<IService>)provider.scheduleStep(new ImmediateComponentStep<Collection<IService>>() { @Classname("getDeclaredServices(IExternalAccess provider)") public IIntermediateFuture<IService> execute(IInternalAccess ia) { return getDeclaredServices(ia, false); } }); }
/** * Log a warning on a component. */ public static IFuture<Void> logWarning(final String msg, IExternalAccess exta) { return exta.scheduleStep(new ImmediateComponentStep<Void>() { @Classname("logWarning") public IFuture<Void> execute(IInternalAccess ia) { ia.getLogger().warning(msg); return IFuture.DONE; } }); }
/** * Shutdown the provider. */ public static IFuture<Void> shutdownRequiredNFPropertyProvider(IExternalAccess component, final IServiceIdentifier sid) { return component.scheduleStep(new ImmediateComponentStep<Void>() { @Classname("shutdownRequiredNFPropertyProvider35") public IFuture<Void> execute(IInternalAccess ia) { INFPropertyComponentFeature nfp = ia.getComponentFeature(INFPropertyComponentFeature.class); return nfp.getRequiredServicePropertyProvider(sid).shutdownNFPropertyProvider(); } }); }
public static void addConsoleListener(IExternalAccess platformaccess, final String id, final IRemoteChangeListener rcl) { platformaccess.scheduleStep(new ImmediateComponentStep<Void>() { @Classname("installListener") public IFuture<Void> execute(IInternalAccess ia) { ConsoleListener cl = new ConsoleListener(id, ia, rcl); SUtil.addSystemOutListener(cl); SUtil.addSystemErrListener(cl); return IFuture.DONE; } }); }
/** * Returns the names of all non-functional properties of this service. * @return The names of the non-functional properties of this service. */ public static IFuture<String[]> getRequiredNFAllPropertyNames(IExternalAccess component, final IServiceIdentifier sid) { return component.scheduleStep(new ImmediateComponentStep<String[]>() { @Classname("getRequiredNFAllPropertyNames28") public IFuture<String[]> execute(IInternalAccess ia) { INFPropertyComponentFeature nfp = ia.getComponentFeature(INFPropertyComponentFeature.class); return nfp.getRequiredServicePropertyProvider(sid).getNFAllPropertyNames(); } }); }
/** * Returns meta information about a non-functional properties of a method. * @return The meta information about a non-functional properties. */ public static IFuture<Map<String, INFPropertyMetaInfo>> getRequiredMethodNFPropertyMetaInfos(IExternalAccess component, final IServiceIdentifier sid, final MethodInfo method) { return component.scheduleStep(new ImmediateComponentStep<Map<String, INFPropertyMetaInfo>>() { @Classname("getRequiredMethodNFPropertyMetaInfos39") public IFuture<Map<String, INFPropertyMetaInfo>> execute(IInternalAccess ia) { INFPropertyComponentFeature nfp = ia.getComponentFeature(INFPropertyComponentFeature.class); return nfp.getRequiredServicePropertyProvider(sid).getMethodNFPropertyMetaInfos(method); } }); }
/** * Returns the names of all non-functional properties of this service. * @return The names of the non-functional properties of this service. */ public static IFuture<String[]> getNFAllPropertyNames(IExternalAccess component) { return component.scheduleStep(new ImmediateComponentStep<String[]>() { @Classname("getNFAllPropertyName1") public IFuture<String[]> execute(IInternalAccess ia) { INFPropertyComponentFeature nfp = ia.getComponentFeature(INFPropertyComponentFeature.class); return nfp==null? new Future<String[]>(SUtil.EMPTY_STRING_ARRAY): nfp.getComponentPropertyProvider().getNFAllPropertyNames(); } }); }
/** * Remove a non-functional property. * @param The name. */ public static IFuture<Void> removeNFProperty(IExternalAccess component, final String name) { return component.scheduleStep(new ImmediateComponentStep<Void>() { @Classname("removeNFProperty7") public IFuture<Void> execute(IInternalAccess ia) { INFPropertyComponentFeature nfp = ia.getComponentFeature(INFPropertyComponentFeature.class); return nfp.getComponentPropertyProvider().removeNFProperty(name); } }); }
public void run() { try { component.scheduleStep(step); } catch(ComponentTerminatedException cte) { // ignore and stop timer. timer.cancel(); } } };
public void run() { try { component.scheduleStep(step); } catch(ComponentTerminatedException cte) { // ignore and stop timer. timer.cancel(); } } };
/** * Schedule a step on the message service component. */ protected <E> IFuture<E> scheduleStep(IComponentStep<E> step) { return ms.getComponent().scheduleStep(step); }
/** * Schedule a step on the message service component. */ protected <E> IFuture<E> scheduleStep(IComponentStep<E> step) { return ms.getComponent().scheduleStep(step); }
/** * Schedule a step on the message service component. */ protected <E> IFuture<E> scheduleStep(IComponentStep<E> step) { return ms.getComponent().scheduleStep(step); }
/** * The method provides the integers 1..number as intermediate results. */ public IIntermediateFuture<Integer> getResults(int number) { return (IIntermediateFuture<Integer>)agent.getExternalAccess().scheduleStep(new IComponentStep<Collection<Integer>>() { public IIntermediateFuture<Integer> execute(IInternalAccess ia) { return null; } }); } }
public void run() { try { getComponent().scheduleStep(step); } catch(ComponentTerminatedException cte) { // ignore and stop timer. timer.cancel(); } } };
/** * */ public static void executePlan(RPlan rplan, IInternalAccess ia, ICommand<Boolean> resume) { // BDIAgentInterpreter ip = (BDIAgentInterpreter)((BDIAgent)ia).getInterpreter(); // ip.getCapability().addPlan(rplan); IConditionalComponentStep<Void> action = new ExecutePlanStepAction(rplan, resume); ia.getExternalAccess().scheduleStep(action); }