com.kuka.command
Interface ICommandExecutionContainer<T extends ICommand<T,?>,R extends IExecutionResult,S extends IExecutionState<?>>

Type Parameters:
T - The type of the command whose runtime information is managed by the container.
R - The type of the result which describes the reason why a container reached the finished state.
S - The type of the object that represents the execution state of the container.

public interface ICommandExecutionContainer<T extends ICommand<T,?>,R extends IExecutionResult,S extends IExecutionState<?>>

An interface describing the methods of an unit responsible for the management of the runtime information of a command.

See Also:
IExecutionState

Method Summary
 R awaitFinalized()
          A method which blocks the calling thread until the command execution container is finalized or an interrupted exception occurs.
 R awaitFinalized(long timeout, TimeUnit unit)
          A method which blocks the calling thread until the command execution container is finalized or an interrupted exception occurs, or timeout expires.
 void awaitFinished()
          A method which blocks the calling thread until the command execution container is finished or an interrupted exception occurs.
 void awaitFinished(long timeout, TimeUnit unit)
          A method which blocks the calling thread until the command execution container is finished, an interrupted exception occurs or the timeout is expired.
 void cancel()
          Cancels the execution of the associated command.
 T getCommand()
          Gets a deep copy of the command executed by this container.
 R getResult()
          Returns the result of execution of the container.
 S getState()
          Gets the current state of the container.
 

Method Detail

cancel

void cancel()
Cancels the execution of the associated command. The method returns immediately, in other words, the method does not wait for the container to finish.


awaitFinished

void awaitFinished()
A method which blocks the calling thread until the command execution container is finished or an interrupted exception occurs.


awaitFinished

void awaitFinished(long timeout,
                   TimeUnit unit)
                   throws TimeoutException
A method which blocks the calling thread until the command execution container is finished, an interrupted exception occurs or the timeout is expired.

Parameters:
timeout - time to wait for command execution to be finished
unit - unit for time parameter
Throws:
TimeoutException - The exception is thrown when the timeout is reached.

awaitFinalized

R awaitFinalized()
A method which blocks the calling thread until the command execution container is finalized or an interrupted exception occurs.

Returns:
execution result of the associated command

awaitFinalized

R awaitFinalized(long timeout,
                 TimeUnit unit)
                                          throws TimeoutException
A method which blocks the calling thread until the command execution container is finalized or an interrupted exception occurs, or timeout expires.

Parameters:
timeout - time to wait for command execution to be finished
unit - unit for time parameter
Returns:
execution result of the associated command
Throws:
TimeoutException - The exception is thrown when the timeout is reached.

getCommand

T getCommand()
Gets a deep copy of the command executed by this container.

Returns:
The copy of the command which is executed by this execution container.

getState

S getState()
Gets the current state of the container.

Returns:
The current state of the command execution container.

getResult

R getResult()
Returns the result of execution of the container.

The returned object contains the information why and how the container reached the state finished.

Result is returned only if container has reached state IExecutionState.isFinalized(). For some containers this state is reached at the same moment as the IExecutionState.isFinished(), by some it is possible that some amount of time is needed to prepare the execution result and finalized state comes after the finished state.

Returns:
The result of container execution.
Throws:
IllegalStateException - if the command execution container is not finalized.
See Also:
IExecutionState, IExecutionResult


Copyright © 2019. All rights reserved.