org.apache.cocoon.components.store
Class FilesystemQueueImpl

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.cocoon.components.store.FilesystemQueueImpl
All Implemented Interfaces:
org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.activity.Disposable, FilesystemQueue, org.apache.avalon.framework.logger.Loggable, org.apache.avalon.excalibur.collections.PriorityQueue, java.lang.Runnable, org.apache.avalon.framework.activity.Startable, org.apache.avalon.framework.thread.ThreadSafe

public final class FilesystemQueueImpl
extends org.apache.avalon.framework.logger.AbstractLoggable
implements FilesystemQueue, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, java.lang.Runnable, org.apache.avalon.framework.thread.ThreadSafe, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.activity.Startable

This class provides a asynchron queue for storing objects on the filesystem. Every store component can uses this component to store object in the configured cache directory.

Author:
Gerhard Froehlich

Fields inherited from interface org.apache.cocoon.components.store.FilesystemQueue
ROLE
 
Constructor Summary
FilesystemQueueImpl()
           
 
Method Summary
 void clear()
          Clear all elements from queue.
 void compose(org.apache.avalon.framework.component.ComponentManager manager)
          Get components of the ComponentManager
 void configure(org.apache.avalon.framework.configuration.Configuration conf)
          Configure the Filesystem Queue: handlerinterval = Interval of the Queue Handler Thread threadpriority = Priority of the Queue Handler Thread >LI>maxobjects = Defines the max. numbers of Objects in the queue
 void contextualize(org.apache.avalon.framework.context.Context context)
          Get the context
 void dispose()
          Dispose the component
 void insert(java.lang.Comparable element)
          Insert an element into queue.
 boolean isEmpty()
          Test if queue is empty.
 java.lang.Comparable peek()
          Return element on top of heap but don't remove it.
 java.lang.Comparable pop()
          Return element on top of heap and remove it.
 void reportSize()
           
 void run()
           
 void start()
           
 void stop()
           
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable
getLogger, setLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilesystemQueueImpl

public FilesystemQueueImpl()
Method Detail

contextualize

public void contextualize(org.apache.avalon.framework.context.Context context)
                   throws org.apache.avalon.framework.context.ContextException
Get the context
Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable
Parameters:
the - Context of the application

compose

public void compose(org.apache.avalon.framework.component.ComponentManager manager)
             throws org.apache.avalon.framework.component.ComponentException
Get components of the ComponentManager
Specified by:
compose in interface org.apache.avalon.framework.component.Composable
Parameters:
the - ComponentManager

dispose

public void dispose()
Dispose the component
Specified by:
dispose in interface org.apache.avalon.framework.activity.Disposable

configure

public void configure(org.apache.avalon.framework.configuration.Configuration conf)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Configure the Filesystem Queue:
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable

start

public void start()
Specified by:
start in interface org.apache.avalon.framework.activity.Startable

stop

public void stop()
Specified by:
stop in interface org.apache.avalon.framework.activity.Startable

run

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

clear

public void clear()
Clear all elements from queue.
Specified by:
clear in interface org.apache.avalon.excalibur.collections.PriorityQueue

isEmpty

public boolean isEmpty()
Test if queue is empty.
Specified by:
isEmpty in interface org.apache.avalon.excalibur.collections.PriorityQueue
Returns:
true if queue is empty else false.

insert

public void insert(java.lang.Comparable element)
Insert an element into queue.
Specified by:
insert in interface org.apache.avalon.excalibur.collections.PriorityQueue
Parameters:
element - the element to be inserted

peek

public java.lang.Comparable peek()
                          throws java.util.NoSuchElementException
Return element on top of heap but don't remove it.
Specified by:
peek in interface org.apache.avalon.excalibur.collections.PriorityQueue
Returns:
the element at top of heap
Throws:
java.util.NoSuchElementException - if isEmpty() == true

pop

public java.lang.Comparable pop()
                         throws java.util.NoSuchElementException
Return element on top of heap and remove it.
Specified by:
pop in interface org.apache.avalon.excalibur.collections.PriorityQueue
Returns:
the element at top of heap
Throws:
java.util.NoSuchElementException - if isEmpty() == true

reportSize

public void reportSize()


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.