Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package jadex.bdi.planlib.df;
 
 
 import java.util.Date;


Plan to register at the df.
public class DFLocalRegisterPlan extends Plan
{
Plan body.
	public void body()
	{
		// Todo: support other parameters!?
		Number lt = (Number)getParameter("leasetime").getValue();
		// When AID is ommited, enter self. Hack???
		if(desc.getName()==null || lt!=null)
		{
			IDF	dfservice	= (IDF)getServiceContainer().getRequiredService("df").get(this);
			IComponentIdentifier	biddesc.getName()!=null ? desc.getName() : getScope().getComponentIdentifier();
			Date	leasetimelt==null ? desc.getLeaseTime() : new Date(getTime()+lt.longValue());
			descdfservice.createDFComponentDescription(biddesc.getServices(), desc.getLanguages(), desc.getOntologies(), desc.getProtocols(), leasetime);
		}
		getLogger().info("Trying to register: "+desc);
		// todo: supply return value or throw exception?
		desc = (IDFComponentDescription)ret.get(this);
		getParameter("result").setValue(desc);
	}
New to GrepCode? Check out our FAQ X