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 void
Configurable run.final void
execute()
Execute.final void
execute
(boolean interruptibleRMIThread) Execute.final ClassLoader
Gets the context class loader.final int
Gets the priority.final String
Gets the thread name.final boolean
Interrupt.final boolean
Interrupted.final boolean
isAlive()
Checks if is alive.final boolean
Check if the Thread has been started.final void
join()
Join.final boolean
join
(long timeout) Join.final void
run()
Run.final void
setContextClassLoader
(ClassLoader classLoader) Sets the context class loader.final void
setForceCookie
(boolean forceCookie) Sets the force cookie.final void
setInheritCookie
(boolean newInheritCookie) Sets the inherit cookie.final void
setPriority
(int newPriority) Sets the priority.final void
setThreadNameAndCookie
(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.
-