jadex.micro.examples.mandelbrot.AppProviderService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applications-micro Show documentation
Show all versions of jadex-applications-micro Show documentation
The Jadex micro applications package contains several example applications, benchmarks and testcases using micro agents.
package jadex.micro.examples.mandelbrot;
import jadex.bridge.IInternalAccess;
import jadex.bridge.service.annotation.Service;
import jadex.bridge.service.annotation.ServiceComponent;
import jadex.bridge.service.component.IProvidedServicesFeature;
import jadex.bridge.service.types.appstore.AppMetaInfo;
import jadex.bridge.service.types.appstore.IAppProviderService;
import jadex.commons.future.Future;
import jadex.commons.future.IFuture;
/**
*
*/
@Service
public class AppProviderService implements IAppProviderService
{
/** The app meta info. */
protected AppMetaInfo ami;
/** The component. */
@ServiceComponent
protected IInternalAccess agent;
/**
*
*/
public AppProviderService()
{
this.ami = new AppMetaInfo("Mandelbrot", "Jadex", "Allows to render fractal images", "1.0",
null, null);
}
/**
*
*/
public IFuture getAppMetaInfo()
{
return new Future(ami);
}
/**
*
*/
public IFuture getApplication()
{
IMandelbrotService ms = (IMandelbrotService)agent.getComponentFeature(IProvidedServicesFeature.class).getProvidedServices(IMandelbrotService.class)[0];
return new Future(ms);
}
}