Package org.jgroups.util
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate final Collection<WeakReference<Thread>> Fields inherited from class org.jgroups.util.DefaultThreadFactory
address, baseName, clusterName, counter, createDaemons, includeClusterName, includeLocalAddress, log, use_numbering, use_virtual_threads -
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()voidprotected voidvoidsetAddress(String address) voidsetClusterName(String cluster_name) intsize()Methods inherited from class org.jgroups.util.DefaultThreadFactory
getNewThreadName, getThreadName, log, newThread, renameThread, renameThread, renameThread, setIncludeClusterName, setPattern, useFibers, useFibers, useVirtualThreads, useVirtualThreads
-
Field Details
-
threads
-
ADDR
- See Also:
-
CLUSTER
- See Also:
-
-
Constructor Details
-
LazyThreadFactory
-
-
Method Details
-
newThread
- Specified by:
newThreadin interfaceThreadFactory- Overrides:
newThreadin classDefaultThreadFactory
-
newThread
- Specified by:
newThreadin interfaceThreadFactory- Overrides:
newThreadin 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
Replaces "<ADDR>" with the local address and "<CLUSTER>" with the cluster name
-