Package org.compiere.server
Class AdempiereServer
- java.lang.Object
-
- org.compiere.server.AdempiereServer
-
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
AcctProcessor
,AlertProcessor
,ReplicationProcessor
,RequestProcessor
,Scheduler
,WorkflowProcessor
public abstract class AdempiereServer extends Object implements Runnable
Adempiere Server Base- Version:
- $Id: AdempiereServer.java,v 1.3 2006/10/09 00:23:26 jjanke Exp $
- Author:
- Jorg Janke
-
-
Field Summary
Fields Modifier and Type Field Description protected CLogger
log
Loggerprotected long
m_sleepMS
Milliseconds to sleep - 0 Sec defaultprotected long
m_start
Server start timeprotected MClient
p_client
Clientprotected AdempiereProcessor
p_model
The Processor Modelprotected int
p_runCount
Number of Work executionsprotected long
p_startWork
Tine start of workprotected static MSystem
p_system
System
-
Constructor Summary
Constructors Modifier Constructor Description protected
AdempiereServer(AdempiereProcessor model, int initialNap)
Server Base Class
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
doRun()
Run asyncvoid
doRunNow()
Run Nowprotected abstract void
doWork()
Do the actual WorkProperties
getCtx()
Get Server ContextTimestamp
getDateLastRun()
Get the date Last runTimestamp
getDateNextRun(boolean requery)
Get the date Next runString
getDescription()
Get Descriptionlong
getInitialNap()
AdempiereProcessorLog[]
getLogs()
Get Processor LogsAdempiereProcessor
getModel()
Get ModelString
getName()
int
getSecondsAlive()
Get Seconds AliveString
getServerID()
Get Unique IDabstract String
getServerInfo()
Get Server Infolong
getSleepMS()
Timestamp
getStartTime()
Get Start TimeString
getStatistics()
Get Run Statisticsprotected boolean
isInterrupted()
static boolean
isOKtoRunOnIP(AdempiereProcessor model)
boolean
isSleeping()
Is Sleepingvoid
recalculateSleepMS()
void
run()
void
runNow()
String
toString()
String Representation
-
-
-
Field Detail
-
p_model
protected volatile AdempiereProcessor p_model
The Processor Model
-
m_sleepMS
protected long m_sleepMS
Milliseconds to sleep - 0 Sec default
-
m_start
protected long m_start
Server start time
-
p_runCount
protected int p_runCount
Number of Work executions
-
p_startWork
protected long p_startWork
Tine start of work
-
log
protected transient CLogger log
Logger
-
p_system
protected static volatile MSystem p_system
System
-
p_client
protected MClient p_client
Client
-
-
Constructor Detail
-
AdempiereServer
protected AdempiereServer(AdempiereProcessor model, int initialNap)
Server Base Class- Parameters:
model
- modelinitialNap
- delay time running in sec
-
-
Method Detail
-
getCtx
public Properties getCtx()
Get Server Context- Returns:
- context
-
recalculateSleepMS
public void recalculateSleepMS()
-
getSleepMS
public long getSleepMS()
- Returns:
- Returns the sleepMS.
-
getInitialNap
public long getInitialNap()
-
runNow
public void runNow()
-
doRunNow
public void doRunNow()
Run Now
-
doRun
protected void doRun()
Run async
-
getStatistics
public String getStatistics()
Get Run Statistics- Returns:
- Statistic info
-
doWork
protected abstract void doWork()
Do the actual Work
-
getServerInfo
public abstract String getServerInfo()
Get Server Info- Returns:
- info
-
getServerID
public String getServerID()
Get Unique ID- Returns:
- Unique ID
-
getDateNextRun
public Timestamp getDateNextRun(boolean requery)
Get the date Next run- Parameters:
requery
- requery database- Returns:
- date next run
-
getDateLastRun
public Timestamp getDateLastRun()
Get the date Last run- Returns:
- date lext run
-
getDescription
public String getDescription()
Get Description- Returns:
- Description
-
getModel
public AdempiereProcessor getModel()
Get Model- Returns:
- Model
-
isSleeping
public boolean isSleeping()
Is Sleeping- Returns:
- sleeping
-
toString
public String toString()
String Representation
-
getSecondsAlive
public int getSecondsAlive()
Get Seconds Alive- Returns:
- seconds alive
-
getStartTime
public Timestamp getStartTime()
Get Start Time- Returns:
- start time
-
getLogs
public AdempiereProcessorLog[] getLogs()
Get Processor Logs- Returns:
- logs
-
isInterrupted
protected boolean isInterrupted()
-
getName
public String getName()
-
isOKtoRunOnIP
public static boolean isOKtoRunOnIP(AdempiereProcessor model)
-
-