mgi.logme.worker
Class ObjectQueue

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

public class ObjectQueue
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(LogObject lo)
          Adds an item to the queue
 LogObject getLogObject()
           
static ObjectQueue 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 ObjectQueue 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(LogObject lo)
                throws java.lang.InterruptedException
Adds an item to the queue

Throws:
java.lang.InterruptedException

getLogObject

public LogObject getLogObject()