org.cip4.jdflib.util
Class ThreadUtil.WaitTimeout<a>

java.lang.Object
  extended by org.cip4.jdflib.util.ThreadUtil.WaitTimeout<a>
Type Parameters:
a - the returned object data type
All Implemented Interfaces:
Runnable
Enclosing class:
ThreadUtil

public abstract static class ThreadUtil.WaitTimeout<a>
extends Object
implements Runnable

abstract class to run uninteruptable stuff in an interruptable thread

Author:
Dr. Rainer Prosi, Heidelberger Druckmaschinen AG 11.12.2008

Field Summary
protected  String baseName
           
 
Constructor Summary
ThreadUtil.WaitTimeout(int millis)
           
 
Method Summary
 a getWaitedObject()
           
protected abstract  a handle()
          this is the handle routine that may take longer
it should return the expected object when completed
 void run()
           
 void start()
          start the thread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

baseName

protected String baseName
Constructor Detail

ThreadUtil.WaitTimeout

public ThreadUtil.WaitTimeout(int millis)
Parameters:
millis - wait timeout in milliseconds
Method Detail

handle

protected abstract a handle()
this is the handle routine that may take longer
it should return the expected object when completed

Returns:
the object that this whole class is about

start

public final void start()
start the thread


run

public final void run()
Specified by:
run in interface Runnable
See Also:
Runnable.run()

getWaitedObject

public final a getWaitedObject()
Returns:
the object that you waited for, null if the timeout is reached


Copyright © 2013. All Rights Reserved.