All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.micro.examples.helpline.HelplineService Maven / Gradle / Ivy

Go to download

The Jadex micro applications package contains several example applications, benchmarks and testcases using micro agents.

There is a newer version: 4.0.267
Show newest version
package jadex.micro.examples.helpline;

import jadex.bridge.service.annotation.Service;
import jadex.bridge.service.annotation.ServiceComponent;
import jadex.commons.future.IIntermediateFuture;
import jadex.commons.future.IntermediateFuture;

/**
 *  Helpline service implementation.
 */
@Service
public class HelplineService implements IHelpline
{
	//-------- attributes --------
	
	/** The agent. */
	@ServiceComponent
	protected HelplineAgent agent;
	
	//-------- methods --------
	
	/**
	 *  Add an information about a person.
	 *  @param name The person's name.
	 *  @param info The information.
	 */
	public void addInformation(final String name, final String info)
	{
		agent.addInformation(name, info);
	}
	
	/**
	 *  Get all locally stored information about a person.
	 *  @param name The person's name.
	 *  @return Future that contains the information.
	 */
	public IIntermediateFuture getInformation(final String name)
	{
		return new IntermediateFuture(agent.getInformation(name));
	}

	/**
	 *  Get the string representation.
	 *  @return The string representation.
	 */
	public String toString()
	{
		return "HelplineService, "+agent.getAgent().getComponentIdentifier();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy