jadex.bridge.component.impl.remotecommands.RemoteIntermediateResultCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-platform-bridge Show documentation
Show all versions of jadex-platform-bridge Show documentation
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.
package jadex.bridge.component.impl.remotecommands;
import java.util.Map;
import jadex.bridge.IInternalAccess;
import jadex.bridge.service.types.security.ISecurityInfo;
import jadex.commons.future.IFuture;
import jadex.commons.future.IntermediateFuture;
/**
* Command for intermediate results.
*/
public class RemoteIntermediateResultCommand extends AbstractResultCommand
{
/** The result. */
protected T result;
/**
* Create the command.
*/
public RemoteIntermediateResultCommand()
{
}
/**
* Create the command.
*/
public RemoteIntermediateResultCommand(T result, Map nonfunc)
{
super(nonfunc);
this.result = result;
}
/**
* 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.
*/
@SuppressWarnings("unchecked")
public void doExecute(IInternalAccess access, IFuture> future, ISecurityInfo secinf)
{
((IntermediateFuture)future).addIntermediateResult(result);
}
/**
* Get the result.
* @return the result.
*/
public T getIntermediateResult()
{
return result;
}
/**
* Set the result.
* @param result The result to set.
*/
public void setIntermediateResult(T result)
{
this.result = result;
}
}