jadex.bdi.planlib.cms.CMSLocalDestroyComponentPlan Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applib-bdi Show documentation
Show all versions of jadex-applib-bdi Show documentation
The Jadex applib BDI package contain
ready to use functionalities for
BDI agents mostly in form of modules
called capabilities.
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 CMSLocalDestroyComponentPlan extends Plan
{
/**
* Execute a plan.
*/
public void body()
{
IComponentIdentifier cid = (IComponentIdentifier)getParameter("componentidentifier").getValue();
try
{
IFuture ret = ((IComponentManagementService)getServiceContainer().getRequiredService("cms").get(this)).destroyComponent(cid);
ret.get(this);
}
catch(Exception e)
{
e.printStackTrace();
fail(e); // Do not show exception on console.
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy