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

jadex.platform.service.ecarules.ARulebaseEvent Maven / Gradle / Ivy

Go to download

The Jadex platform package contains implementations of platform services as well as the platform component itself.

There is a newer version: 3.0.117
Show newest version
package jadex.platform.service.ecarules;

import java.util.concurrent.atomic.AtomicInteger;

import jadex.bridge.service.types.ecarules.IRulebaseEvent;
import jadex.commons.future.IBackwardCommandFuture;

/**
 * 
 */
public abstract class ARulebaseEvent implements IRulebaseEvent
{
	/** The counter. */
	private static AtomicInteger cnt = new AtomicInteger();
	
	/** The id. */
	protected int id;
	
	/** The call id. */
	protected int callid;
	
	/**
	 *  Create a new rule event.
	 */
	public ARulebaseEvent()
	{
		this.id = cnt.incrementAndGet();
	}
	
	/**
	 *  Create a new rule event.
	 */
	public ARulebaseEvent(int callid)
	{
		this.id = cnt.incrementAndGet();
		this.callid = callid;
	}
	
	/**
	 * 
	 */
	public void setFinished(IBackwardCommandFuture fut)
	{
		fut.sendBackwardCommand(new FinishedEvent(callid, id));
	}

	/**
	 *  Get the id.
	 *  return The id.
	 */
	public int getId()
	{
		return id;
	}

	/**
	 *  Set the id. 
	 *  @param id The id to set.
	 */
	public void setId(int id)
	{
		this.id = id;
	}
	
	/**
	 *  Get the callid.
	 *  @return The callid.
	 */
	public int getCallId()
	{
		return callid;
	}

	/**
	 *  Set the callid.
	 *  @param callid The callid to set.
	 */
	public void setCallId(int callid)
	{
		this.callid = callid;
	}

	/**
	 * 
	 */
	public ARulebaseEvent createCopy()
	{
		return null;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy