diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/api/TaskContext.java b/proposal/myrmidon/src/java/org/apache/myrmidon/api/TaskContext.java index 6e8b537fa..923afa7b4 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/api/TaskContext.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/api/TaskContext.java @@ -8,7 +8,6 @@ package org.apache.myrmidon.api; import java.io.File; -import org.apache.avalon.framework.Enum; /** * This interface represents the Context in which Task is executed. @@ -22,12 +21,6 @@ import org.apache.avalon.framework.Enum; public interface TaskContext extends Context { - //these values are used when setting properties to indicate the scope at - //which properties are set - ScopeEnum CURRENT = new ScopeEnum( "Current" ); - ScopeEnum PARENT = new ScopeEnum( "Parent" ); - ScopeEnum TOP_LEVEL = new ScopeEnum( "TopLevel" ); - //these are the names of properties that every TaskContext must contain String BASE_DIRECTORY = "myrmidon.base.directory"; String NAME = "myrmidon.task.name"; @@ -81,16 +74,6 @@ public interface TaskContext void setProperty( String name, Object value ) throws TaskException; - /** - * Set property value. - * - * @param name the name of property - * @param value the value of property - * @param scope the scope at which to set property - */ - void setProperty( String name, Object value, ScopeEnum scope ) - throws TaskException; - /** * Create a Child Context. * This allows separate hierarchly contexts to be easily constructed. @@ -101,17 +84,5 @@ public interface TaskContext */ TaskContext createSubContext( String name ) throws TaskException; - - /** - * Safe wrapper class for Scope enums. - */ - public final class ScopeEnum - extends Enum - { - ScopeEnum( final String name ) - { - super( name ); - } - } } diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace/DefaultTaskContext.java b/proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace/DefaultTaskContext.java index 57d3afc5d..ade751592 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace/DefaultTaskContext.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace/DefaultTaskContext.java @@ -227,50 +227,9 @@ public class DefaultTaskContext */ public void setProperty( final String name, final Object value ) throws TaskException - { - setProperty( name, value, CURRENT ); - } - - /** - * Set property value. - */ - public void setProperty( final String name, final Object value, final ScopeEnum scope ) - throws TaskException { checkPropertyValid( name, value ); - - if( CURRENT == scope ) - { - m_contextData.put( name, value ); - } - else if( PARENT == scope ) - { - if( null == m_parent ) - { - final String message = REZ.getString( "no-parent.error" ); - throw new TaskException( message ); - } - else - { - m_parent.setProperty( name, value ); - } - } - else if( TOP_LEVEL == scope ) - { - DefaultTaskContext context = this; - - while( null != context.m_parent ) - { - context = (DefaultTaskContext)context.m_parent; - } - - context.m_contextData.put( name, value ); - } - else - { - final String message = REZ.getString( "bad-scope.error", scope ); - throw new IllegalStateException( message ); - } + m_contextData.put( name, value ); } /**