Package org.jgroups.util
Class Runner
java.lang.Object
org.jgroups.util.Runner
- All Implemented Interfaces:
Closeable,AutoCloseable,Runnable
Runs a given function in a loop (in a separate thread) until it is stopped
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected final ThreadFactoryprotected final Runnableprotected longprotected booleanprotected final Runnableprotected Threadprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleandaemon()daemon(boolean d) longbooleanvoidrun()setJoinTimeout(long t) start()stop()threadName(String n)
-
Field Details
-
factory
-
thread_name
-
function
-
stop_function
-
running
protected volatile boolean running -
thread
-
daemon
protected boolean daemon -
join_timeout
protected long join_timeout
-
-
Constructor Details
-
Runner
-
Runner
-
-
Method Details
-
getThread
-
isRunning
public boolean isRunning() -
daemon
public boolean daemon() -
daemon
-
threadName
-
threadName
-
getJoinTimeout
public long getJoinTimeout() -
setJoinTimeout
-
start
-
stop
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
run
public void run()
-