|
OpenNMS API 1.1.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.core.concurrent.RunnableConsumerThreadPool.FiberThreadImpl
This class implements the Fiber
interface
on top of a Java Thread
instance. These fibers are
the basic unit of work in the pool structure. Each fiber reads from the
input queue and calls the run method on the associated instance. When finished
the fiber invoked the appropriate callback and then repeats the process.
Field Summary | |
private java.lang.Thread |
m_delegateThread
The core thread that is running this fiber. |
private boolean |
m_shutdown
if set true then the thread should exist as soon as possible. |
private int |
m_status
The status of this fiber. |
Fields inherited from interface org.opennms.core.fiber.Fiber |
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED |
Constructor Summary | |
(package private) |
RunnableConsumerThreadPool.FiberThreadImpl(java.lang.String name)
Constructs a new fiber thread and adds the instance to the pool. |
Method Summary | |
java.lang.String |
getName()
Returns the name of the thread. |
int |
getStatus()
Returns the current status of the fiber. |
void |
run()
The run method preforms the actual work for the fiber. |
void |
start()
Starts up the thread. |
void |
stop()
Sets the stop flag in the thread. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.lang.Thread m_delegateThread
private volatile boolean m_shutdown
private volatile int m_status
Constructor Detail |
RunnableConsumerThreadPool.FiberThreadImpl(java.lang.String name)
name
- The name of the fiber.Method Detail |
public void run()
The run method preforms the actual work for
the fiber. It loops infinitely until the shutdown
flag is set, during which time it processes queue
elements. Each element in the queue should be a
instance of Runnable
. After
each instance is recieved its run
method
is invoked.
After the object's run
method completes
it is passed to any interested callers via the listener
list in the encapsulated class.
run
in interface java.lang.Runnable
public void start()
start
in interface Fiber
public void stop()
stop
in interface Fiber
public java.lang.String getName()
getName
in interface Fiber
Fiber
.public int getStatus()
getStatus
in interface Fiber
Fiber
.
|
OpenNMS API 1.1.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |