org.dspace.harvest
Class OAIHarvester.HarvestScheduler

java.lang.Object
  extended by org.dspace.harvest.OAIHarvester.HarvestScheduler
All Implemented Interfaces:
Runnable
Enclosing class:
OAIHarvester

public static class OAIHarvester.HarvestScheduler
extends Object
implements Runnable

The class responsible for scheduling harvesting cycles are regular intervals.

Author:
alexey

Field Summary
protected static Integer activeThreads
           
static int HARVESTER_INTERRUPT_INSERT_THREAD
           
static int HARVESTER_INTERRUPT_KILL_THREAD
           
static int HARVESTER_INTERRUPT_NONE
           
static int HARVESTER_INTERRUPT_PAUSE
           
static int HARVESTER_INTERRUPT_RESUME
           
static int HARVESTER_INTERRUPT_STOP
           
static int HARVESTER_STATUS_PAUSED
           
static int HARVESTER_STATUS_RUNNING
           
static int HARVESTER_STATUS_SLEEPING
           
static int HARVESTER_STATUS_STOPPED
           
static Integer interrupt
           
static Integer interruptValue
           
static Object lock
           
static Integer status
           
 
Constructor Summary
OAIHarvester.HarvestScheduler()
           
 
Method Summary
static void addThread(int collecionID)
          Adds a thread to the ready stack.
static String getStatus()
           
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lock

public static Object lock

activeThreads

protected static volatile Integer activeThreads

HARVESTER_STATUS_RUNNING

public static final int HARVESTER_STATUS_RUNNING
See Also:
Constant Field Values

HARVESTER_STATUS_SLEEPING

public static final int HARVESTER_STATUS_SLEEPING
See Also:
Constant Field Values

HARVESTER_STATUS_PAUSED

public static final int HARVESTER_STATUS_PAUSED
See Also:
Constant Field Values

HARVESTER_STATUS_STOPPED

public static final int HARVESTER_STATUS_STOPPED
See Also:
Constant Field Values

HARVESTER_INTERRUPT_NONE

public static final int HARVESTER_INTERRUPT_NONE
See Also:
Constant Field Values

HARVESTER_INTERRUPT_PAUSE

public static final int HARVESTER_INTERRUPT_PAUSE
See Also:
Constant Field Values

HARVESTER_INTERRUPT_STOP

public static final int HARVESTER_INTERRUPT_STOP
See Also:
Constant Field Values

HARVESTER_INTERRUPT_RESUME

public static final int HARVESTER_INTERRUPT_RESUME
See Also:
Constant Field Values

HARVESTER_INTERRUPT_INSERT_THREAD

public static final int HARVESTER_INTERRUPT_INSERT_THREAD
See Also:
Constant Field Values

HARVESTER_INTERRUPT_KILL_THREAD

public static final int HARVESTER_INTERRUPT_KILL_THREAD
See Also:
Constant Field Values

status

public static Integer status

interrupt

public static Integer interrupt

interruptValue

public static Integer interruptValue
Constructor Detail

OAIHarvester.HarvestScheduler

public OAIHarvester.HarvestScheduler()
                              throws SQLException,
                                     AuthorizeException
Throws:
SQLException
AuthorizeException
Method Detail

getStatus

public static String getStatus()

run

public void run()
Specified by:
run in interface Runnable

addThread

public static void addThread(int collecionID)
                      throws SQLException,
                             IOException,
                             AuthorizeException
Adds a thread to the ready stack. Can also be called externally to queue up a collection for harvesting before it is "due" for another cycle. This allows starting a harvest process from the UI that still "plays nice" with these thread mechanics instead of making an asynchronous call to runHarvest().

Throws:
SQLException
IOException
AuthorizeException


Copyright © 2010 DuraSpace. All Rights Reserved.