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

jadex.bridge.component.impl.remotecommands.RemoteForwardCmdCommand Maven / Gradle / Ivy

Go to download

Jadex bridge is a base package for kernels and platforms, i.e., it is used by both and provides commonly used interfaces and classes for active components and their management.

There is a newer version: 4.0.267
Show newest version
package jadex.bridge.component.impl.remotecommands;

import jadex.bridge.IInternalAccess;
import jadex.bridge.service.types.security.ISecurityInfo;
import jadex.commons.future.IForwardCommandFuture;
import jadex.commons.future.IFuture;

/**
 *  Remote command for sending future commands in ICommandFuture.
 */
public class RemoteForwardCmdCommand extends AbstractResultCommand //implements IRemoteConversationCommand
{
	/** The Command. */
	protected Object	command;
	
	/**
	 *  Create the command.
	 */
	public RemoteForwardCmdCommand()
	{
		// Bean constructor.
	}
	
	/**
	 *  Create the command.
	 */
	public RemoteForwardCmdCommand(Object command)
	{
		this.command = command;
	}
	
	/**
	 *  Execute a command.
	 *  @param access The agent to run the command on.
	 *  @param future Future of the active conversation.
	 *  @param secinf The established security level to decide if the command is allowed.
	 */
	public void	doExecute(IInternalAccess access, IFuture future, ISecurityInfo secinf)
	{
		((IForwardCommandFuture)future).sendForwardCommand(command);
	}
	
	/**
	 *  Get the command.
	 *  @return the command.
	 */
	public Object	getCommand()
	{
		return command;
	}

	/**
	 *  Set the command.
	 *  @param command The result to set.
	 */
	public void setCommand(Object command)
	{
		this.command = command;
	}
}