Class LazyThreadFactory
java.lang.Object
org.jgroups.util.DefaultThreadFactory
org.jgroups.util.LazyThreadFactory
- All Implemented Interfaces:
ThreadFactory, ThreadFactory
Lazily names threads: whenever the address or cluster name is changed, all threads are renamed
- Author:
- Bela Ban
-
Field Summary
Fields inherited from class DefaultThreadFactory
address, baseName, clusterName, counter, createDaemons, includeClusterName, includeLocalAddress, log, use_numbering, use_vthreads -
Constructor Summary
ConstructorsConstructorDescriptionLazyThreadFactory(String baseName, boolean createDaemons, boolean use_numbering) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringchangeName(String name) Replaces "<ADDR>" with the local address and "<CLUSTER>" with the cluster namevoiddestroy()voidvoidrenameThread(String base_name, Thread thread, String addr, String cluster_name) Names a thread according to base_name, cluster name and local address.protected voidvoidsetAddress(String address) voidsetClusterName(String cluster_name) intsize()Methods inherited from class DefaultThreadFactory
getThreadName, getThreadName, log, newThread, renameThread, setIncludeClusterName, setIncludeLocalAddress, setPattern, setUseNumbering, useVirtualThreads, useVirtualThreads, useVThreads
-
Constructor Details
-
LazyThreadFactory
-
-
Method Details
-
newThread
- Specified by:
newThreadin interfaceThreadFactory- Overrides:
newThreadin classDefaultThreadFactory
-
newThread
- Specified by:
newThreadin interfaceThreadFactory- Overrides:
newThreadin classDefaultThreadFactory
-
renameThread
Description copied from class:DefaultThreadFactoryNames a thread according to base_name, cluster name and local address. If includeClusterName and includeLocalAddress are null, but cluster_name is set, then we assume we have a shared transport and name the thread shared=clusterName. In the latter case, clusterName points to the singleton_name of TP.- Overrides:
renameThreadin classDefaultThreadFactory
-
setAddress
- Specified by:
setAddressin interfaceThreadFactory- Overrides:
setAddressin classDefaultThreadFactory
-
setClusterName
- Specified by:
setClusterNamein interfaceThreadFactory- Overrides:
setClusterNamein classDefaultThreadFactory
-
size
public int size() -
destroy
public void destroy() -
removeTerminatedThreads
public void removeTerminatedThreads() -
dumpThreads
-
renameThreads
protected void renameThreads() -
changeName
-