org.jgroups.util
Class LazyThreadFactory

java.lang.Object
  extended by org.jgroups.util.DefaultThreadFactory
      extended by org.jgroups.util.LazyThreadFactory
All Implemented Interfaces:
java.util.concurrent.ThreadFactory

public class LazyThreadFactory
extends DefaultThreadFactory

Lazily names threads: whenever the address or cluster name is changed, all threads are renamed

Author:
Bela Ban

Field Summary
 
Fields inherited from class org.jgroups.util.DefaultThreadFactory
address, baseName, clusterName, counter, createDaemons, includeClusterName, includeLocalAddress, use_numbering
 
Constructor Summary
LazyThreadFactory(java.lang.String baseName, boolean createDaemons, boolean use_numbering)
           
 
Method Summary
 java.lang.Thread newThread(java.lang.Runnable r)
           
 java.lang.Thread newThread(java.lang.Runnable r, java.lang.String name)
           
 java.lang.Thread newThread(java.lang.ThreadGroup group, java.lang.Runnable r, java.lang.String name)
           
protected  void renameThreads()
           
 void setAddress(java.lang.String address)
           
 void setClusterName(java.lang.String cluster_name)
           
 
Methods inherited from class org.jgroups.util.DefaultThreadFactory
newThread, renameThread, renameThread, renameThread, renameThread, setIncludeClusterName, setPattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazyThreadFactory

public LazyThreadFactory(java.lang.String baseName,
                         boolean createDaemons,
                         boolean use_numbering)
Method Detail

newThread

public java.lang.Thread newThread(java.lang.Runnable r,
                                  java.lang.String name)
Overrides:
newThread in class DefaultThreadFactory

newThread

public java.lang.Thread newThread(java.lang.Runnable r)
Specified by:
newThread in interface java.util.concurrent.ThreadFactory
Overrides:
newThread in class DefaultThreadFactory

newThread

public java.lang.Thread newThread(java.lang.ThreadGroup group,
                                  java.lang.Runnable r,
                                  java.lang.String name)
Overrides:
newThread in class DefaultThreadFactory

setAddress

public void setAddress(java.lang.String address)
Overrides:
setAddress in class DefaultThreadFactory

setClusterName

public void setClusterName(java.lang.String cluster_name)
Overrides:
setClusterName in class DefaultThreadFactory

renameThreads

protected void renameThreads()


Copyright © 1998-2012 Bela Ban / Red Hat. All Rights Reserved.