ovidiu 2002/10/01 00:32:14
Modified: src/java/org/apache/cocoon/components/flow
AbstractInterpreter.java
Log:
Implement Configurable. Read the reload-scripts and check-time
configuration parameters locally, instead of being set from
InterpreterSelector.
Revision Changes Path
1.9 +11 -11
xml-cocoon2/src/java/org/apache/cocoon/components/flow/AbstractInterpreter.java
Index: AbstractInterpreter.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/flow/AbstractInterpreter.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- AbstractInterpreter.java 24 Sep 2002 08:08:32 -0000 1.8
+++ AbstractInterpreter.java 1 Oct 2002 07:32:14 -0000 1.9
@@ -62,6 +62,9 @@
import org.apache.avalon.framework.thread.SingleThreaded;
import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.avalon.framework.context.Contextualizable;
+import org.apache.avalon.framework.configuration.Configurable;
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.context.ContextException;
import org.apache.avalon.framework.component.Composable;
import org.apache.avalon.framework.component.ComponentManager;
@@ -80,7 +83,7 @@
*/
public abstract class AbstractInterpreter extends AbstractLogEnabled
implements Component, Composable, Contextualizable, Interpreter,
- SingleThreaded
+ SingleThreaded, Configurable
{
/**
* List of source locations that need to be resolved.
@@ -103,6 +106,13 @@
*/
protected long checkTime;
+ public void configure(Configuration config)
+ throws ConfigurationException
+ {
+ reloadScripts = config.getChild("reload-scripts").getValueAsBoolean(false);
+ checkTime = config.getChild("check-time").getValueAsLong(1000L);
+ }
+
public void compose(ComponentManager manager)
throws ComponentException
{
@@ -118,16 +128,6 @@
throws ContextException
{
this.context = (Context)context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
- }
-
- public void setReloadScripts(boolean yn)
- {
- reloadScripts = yn;
- }
-
- public void setCheckTime(long time)
- {
- checkTime = time;
}
/**
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]