com.cometway.io
Class LogMonitorAgent

java.lang.Object
  extended by com.cometway.props.Props
      extended by com.cometway.ak.Agent
          extended by com.cometway.io.LogMonitorAgent
All Implemented Interfaces:
AgentInterface, HasStateMachineModel

public class LogMonitorAgent
extends Agent


Nested Class Summary
 class LogMonitorAgent.FileReaderThread
           
 
Field Summary
protected  java.io.RandomAccessFile file
           
protected  long filePtr
           
protected  LogMonitorAgent.FileReaderThread fileReaderThread
           
protected  com.cometway.io.LogMonitorAgent.FileWatcherThread fileWatcherThread
           
protected  java.lang.String log_file
           
protected  java.lang.Object sync
           
 
Fields inherited from class com.cometway.ak.Agent
agent_id, agentController, CREATING_STATE, debugReporter, DESTROYED_STATE, DESTROYING_STATE, errorReporter, FAILED_STATE, printlnReporter, props, RUNNING_STATE, STARTING_STATE, STOPPED_STATE, STOPPING_STATE, warningReporter
 
Constructor Summary
LogMonitorAgent()
           
 
Method Summary
 void initProps()
          Override this method to initialize this agent's properties before it is started.
protected  void openLogFile()
           
protected  void processLine(java.lang.String line)
           
protected  java.lang.String readLine()
           
 void start()
          Override this method to initiate activities for this agent.
 
Methods inherited from class com.cometway.ak.Agent
currentStateEquals, debug, destroy, error, error, getAgentController, getDateTimeStr, getProps, getServiceImpl, getStateMachineModel, println, register, registerService, setAgentController, setProps, stop, toString, unregister, unregisterService, warning, warning
 
Methods inherited from class com.cometway.props.Props
addListener, append, copy, copyFrom, copyTo, decrementInteger, dump, enableListeners, enumerateKeys, format, getBoolean, getByteArray, getCharacter, getDate, getDate, getDateString, getDouble, getFloat, getHexString, getInteger, getKeys, getLong, getNextKey, getProperty, getProperty, getPropsContainer, getSize, getString, getString, getTokens, getTokens, getTrimmedString, getVector, hasProperty, incrementInteger, insertProps, loadProps, notifyPropsChanged, notifyPropsChangedIgnore, notifyPropsChangedIgnore, parse, propertyMatchesRegEx, readFromFile, regExPropertyMatches, removeAll, removeListener, removeProperty, resumeNotify, saveProps, set, setBoolean, setCharacter, setDefault, setDouble, setFloat, setInteger, setLong, setProperty, setProperty, setProperty, setPropsContainer, suspendNotify, writeToFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log_file

protected java.lang.String log_file

sync

protected java.lang.Object sync

fileReaderThread

protected LogMonitorAgent.FileReaderThread fileReaderThread

fileWatcherThread

protected com.cometway.io.LogMonitorAgent.FileWatcherThread fileWatcherThread

file

protected java.io.RandomAccessFile file

filePtr

protected long filePtr
Constructor Detail

LogMonitorAgent

public LogMonitorAgent()
Method Detail

initProps

public void initProps()
Description copied from class: Agent
Override this method to initialize this agent's properties before it is started.

Specified by:
initProps in interface AgentInterface
Overrides:
initProps in class Agent

start

public void start()
Description copied from class: Agent
Override this method to initiate activities for this agent.

Specified by:
start in interface AgentInterface
Overrides:
start in class Agent

openLogFile

protected void openLogFile()
                    throws java.io.IOException
Throws:
java.io.IOException

readLine

protected java.lang.String readLine()

processLine

protected void processLine(java.lang.String line)