mgi.logme.worker
Class SaveQueue

java.lang.Object
  extended bymgi.logme.worker.SaveQueue

public class SaveQueue
extends java.lang.Object

Class to generate and use a Queue
 Usage:
 
 LogVisit lv = new LogVisit();
 lv.setPath(request.getPathInfo().substring(1,request.getPathInfo().lastIndexOf("/")));
 lv.setReferer(request.getHeader("Referer"));
 lv.setTs(System.currentTimeMillis());
 SaveQueue sq = SaveQueue.getQueue();
 sq.addMessage(lv);
 
 


Field Summary
 int saved
           
static java.util.List threadPool
           
static int threadPoolSize
           
 
Method Summary
 void addMessage(LogVisit lv)
          Adds an item to the queue
 LogVisit getLogVisit()
           
static SaveQueue getQueue()
          Returns a SaveQueue
 int getQueueSize()
          Returns the count of all items currently in the queue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

threadPoolSize

public static int threadPoolSize

saved

public int saved

threadPool

public static java.util.List threadPool
Method Detail

getQueue

public static SaveQueue getQueue()
Returns a SaveQueue

Returns:
SaveQueue

getQueueSize

public int getQueueSize()
Returns the count of all items currently in the queue

Returns:
Size of currently working entries and waiting entries

addMessage

public void addMessage(LogVisit lv)
                throws java.lang.InterruptedException
Adds an item to the queue

Throws:
java.lang.InterruptedException

getLogVisit

public LogVisit getLogVisit()