public abstract class AbstractThread extends Object
Modifier and Type | Field and Description |
---|---|
protected static Logger |
logger
create a static logger.
|
protected boolean |
needRunning |
static org.javlo.thread.AbstractThread.ThreadFileFilter |
threadFileFilter |
Constructor and Description |
---|
AbstractThread() |
Modifier and Type | Method and Description |
---|---|
static AbstractThread |
createInstance(String threadFolder,
Class<? extends AbstractThread> clazz) |
void |
destroy()
destroy the thread, this method can be override for not delete the file after run the process (recurent process)
|
String |
getField(String key) |
static String |
getFileName(String id) |
String |
getId() |
static AbstractThread |
getInstance(File file) |
NotificationService |
getNotificationService() |
long |
getTimeout()
get the timeout, after this time thread is killed by thread manager.
|
String |
logInfo()
info for display in log.
|
boolean |
needRunning() |
abstract void |
run() |
void |
setField(String key,
String value) |
void |
setId(String id) |
void |
setNotificationService(NotificationService notificationService) |
void |
store() |
protected static Logger logger
protected boolean needRunning
public static final org.javlo.thread.AbstractThread.ThreadFileFilter threadFileFilter
public static AbstractThread createInstance(String threadFolder, Class<? extends AbstractThread> clazz) throws InstantiationException, IllegalAccessException
public static AbstractThread getInstance(File file) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException
public void store() throws IOException
IOException
public boolean needRunning()
public void destroy()
public String logInfo()
public long getTimeout()
public abstract void run()
public NotificationService getNotificationService()
public String getId()
public void setId(String id)
public void setNotificationService(NotificationService notificationService)
Copyright © 2012-2018. All Rights Reserved.