javax.datamining
Interface ExecutionHandle


public interface ExecutionHandle

An ExecutionHandle allows an application to monitor or terminate a task, as well as wait for the completion of a task. An instance of ExecutionHandle is created when a mining task is executed in the DME.

The start time is when the state changes to executing.

Author:
JSR-73 Java Data Mining Expert Group

Method Summary
 boolean containsWarning()
          Returns true if there were any warnings during the execution.
 java.lang.Integer getDurationInSeconds()
          Returns the duration of execution for the associated task in the unit of seconds.
 ExecutionStatus getLatestStatus()
          Returns the latest ExecutionStatus for the task.
 java.util.Date getStartTime()
          Returns the time stamp when task execution began.
 java.util.Collection getStatus(java.util.Date fromTimestamp)
          Returns a collection containing a time-ordered set of ExecutionStatus instances since the specified timestamp.
 java.lang.String getTaskName()
          Returns the name of the task associated with the execution handle.
 ExecutionStatus[] getWarnings()
          Returns an array of ExecutionStatus objects that contain warnings.
 ExecutionStatus terminate()
          Issues an asychronous termination request for the executing task.
 ExecutionStatus waitForCompletion(int timeoutInSeconds)
          Waits synchronoulsy within the specified time until the task associated with the handle completes successfully, as a result of termination, or in error.
 

Method Detail

containsWarning

public boolean containsWarning()
                        throws JDMException
Returns true if there were any warnings during the execution.

Returns:
boolean
Throws:
JDMException

getDurationInSeconds

public java.lang.Integer getDurationInSeconds()
                                       throws JDMException
Returns the duration of execution for the associated task in the unit of seconds. If the task is not completed, it returns the elapsed time from when the task began execution.

Returns:
Integer
Throws:
JDMException

getLatestStatus

public ExecutionStatus getLatestStatus()
                                throws JDMException
Returns the latest ExecutionStatus for the task.

Returns:
ExecutionStatus
Throws:
JDMException

getStartTime

public java.util.Date getStartTime()
                            throws JDMException
Returns the time stamp when task execution began. If the ExecutionState is submitted, then it returns null.

Returns:
Date
Throws:
JDMException

getStatus

public java.util.Collection getStatus(java.util.Date fromTimestamp)
                               throws JDMException
Returns a collection containing a time-ordered set of ExecutionStatus instances since the specified timestamp. The ordering is from most recent first. If the timestamp is null, it returns the complete history available of ExecutionStatus instances.

A vendor may choose to keep only a subset of the status objects, from the most recent.

Parameters:
fromTimestamp -
Returns:
Collection
Throws:
JDMException

getTaskName

public java.lang.String getTaskName()
Returns the name of the task associated with the execution handle.

Returns:
String

getWarnings

public ExecutionStatus[] getWarnings()
                              throws JDMException
Returns an array of ExecutionStatus objects that contain warnings. If the method containsWarnings returns false, this method returns null.

Returns:
ExecutionStatus[]
Throws:
JDMException

terminate

public ExecutionStatus terminate()
                          throws JDMException
Issues an asychronous termination request for the executing task. The method returns an ExecutionStatus instance when the termination signal was delivered.

If the task already completed, successfully or in error, an exception is thrown.

Returns:
ExecutionStatus
Throws:
JDMException

waitForCompletion

public ExecutionStatus waitForCompletion(int timeoutInSeconds)
                                  throws JDMException
Waits synchronoulsy within the specified time until the task associated with the handle completes successfully, as a result of termination, or in error. If the timeout value is Integer.MAX_VALUE, the method waits until completion. The method returns the last execution status.

Parameters:
timeoutInSeconds - The timeout in seconds.
Returns:
ExecutionStatus
Throws:
JDMException