Compiere 3.1

org.compiere.process
Class CompiereServer

java.lang.Object
  extended by java.lang.Thread
      extended by org.compiere.process.CompiereServer
All Implemented Interfaces:
Runnable

public abstract class CompiereServer
extends Thread

Compiere Server Base

Version:
$Id: CompiereServer.java,v 1.2 2006/07/30 00:54:44 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  PO p_processor
          Processor Instance
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
CompiereServer(String name)
          CompiereServer
 
Method Summary
abstract  boolean canDoWork()
          Is there work for the Worker?
abstract  boolean doWork()
          Worker - do the work
 Timestamp getLastStart()
          Get Last Start of Server
 int getPollCount()
          Get Poll Count
abstract  String getProcessorName()
          Get Processor Name
 int getSleepSeconds()
          Get Sleep Seconds
 Timestamp getStart()
          Get Start of Server
 String getStatistics()
          Statistics
 int getWorkCount()
          Get Work Count
 int getWorkTime()
          Get Working Time
 boolean isWorking()
          Is Working
 void run()
          Run - Do the Work
 void setProcessor(PO processor)
          Set Server Processor
 void setSleepSeconds(int sleepSeconds)
          Set Sleep Seconds
 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

log

protected CLogger log
Logger


p_processor

protected PO p_processor
Processor Instance

Constructor Detail

CompiereServer

public CompiereServer(String name)
CompiereServer

Parameters:
name - server name
Method Detail

isWorking

public boolean isWorking()
Is Working

Returns:
true if working

getPollCount

public int getPollCount()
Get Poll Count

Returns:
number of polls

getWorkCount

public int getWorkCount()
Get Work Count

Returns:
number of work runs

getWorkTime

public int getWorkTime()
Get Working Time

Returns:
working time in ms

getStart

public Timestamp getStart()
Get Start of Server

Returns:
start of server

getLastStart

public Timestamp getLastStart()
Get Last Start of Server

Returns:
last start of server

getSleepSeconds

public int getSleepSeconds()
Get Sleep Seconds

Returns:
sleep seconds

setSleepSeconds

public void setSleepSeconds(int sleepSeconds)
Set Sleep Seconds

Parameters:
sleepSeconds - sleep seconds

setProcessor

public void setProcessor(PO processor)
Set Server Processor

Parameters:
processor - processor

getStatistics

public String getStatistics()
Statistics

Returns:
info

toString

public String toString()
String Representation

Overrides:
toString in class Thread
Returns:
info

run

public final void run()
Run - Do the Work

Specified by:
run in interface Runnable
Overrides:
run in class Thread
See Also:
Runnable.run()

getProcessorName

public abstract String getProcessorName()
Get Processor Name

Returns:
Processor Name

canDoWork

public abstract boolean canDoWork()
Is there work for the Worker?

Returns:
true if doWork should be called

doWork

public abstract boolean doWork()
Worker - do the work

Returns:
true if worker can continue

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.