com.jalios.jcms.fileprocessor.processingmanagement
Class FileProcessorManager

java.lang.Object
  extended by com.jalios.jcms.ChannelListener
      extended by com.jalios.jcms.fileprocessor.processingmanagement.FileProcessorManager
All Implemented Interfaces:
PluginComponent, JPropertiesListener, Comparable

public class FileProcessorManager
extends ChannelListener
implements JPropertiesListener

FileProcessor singleton manager class

Version:
$Revision: 31337 $

Field Summary
static String REVISION
           
 
Fields inherited from class com.jalios.jcms.ChannelListener
order
 
Method Summary
 void add(ProcessingData data)
          Add ProcessingData in the queue for a futur processing
 void addRunningDataFromScan(String repositoryId)
          Tell the manager that a scan of a repository is currently beginning and no other scan of the same repository should be done until the first has been totally processed.
static FileProcessorManager getInstance()
           
 ProcessingData getLastProcessingData()
           
 ProcessingData getProcessingData()
          Retrieve the next ProcessingData to processe, wait until one is added if none is yet available.
 List<ProcessingData> getProcessingDataQueueCopy()
          Retrieve a copy of the Processing queue containing all ProcessingData yet to be processed
 void handleFinalize()
          Called when the channel is finalized
 void init()
           
 void initAfterStoreLoad()
          Called just after the store has been loaded and the channel has been initialized.
 void initBeforeStoreLoad()
          Called just before the store has been loaded.
 boolean isProcessingThreadAlive()
           
 boolean isProcessingThreadRunning()
           
 boolean isRunnningDataFromScan(String repositoryId)
          Indicates if the processing thread currently process a set of data sent by a scan of the repository directory.
 void propertiesChange(JProperties properties)
          Invoked after properties have been modified in JCMS and save on disk.
 void startProcessingThread()
           
 void stopProcessingThread()
           
 
Methods inherited from class com.jalios.jcms.ChannelListener
compareTo, equals, init
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values
Method Detail

getInstance

public static FileProcessorManager getInstance()

init

public void init()

propertiesChange

public void propertiesChange(JProperties properties)
Description copied from interface: JPropertiesListener
Invoked after properties have been modified in JCMS and save on disk.

You cannot alter the value received in parameters.

Specified by:
propertiesChange in interface JPropertiesListener
Parameters:
properties - the properties which have been modified (may not contain all JCMS properties)

initBeforeStoreLoad

public void initBeforeStoreLoad()
                         throws Exception
Description copied from class: ChannelListener
Called just before the store has been loaded. If for any reason you want to interrupt JCMS startup, you can throw an exception. The exception's message will be displayed in JCMS status page (to any user!).

Specified by:
initBeforeStoreLoad in class ChannelListener
Throws:
Exception - any exception you may want to throw if a problem occurs needing to interrupt JCMS startup.

initAfterStoreLoad

public void initAfterStoreLoad()
                        throws Exception
Description copied from class: ChannelListener
Called just after the store has been loaded and the channel has been initialized. If for any reason you want to interrupt JCMS startup, you can throw an exception. The exception's message will be displayed in JCMS status page (to any user!).

Specified by:
initAfterStoreLoad in class ChannelListener
Throws:
Exception - any exception you may want to throw if a problem occurs needing to interrupt JCMS startup.

handleFinalize

public void handleFinalize()
Description copied from class: ChannelListener
Called when the channel is finalized

Specified by:
handleFinalize in class ChannelListener

startProcessingThread

public void startProcessingThread()

stopProcessingThread

public void stopProcessingThread()

isProcessingThreadRunning

public boolean isProcessingThreadRunning()

isProcessingThreadAlive

public boolean isProcessingThreadAlive()

isRunnningDataFromScan

public boolean isRunnningDataFromScan(String repositoryId)
Indicates if the processing thread currently process a set of data sent by a scan of the repository directory.

Parameters:
repositoryId - The id of the given repository
Returns:
true if a scan of the given repository is already pending or running

addRunningDataFromScan

public void addRunningDataFromScan(String repositoryId)
Tell the manager that a scan of a repository is currently beginning and no other scan of the same repository should be done until the first has been totally processed.

Parameters:
repositoryId - the id of the given repository

getLastProcessingData

public ProcessingData getLastProcessingData()

add

public void add(ProcessingData data)
Add ProcessingData in the queue for a futur processing

Parameters:
data - the ProcessingData to be processed

getProcessingData

public ProcessingData getProcessingData()
                                 throws InterruptedException
Retrieve the next ProcessingData to processe, wait until one is added if none is yet available.

Returns:
the ProcessingData, never return null.
Throws:
InterruptedException

getProcessingDataQueueCopy

public List<ProcessingData> getProcessingDataQueueCopy()
Retrieve a copy of the Processing queue containing all ProcessingData yet to be processed

Returns:
a list of ProcessingData, never return null


Copyright © 2001-2010 Jalios SA. All Rights Reserved.