Package host.anzo.simon
Class PublicationSearcher
java.lang.Object
java.lang.Thread
host.anzo.simon.PublicationSearcher
- All Implemented Interfaces:
Runnable
TODO document me
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPublicationSearcher(SearchProgressListener listener, int searchTime) Creates a searcher instance that searches for published remote objects on the local network -
Method Summary
Modifier and TypeMethodDescriptionReturns new found publicationsintReturns a value from 0..100 indicating the search progress.booleanReturns if thread is still busy with searchingvoidrun()voidshutdown()Signals a shutdown to the search thread and waits until the shutdown is processed completely.voidSignals a shutdown request to the search thread.
Note:This method does not block until shutdown is finished.Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Constructor Details
-
PublicationSearcher
Creates a searcher instance that searches for published remote objects on the local network- Parameters:
listener- aSearchProgressListenerimplementation which is informed about the current search progresssearchTime- the time the background search thread spends for searching published remote objects- Throws:
IOException
-
-
Method Details
-
run
public void run() -
signalShutdown
public void signalShutdown()Signals a shutdown request to the search thread.
Note:This method does not block until shutdown is finished. It returns immediately. -
shutdown
public void shutdown()Signals a shutdown to the search thread and waits until the shutdown is processed completely. Note:This method blocks until shutdown is finished! -
getNewPublications
Returns new found publications- Returns:
- found publications since the last call of
getNewPublications()
-
getSearchProgress
public int getSearchProgress()Returns a value from 0..100 indicating the search progress. 0 is at beginning, 100 at end.- Returns:
- value 0..100
-
isSearching
public boolean isSearching()Returns if thread is still busy with searching- Returns:
- true if search is in progress, false if search has finished.
-