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

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.components.source.helpers.DelaySourceRefresher
All Implemented Interfaces:
Component, SourceRefresher

public class DelaySourceRefresher
extends org.apache.cocoon.util.AbstractLogEnabled
implements SourceRefresher

Default implementation of the refresher.

Since:
2.1.1
Version:
$Id: DelaySourceRefresher.html 1304280 2012-03-23 11:18:01Z 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  String fileName
           
protected  ServiceManager manager
           
protected  SourceResolver resolver
           
protected  org.apache.cocoon.thread.RunnableManager runnable
           
protected  org.apache.cocoon.configuration.Settings settings
           
protected  long writeInterval
           
 
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 destroy()
           
 void init()
           
 void refresh(String name, String uri, Parameters parameters)
          Add a uri to the SourceRefresher.
protected  void removeRefreshSource(String key)
           
 void setAvalonContext(Context context)
           
 void setRunnableManager(org.apache.cocoon.thread.RunnableManager runnable)
           
 void setServiceManager(ServiceManager manager)
           
 void setSettings(org.apache.cocoon.configuration.Settings settings)
           
 void setSourceResolver(SourceResolver resolver)
           
 void setWriteFile(String fileName)
           
 void setWriteInterval(long interval)
           
protected  void startConfigurationTask(long interval)
           
protected  void stopConfigurationTask()
           
 
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected Context context

resolver

protected SourceResolver resolver

runnable

protected org.apache.cocoon.thread.RunnableManager runnable

manager

protected ServiceManager manager

settings

protected org.apache.cocoon.configuration.Settings settings

writeInterval

protected long writeInterval

fileName

protected String fileName

entries

protected Map entries

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

init

public void init()
          throws ConfigurationException
Throws:
ConfigurationException

destroy

public void destroy()

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()

setServiceManager

public void setServiceManager(ServiceManager manager)

setSourceResolver

public void setSourceResolver(SourceResolver resolver)

setRunnableManager

public void setRunnableManager(org.apache.cocoon.thread.RunnableManager runnable)

setSettings

public void setSettings(org.apache.cocoon.configuration.Settings settings)

setWriteFile

public void setWriteFile(String fileName)

setWriteInterval

public void setWriteInterval(long interval)

setAvalonContext

public void setAvalonContext(Context context)


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.