com.atlassian.confluence.search.lucene.queue
Class InMemoryIndexTaskQueue

java.lang.Object
  extended by com.atlassian.confluence.search.lucene.queue.InMemoryIndexTaskQueue
All Implemented Interfaces:
IndexTaskQueue

public class InMemoryIndexTaskQueue
extends java.lang.Object
implements IndexTaskQueue

An in memory implementation of the Index Task Queue. NOTE: We synchronise on the taskqueue object rather than on the queue list itself, because otherwise you get a nasty race condition when you're swapping one queue object for another.


Constructor Summary
InMemoryIndexTaskQueue()
           
 
Method Summary
 void enqueue(IndexTask task)
          Add a new task to this queue.
 void enqueueAll(java.util.Collection tasks)
          Add a collection of tasks to this queue.
 java.util.List flushQueue()
          Flush the contents of the queue, returning those elements currently queued as the result.
 java.util.List getQueuedEntries()
          Retrieve a list of all of the queued entries.
 int getSize()
          Retrieve the number of elements in the queue.
 void reset()
          Remove all queued index tasks from this queue.
 void setIndexTaskFactory(IndexTaskFactory indexTaskFactory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InMemoryIndexTaskQueue

public InMemoryIndexTaskQueue()
Method Detail

getSize

public int getSize()
Description copied from interface: IndexTaskQueue
Retrieve the number of elements in the queue.

Specified by:
getSize in interface IndexTaskQueue
Returns:
size of the queue.

getQueuedEntries

public java.util.List getQueuedEntries()
Description copied from interface: IndexTaskQueue
Retrieve a list of all of the queued entries.

Specified by:
getQueuedEntries in interface IndexTaskQueue
Returns:
a list of IndexTask instances.

enqueue

public void enqueue(IndexTask task)
Description copied from interface: IndexTaskQueue
Add a new task to this queue.

Specified by:
enqueue in interface IndexTaskQueue

enqueueAll

public void enqueueAll(java.util.Collection tasks)
Description copied from interface: IndexTaskQueue
Add a collection of tasks to this queue.

Specified by:
enqueueAll in interface IndexTaskQueue

flushQueue

public java.util.List flushQueue()
Description copied from interface: IndexTaskQueue
Flush the contents of the queue, returning those elements currently queued as the result.

Specified by:
flushQueue in interface IndexTaskQueue
Returns:
the list of entries on the queue when it was flushed.

reset

public void reset()
Description copied from interface: IndexTaskQueue
Remove all queued index tasks from this queue.

Specified by:
reset in interface IndexTaskQueue

setIndexTaskFactory

public void setIndexTaskFactory(IndexTaskFactory indexTaskFactory)


Copyright © 2003-2008 Atlassian Pty Ltd. All Rights Reserved.