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

jadex.bdi.planlib.cms.CMSLocalSearchComponentsPlan Maven / Gradle / Ivy

Go to download

The Jadex applib BDI package contain ready to use functionalities for BDI agents mostly in form of modules called capabilities.

There is a newer version: 2.4
Show newest version
package jadex.bdi.planlib.cms;

import jadex.bdi.runtime.Plan;
import jadex.bridge.ISearchConstraints;
import jadex.bridge.service.types.cms.IComponentDescription;
import jadex.bridge.service.types.cms.IComponentManagementService;
import jadex.commons.future.IFuture;


/**
 *  Plan for searching for components on the platform.
 */
public class CMSLocalSearchComponentsPlan extends Plan
{
	/**
	 *  Execute a plan.
	 */
	public void body()
	{	
		IComponentDescription	desc	= (IComponentDescription)getParameter("description").getValue();
		ISearchConstraints	constraints	= (ISearchConstraints)getParameter("constraints").getValue();
		boolean remote = getParameter("remote").getValue()!=null? 
			((Boolean)getParameter("remote").getValue()).booleanValue(): false;
		
		IFuture ret = ((IComponentManagementService)getServiceContainer().getRequiredService("cms").get(this))
			.searchComponents(desc, constraints, remote);
		IComponentDescription[]	result =  (IComponentDescription[])ret.get(this);
		for(int i=0; i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy