JIVE Platform
Release 0.2.2

edu.bsu.cs.jive.util
Class ThreadIDFactory

java.lang.Object
  extended by edu.bsu.cs.jive.util.ThreadIDFactory

public final class ThreadIDFactory
extends Object

A factory class for thread identifiers. The default thread factory caches thread objects for reuse, using their immutable identification numbers as keys.


Method Summary
 ThreadID create(long id, String name)
          Get a threadID object.
 ThreadID create(ThreadID.Importer importer)
          Get a threadID object.
static ThreadIDFactory instance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static ThreadIDFactory instance()

create

public ThreadID create(long id,
                       String name)
Get a threadID object. Since thread objects are immutable, a cache may be used rather than allocating a new object.

Parameters:
id - the thread identifier (immutable)
name - a label for the thread (mutable)
Returns:
thread identification object

create

public final ThreadID create(ThreadID.Importer importer)
Get a threadID object. If one does not exist, it is created.

Parameters:
importer -
Returns:
thread identification object
See Also:
create(long, String)

JIVE Platform
Release 0.2.2