org.almendra.janet.cas.logger
Class LogCollector

java.lang.Object
  extended by org.almendra.janet.cas.logger.LogCollector
All Implemented Interfaces:
java.lang.Runnable

public class LogCollector
extends java.lang.Object
implements java.lang.Runnable

Author:
Oliver

Field Summary
protected  java.util.List buffer
           
protected  IAgentProxy consumerAgent
           
protected  EDU.oswego.cs.dl.util.concurrent.Semaphore gate
           
protected  boolean isActive
           
protected  EDU.oswego.cs.dl.util.concurrent.ReentrantLock lock
           
protected static long SLEEP_PERIOD
           
 
Constructor Summary
protected LogCollector()
          Creates a new LogCollector object.
  LogCollector(IAgentProxy consumerAgent)
          Creates a new LogCollector object.
 
Method Summary
protected  void addAll(java.util.List entries)
           
protected  void forwardLogMsgs()
           
protected  java.util.List initBuffer()
           
 void log(java.util.List entries)
           
 void log(LogEntry entry)
           
protected  void resetGate()
           
 void run()
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SLEEP_PERIOD

protected static final long SLEEP_PERIOD
See Also:
Constant Field Values

consumerAgent

protected IAgentProxy consumerAgent

lock

protected EDU.oswego.cs.dl.util.concurrent.ReentrantLock lock

buffer

protected java.util.List buffer

gate

protected EDU.oswego.cs.dl.util.concurrent.Semaphore gate

isActive

protected volatile boolean isActive
Constructor Detail

LogCollector

protected LogCollector()
Creates a new LogCollector object.


LogCollector

public LogCollector(IAgentProxy consumerAgent)
Creates a new LogCollector object.

Method Detail

start

public void start()

addAll

protected void addAll(java.util.List entries)

log

public void log(LogEntry entry)
Parameters:
agent -
entry -

log

public void log(java.util.List entries)
Parameters:
agent -
entries -

run

public void run()
Specified by:
run in interface java.lang.Runnable

forwardLogMsgs

protected void forwardLogMsgs()

initBuffer

protected java.util.List initBuffer()

stop

public void stop()

resetGate

protected void resetGate()