Class ThreadService.ConfigurableRunnable
java.lang.Object
ecmwf.common.technical.ThreadService.ConfigurableRunnable
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
PluginContainer.PluginActionThread,PluginThread,PTCPReceiverThread,PTCPSenderThread,StreamPlugThread,ThreadService.ConfigurableLoopRunnable,WaitingThread,WaitingThread.AsynchronousThread,WakeupThread
- Enclosing class:
ThreadService
The Class ConfigurableRunnable.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidConfigurable run.final voidexecute()Execute.final voidexecute(boolean interruptibleRMIThread) Execute.final ClassLoaderGets the context class loader.final intGets the priority.final StringGets the thread name.final booleanInterrupt.final booleanInterrupted.final booleanisAlive()Checks if is alive.final booleanCheck if the Thread has been started.final voidjoin()Join.final booleanjoin(long timeout) Join.final voidrun()Run.final voidsetContextClassLoader(ClassLoader classLoader) Sets the context class loader.final voidsetForceCookie(boolean forceCookie) Sets the force cookie.final voidsetInheritCookie(boolean newInheritCookie) Sets the inherit cookie.final voidsetPriority(int newPriority) Sets the priority.final voidsetThreadNameAndCookie(String info, String user, String context, String address) Sets the thread name and cookie.
-
Constructor Details
-
ConfigurableRunnable
public ConfigurableRunnable()
-
-
Method Details
-
isStarted
public final boolean isStarted()Check if the Thread has been started. Started does not mean that it is still running.- Returns:
- true, if is started
-
execute
public final void execute()Execute. -
execute
public final void execute(boolean interruptibleRMIThread) Execute.- Parameters:
interruptibleRMIThread- the interruptible rmi thread
-
interrupt
public final boolean interrupt()Interrupt.- Returns:
- true, if successful
-
interrupted
public final boolean interrupted()Interrupted.- Returns:
- true, if successful
-
setContextClassLoader
Sets the context class loader.- Parameters:
classLoader- the new context class loader
-
getContextClassLoader
Gets the context class loader.- Returns:
- the context class loader
-
setPriority
public final void setPriority(int newPriority) Sets the priority.- Parameters:
newPriority- the new priority
-
getPriority
public final int getPriority()Gets the priority.- Returns:
- the priority
-
isAlive
public final boolean isAlive()Checks if is alive.- Returns:
- true, if is alive
-
join
Join.- Throws:
InterruptedException- the interrupted exceptionExecutionException- the execution exceptionTimeoutException- the timeout exception
-
join
public final boolean join(long timeout) throws InterruptedException, ExecutionException, TimeoutException Join.- Parameters:
timeout- the timeout- Returns:
- true if we had to wait for the thread
- Throws:
InterruptedException- the interrupted exceptionExecutionException- the execution exceptionTimeoutException- the timeout exception
-
setThreadNameAndCookie
-
getThreadName
-
setInheritCookie
public final void setInheritCookie(boolean newInheritCookie) Sets the inherit cookie.- Parameters:
newInheritCookie- the new inherit cookie
-
setForceCookie
public final void setForceCookie(boolean forceCookie) Sets the force cookie.- Parameters:
forceCookie- the new force cookie
-
run
-
configurableRun
public abstract void configurableRun()Configurable run.
-