Adempiere 3.4.0s

org.compiere.server
Class AdempiereServer

java.lang.Object
  extended by java.lang.Thread
      extended by org.compiere.server.AdempiereServer
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
AcctProcessor, AlertProcessor, LdapProcessor, RequestProcessor, Scheduler, WorkflowProcessor

public abstract class AdempiereServer
extends Thread

Adempiere Server Base

Version:
$Id: AdempiereServer.java,v 1.3 2006/10/09 00:23:26 jjanke Exp $
Author:
Jorg Janke

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  CLogger log
          Logger
protected  MClient p_client
          Client
protected  AdempiereProcessor p_model
          The Processor Model
protected  int p_runCount
          Number of Work executions
protected  long p_startWork
          Tine start of work
protected static MSystem p_system
          System
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
protected AdempiereServer(AdempiereProcessor model, int initialNap)
          Server Base Class
 
Method Summary
static AdempiereServer create(AdempiereProcessor model)
          Create New Server Thead
protected abstract  void doWork()
          Do the actual Work
 Properties getCtx()
          Get Server Context
 Timestamp getDateLastRun()
          Get the date Last run
 Timestamp getDateNextRun(boolean requery)
          Get the date Next run
 String getDescription()
          Get Description
 AdempiereProcessorLog[] getLogs()
          Get Processor Logs
 AdempiereProcessor getModel()
          Get Model
 int getSecondsAlive()
          Get Seconds Alive
 String getServerID()
          Get Unique ID
abstract  String getServerInfo()
          Get Server Info
 long getSleepMS()
           
 Timestamp getStartTime()
          Get Start Time
 String getStatistics()
          Get Run Statistics
 boolean isSleeping()
          Is Sleeping
 void run()
          Run async
 void runNow()
          Run Now
 boolean sleep()
          Sleep for set time
 String toString()
          String Representation
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

p_model

protected AdempiereProcessor p_model
The Processor Model


p_runCount

protected int p_runCount
Number of Work executions


p_startWork

protected long p_startWork
Tine start of work


log

protected CLogger log
Logger


p_system

protected static 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 - model
initialNap - delay time running in sec
Method Detail

create

public static AdempiereServer create(AdempiereProcessor model)
Create New Server Thead

Parameters:
model - model
Returns:
server tread or null

getCtx

public Properties getCtx()
Get Server Context

Returns:
context

getSleepMS

public long getSleepMS()
Returns:
Returns the sleepMS.

sleep

public boolean sleep()
Sleep for set time

Returns:
true if not interrupted

runNow

public void runNow()
Run Now


run

public void run()
Run async

Specified by:
run in interface Runnable
Overrides:
run in class Thread

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

Overrides:
toString in class Thread
Returns:
info

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

Adempiere 3.4.0s

AdemPiere