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

jadex.micro.tutorial.RegistryServiceE3 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.tutorial;

import java.util.HashMap;
import java.util.Map;

import jadex.bridge.IComponentIdentifier;
import jadex.bridge.service.annotation.Service;
import jadex.commons.future.Future;
import jadex.commons.future.IFuture;

/**
 *  Service for registering a nickname with component identifier.
 */
@Service
public class RegistryServiceE3 implements IRegistryServiceE3
{
	//-------- attributes --------
	
	/** The entries map. */
	protected Map entries = new HashMap();
	
	//-------- methods --------

	/** 
	 *  Register a chatter. 
	 */
	public void register(IComponentIdentifier cid, String nickname)
	{
		entries.put(nickname, cid);
	}
	
	/**
	 *  Get the registered chatters.
	 */
	public IFuture> getChatters()
	{
		return new Future>(entries);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy