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

jadex.bdi.planlib.cms.CMSLocalGetExternalAccessPlan 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.IComponentIdentifier;
import jadex.bridge.IComponentManagementService;
import jadex.commons.future.IFuture;

/**
 *  Plan for terminating a Jadex component on the platform.
 */
public class CMSLocalGetExternalAccessPlan extends Plan
{
	/**
	 *  Execute a plan.
	 */
	public void body()
	{	
		IComponentIdentifier aid = (IComponentIdentifier)getParameter("componentidentifier").getValue();

		try
		{
			IFuture fut = ((IComponentManagementService)getServiceContainer().getRequiredService("cms").get(this)).getExternalAccess(aid);
			Object ret = fut.get(this);
			getParameter("result").setValue(ret);
		}
		catch(Exception e)
		{
			//e.printStackTrace();
			fail(e); // Do not show exception on console. 
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy