donaldp 02/04/25 03:10:58
Modified: container/src/java/org/apache/myrmidon/components/workspace
DefaultWorkspace.java DefaultTaskContext.java
Log:
Move responsibility for task name to TaskContext and out of PropertyStore.
Revision Changes Path
1.49 +7 -7
jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/DefaultWorkspace.java
Index: DefaultWorkspace.java
===================================================================
RCS file:
/home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/DefaultWorkspace.java,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- DefaultWorkspace.java 25 Apr 2002 09:54:33 -0000 1.48
+++ DefaultWorkspace.java 25 Apr 2002 10:10:58 -0000 1.49
@@ -40,7 +40,7 @@
* This is the default implementation of Workspace.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.48 $ $Date: 2002/04/25 09:54:33 $
+ * @version $Revision: 1.49 $ $Date: 2002/04/25 10:10:58 $
*/
public class DefaultWorkspace
extends AbstractLogEnabled
@@ -49,6 +49,11 @@
private static final Resources REZ =
ResourceManager.getPackageResources( DefaultWorkspace.class );
+ /**
+ * Name of implicit target.
+ */
+ private static final String IMPLICIT_TARGET_NAME = "<init>";
+
private Executor m_executor;
private TypeManager m_typeManager;
private Deployer m_deployer;
@@ -348,7 +353,7 @@
// Implicit target first
if( target != project.getImplicitTarget() )
{
- executeTarget( entry, "<init>", project.getImplicitTarget() );
+ executeTarget( entry, IMPLICIT_TARGET_NAME,
project.getImplicitTarget() );
}
// Named dependencies
@@ -401,8 +406,6 @@
getLogger().debug( message );
}
- //TODO - put this back in
- //frame.getContext().setProperty( Project.TARGET, target );
final ExecutionFrame frame =
entry.getFrame().createChildFrame( name, false );
@@ -432,9 +435,6 @@
final String message = REZ.getString( "exec-task.notice", name );
getLogger().debug( message );
}
-
- //is setting name even necessary ???
- frame.getPropertyStore().setProperty( TaskContext.NAME, name );
//run task
m_executor.execute( task, frame );
1.41 +13 -6
jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/DefaultTaskContext.java
Index: DefaultTaskContext.java
===================================================================
RCS file:
/home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/DefaultTaskContext.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- DefaultTaskContext.java 25 Apr 2002 09:54:33 -0000 1.40
+++ DefaultTaskContext.java 25 Apr 2002 10:10:58 -0000 1.41
@@ -28,7 +28,7 @@
* Default implementation of TaskContext.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.40 $ $Date: 2002/04/25 09:54:33 $
+ * @version $Revision: 1.41 $ $Date: 2002/04/25 10:10:58 $
*/
public class DefaultTaskContext
implements TaskContext
@@ -197,14 +197,21 @@
*/
public Object getProperty( final String name )
{
- try
+ if( TaskContext.NAME.equals( name ) )
{
- final PropertyStore store = m_frame.getPropertyStore();
- return store.getProperty( name );
+ return getName();
}
- catch( final Exception e )
+ else
{
- return null;
+ try
+ {
+ final PropertyStore store = m_frame.getPropertyStore();
+ return store.getProperty( name );
+ }
+ catch( final TaskException te )
+ {
+ return null;
+ }
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>