org.mortbay.util

Class LifeCycleThread

Implemented Interfaces:
LifeCycle, Runnable
Known Direct Subclasses:
Listener, Server

public abstract class LifeCycleThread
extends java.lang.Object
implements LifeCycle, Runnable

Base Thread class implementing LifeCycle.
Version:
$Revision: 1.9 $
Author:
Greg Wilkins (gregw)

Method Summary

boolean
error(Error e)
Handle error from loop.
boolean
exception(Exception e)
Handle exception from loop.
Thread
getThread()
boolean
isDaemon()
boolean
isStarted()
abstract void
loop()
void
run()
void
setDaemon(boolean d)
void
start()
Start the LifeCycle.
void
stop()

Method Details

error

public boolean error(Error e)
Handle error from loop.
Parameters:
e - The exception
Returns:
True of the loop should continue;

exception

public boolean exception(Exception e)
Handle exception from loop.
Parameters:
e - The exception
Returns:
True of the loop should continue;

getThread

public Thread getThread()

isDaemon

public boolean isDaemon()

isStarted

public boolean isStarted()
Specified by:
isStarted in interface LifeCycle
Returns:
True if the LifeCycle has been started.

loop

public abstract void loop()
            throws InterruptedException,
                   InterruptedIOException,
                   Exception

run

public final void run()

setDaemon

public void setDaemon(boolean d)

start

public void start()
            throws Exception
Start the LifeCycle.
Specified by:
start in interface LifeCycle

stop

public void stop()
            throws InterruptedException
Specified by:
stop in interface LifeCycle

Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.