com.softicar.platform.common.core.thread.IRunnableThread Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-common Show documentation
Show all versions of platform-common Show documentation
The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.
package com.softicar.platform.common.core.thread;
/**
* Represents a {@link Thread} that is created from a given {@link Runnable}.
*
* @author Alexander Schmidt
* @author Oliver Richers
*/
public interface IRunnableThread {
/**
* Returns the {@link Runnable} from which the {@link Thread} is created.
*
* @return the {@link Runnable} (never null)
*/
R getRunnable();
/**
* Starts the {@link Thread} created from the {@link Runnable}.
*
* May only be called once.
*/
void start();
/**
* Interrupts the {@link Thread} created from the {@link Runnable}.
*/
void interrupt();
/**
* Kills the {@link Thread} created from the {@link Runnable}.
*
* Repeatedly sends interrupts as long as either the {@link Thread} is
* terminated, or a timeout is encountered.
*
* @return true if the {@link Thread} was successfully killed;
* false otherwise
*/
boolean kill();
/**
* Determines whether the {@link Thread} created from the {@link Runnable}
* has been terminated.
*
* @return true if the {@link Thread} has been terminated;
* false otherwise
*/
boolean isTerminated();
}