donaldp 01/12/29 22:36:48
Modified:
proposal/myrmidon/src/java/org/apache/myrmidon/components/executor
DefaultExecutor.java AspectAwareExecutor.java
Log:
Remove the initialize and dispose stages in the lifecycle of a task as they
no longer are needed given task execution occurs in a single pass.
Revision Changes Path
1.16 +0 -48
jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/DefaultExecutor.java
Index: DefaultExecutor.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/DefaultExecutor.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- DefaultExecutor.java 23 Dec 2001 06:25:35 -0000 1.15
+++ DefaultExecutor.java 30 Dec 2001 06:36:48 -0000 1.16
@@ -67,14 +67,8 @@
debug( "configuring.notice" );
doConfigure( task, taskModel, frame.getContext() );
- debug( "initializing.notice" );
- doInitialize( task, taskModel );
-
debug( "executing.notice" );
task.execute();
-
- debug( "disposing.notice" );
- doDispose( task, taskModel );
}
protected final void debug( final String key )
@@ -167,27 +161,6 @@
}
}
- protected final void doDispose( final Task task, final Configuration
taskModel )
- throws TaskException
- {
- if( task instanceof Disposable )
- {
- try
- {
- ( (Disposable)task ).dispose();
- }
- catch( final Throwable throwable )
- {
- final String message =
- REZ.getString( "dispose.error",
- taskModel.getName(),
- taskModel.getLocation(),
- throwable.getMessage() );
- throw new TaskException( message, throwable );
- }
- }
- }
-
protected final void doLogEnabled( final Task task,
final Configuration taskModel,
final Logger logger )
@@ -203,27 +176,6 @@
{
final String message =
REZ.getString( "logger.error",
- taskModel.getName(),
- taskModel.getLocation(),
- throwable.getMessage() );
- throw new TaskException( message, throwable );
- }
- }
- }
-
- protected final void doInitialize( final Task task, final Configuration
taskModel )
- throws TaskException
- {
- if( task instanceof Initializable )
- {
- try
- {
- ( (Initializable)task ).initialize();
- }
- catch( final Throwable throwable )
- {
- final String message =
- REZ.getString( "init.error",
taskModel.getName(),
taskModel.getLocation(),
throwable.getMessage() );
1.12 +2 -15
jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/AspectAwareExecutor.java
Index: AspectAwareExecutor.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/AspectAwareExecutor.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- AspectAwareExecutor.java 23 Dec 2001 06:25:35 -0000 1.11
+++ AspectAwareExecutor.java 30 Dec 2001 06:36:48 -0000 1.12
@@ -29,15 +29,8 @@
private static final Resources REZ =
ResourceManager.getPackageResources( AspectAwareExecutor.class );
- private final static Parameters EMPTY_PARAMETERS;
private final static Configuration[] EMPTY_ELEMENTS = new Configuration[
0 ];
- static
- {
- EMPTY_PARAMETERS = new Parameters();
- EMPTY_PARAMETERS.makeReadOnly();
- }
-
private AspectManager m_aspectManager;
/**
@@ -95,16 +88,10 @@
getAspectManager().preConfigure( taskModel );
doConfigure( task, taskModel, frame.getContext() );
- debug( "initializing.notice" );
- doInitialize( task, taskModel );
-
debug( "executing.notice" );
getAspectManager().preExecute();
doExecute( taskModel, task );
-
- debug( "disposing.notice" );
getAspectManager().preDestroy();
- doDispose( task, taskModel );
}
protected void doExecute( final Configuration taskModel, final Task task
)
@@ -152,7 +139,7 @@
final ArrayList elementList = (ArrayList)elementMap.remove(
names[ i ] );
Parameters parameters = (Parameters)parameterMap.remove( names[
i ] );
- if( null == parameters ) parameters = EMPTY_PARAMETERS;
+ if( null == parameters ) parameters =
Parameters.EMPTY_PARAMETERS;
Configuration[] elements = null;
if( null == elementList )
@@ -206,7 +193,7 @@
final Configuration[] elements =
(Configuration[])elementList.toArray( EMPTY_ELEMENTS );
- unusedSetting( namespace, EMPTY_PARAMETERS, elements );
+ unusedSetting( namespace, Parameters.EMPTY_PARAMETERS,
elements );
}
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>