org.apache.cocoon.components.source.helpers
Class DelaySourceRefresher

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.source.helpers.DelaySourceRefresher
All Implemented Interfaces:
Disposable, Component, Configurable, Contextualizable, LogEnabled, Serviceable, ThreadSafe, SourceRefresher

public class DelaySourceRefresher
extends AbstractLogEnabled
implements Contextualizable, Serviceable, Configurable, Disposable, ThreadSafe, SourceRefresher

Default implementation of the refresher.

Since:
2.1.1
Version:
$Id: DelaySourceRefresher.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Nested Class Summary
protected  class DelaySourceRefresher.ConfigurationTask
          Task which writes refresher configuraiton into the source.
protected  class DelaySourceRefresher.RefresherTask
           
 
Field Summary
protected  boolean changed
           
protected  File configFile
          The source to persist refresher entries into
protected  DelaySourceRefresher.ConfigurationTask configurationTask
           
protected  Context context
           
protected  Map entries
           
protected  ServiceManager manager
           
protected  SourceResolver resolver
           
protected  RunnableManager runnable
           
protected  File workDir
           
 
Fields inherited from interface org.apache.cocoon.components.source.helpers.SourceRefresher
PARAM_CACHE_INTERVAL, ROLE
 
Constructor Summary
DelaySourceRefresher()
           
 
Method Summary
protected  void addRefreshSource(String key, String uri, long delay, long interval)
           
 void configure(Configuration configuration)
           
 void contextualize(Context context)
           
 void dispose()
           
 void refresh(String name, String uri, Parameters parameters)
          Add a uri to the SourceRefresher.
protected  void removeRefreshSource(String key)
           
 void service(ServiceManager manager)
           
protected  void startConfigurationTask(long interval)
           
protected  void stopConfigurationTask()
           
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected Context context

manager

protected ServiceManager manager

resolver

protected SourceResolver resolver

runnable

protected RunnableManager runnable

entries

protected Map entries

workDir

protected File workDir

configFile

protected File configFile
The source to persist refresher entries into


changed

protected volatile boolean changed

configurationTask

protected DelaySourceRefresher.ConfigurationTask configurationTask
Constructor Detail

DelaySourceRefresher

public DelaySourceRefresher()
Method Detail

contextualize

public void contextualize(Context context)
                   throws ContextException
Specified by:
contextualize in interface Contextualizable
Throws:
ContextException

service

public void service(ServiceManager manager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException

configure

public void configure(Configuration configuration)
               throws ConfigurationException
Specified by:
configure in interface Configurable
Throws:
ConfigurationException

dispose

public void dispose()
Specified by:
dispose in interface Disposable

refresh

public void refresh(String name,
                    String uri,
                    Parameters parameters)
             throws SourceException
Description copied from interface: SourceRefresher
Add a uri to the SourceRefresher.

Specified by:
refresh in interface SourceRefresher
Parameters:
name - Uniquely identifying name for the source.
uri - The uri to refresh. Every valid protocol can be used.
parameters - Additional parameters such as an interval between refresh runs.
Throws:
SourceException

addRefreshSource

protected void addRefreshSource(String key,
                                String uri,
                                long delay,
                                long interval)

removeRefreshSource

protected void removeRefreshSource(String key)

startConfigurationTask

protected void startConfigurationTask(long interval)
Parameters:
interval -

stopConfigurationTask

protected void stopConfigurationTask()


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.