donaldp 02/03/01 02:34:20
Modified:
proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace
DefaultTaskContext.java
proposal/myrmidon/src/java/org/apache/myrmidon/api
TaskContext.java
Log:
Remove scoping for the time being as it wasn't really being used
Revision Changes Path
1.17 +2 -43
jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace/DefaultTaskContext.java
Index: DefaultTaskContext.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace/DefaultTaskContext.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- DefaultTaskContext.java 25 Feb 2002 10:42:43 -0000 1.16
+++ DefaultTaskContext.java 1 Mar 2002 10:34:20 -0000 1.17
@@ -22,7 +22,7 @@
* Default implementation of TaskContext.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.16 $ $Date: 2002/02/25 10:42:43 $
+ * @version $Revision: 1.17 $ $Date: 2002/03/01 10:34:20 $
*/
public class DefaultTaskContext
implements TaskContext
@@ -228,49 +228,8 @@
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 );
}
/**
1.21 +1 -30
jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/api/TaskContext.java
Index: TaskContext.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/api/TaskContext.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- TaskContext.java 25 Feb 2002 10:42:43 -0000 1.20
+++ TaskContext.java 1 Mar 2002 10:34:20 -0000 1.21
@@ -8,7 +8,6 @@
package org.apache.myrmidon.api;
import java.io.File;
-import org.apache.avalon.framework.Enum;
/**
* This interface represents the <em>Context</em> in which Task is executed.
@@ -17,17 +16,11 @@
* Unlike other APIs the Logging is provided through another interface
(LogEnabled).
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.20 $ $Date: 2002/02/25 10:42:43 $
+ * @version $Revision: 1.21 $ $Date: 2002/03/01 10:34:20 $
*/
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";
@@ -82,16 +75,6 @@
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 @@
*/
TaskContext createSubContext( String name )
throws TaskException;
-
- /**
- * Safe wrapper class for Scope enums.
- */
- public final class ScopeEnum
- extends Enum
- {
- ScopeEnum( final String name )
- {
- super( name );
- }
- }
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>