diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/components/configurer/Resources.properties b/proposal/myrmidon/src/java/org/apache/myrmidon/components/configurer/Resources.properties index 4e6957ecd..874581104 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/components/configurer/Resources.properties +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/components/configurer/Resources.properties @@ -9,11 +9,11 @@ pending-property-value.error=An object created using the creator method has not must-be-element.error=This property must be configured using a nested element. too-many-values.error=Too many values for this property. no-complex-type.error=Can not get complex type for non-primitive type {0}. -no-such-attribute.error=Attribute "{1}" is not supported for element <{0}>. +no-such-attribute.error=Element <{0}> does not support attribute "{1}". bad-set-attribute.error=Could not set attribute "{1}" for element <{0}>. bad-set-class-attribute.error=Could not set attribute "{0}" for object of class {1}. -no-such-element.error=Nested <{1}> elements are not supported for element <{0}>. -no-content.error=Text content is not supported in element <{0}>. +no-such-element.error=Element <{0}> does not support nested <{1}> elements. +no-content.error=Element <{0} does not support text content. bad-set-content.error=Could not set text content for element <{0}>. typed-adder-non-interface.error=The typed adder for class "{0}" must have a single parameter that is an interface rather than {1} which defines a class. create-typed-object.error=Could not create an object of type "{0}" of class {1}. diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/AspectAwareExecutor.java b/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/AspectAwareExecutor.java index 7d6e917f2..59912d71a 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/AspectAwareExecutor.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/AspectAwareExecutor.java @@ -78,23 +78,24 @@ public class AspectAwareExecutor Configuration taskModel = getAspectManager().preCreate( model ); taskModel = prepareAspects( taskModel ); - debug( "creating.notice" ); - final Task task = createTask( taskModel.getName(), frame ); + final String taskName = taskModel.getName(); + debug( "creating.notice", taskName ); + final Task task = createTask( taskName, frame ); getAspectManager().postCreate( task ); - debug( "logger.notice" ); + debug( "logger.notice", taskName ); final Logger logger = frame.getLogger(); getAspectManager().preLogEnabled( logger ); doLogEnabled( task, taskModel, logger ); - debug( "contextualizing.notice" ); + debug( "contextualizing.notice", taskName ); doContextualize( task, taskModel, frame.getContext() ); - debug( "configuring.notice" ); + debug( "configuring.notice", taskName ); getAspectManager().preConfigure( taskModel ); doConfigure( task, taskModel, frame.getContext() ); - debug( "executing.notice" ); + debug( "executing.notice", taskName ); getAspectManager().preExecute(); doExecute( taskModel, task ); getAspectManager().preDestroy(); diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/DefaultExecutor.java b/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/DefaultExecutor.java index 5f0d44309..16eaa4488 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/DefaultExecutor.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/DefaultExecutor.java @@ -55,31 +55,35 @@ public class DefaultExecutor public void execute( final Configuration taskModel, final ExecutionFrame frame ) throws TaskException { - debug( "creating.notice" ); - final Task task = createTask( taskModel.getName(), frame ); + final String taskName = taskModel.getName(); + debug( "creating.notice", taskName ); + final Task task = createTask( taskName, frame ); - debug( "logger.notice" ); + debug( "logger.notice", taskName ); doLogEnabled( task, taskModel, frame.getLogger() ); - debug( "contextualizing.notice" ); + debug( "contextualizing.notice", taskName ); doContextualize( task, taskModel, frame.getContext() ); - debug( "configuring.notice" ); + debug( "configuring.notice", taskName ); doConfigure( task, taskModel, frame.getContext() ); - debug( "executing.notice" ); + debug( "executing.notice", taskName ); task.execute(); } - protected final void debug( final String key ) + protected final void debug( final String key, final String taskName ) { if( getLogger().isDebugEnabled() ) { - final String message = REZ.getString( key ); + final String message = REZ.getString( key, taskName ); getLogger().debug( message ); } } + /** + * Creates a task instance. + */ protected final Task createTask( final String name, final ExecutionFrame frame ) throws TaskException { @@ -95,6 +99,9 @@ public class DefaultExecutor } } + /** + * Configures a task instance. + */ protected final void doConfigure( final Task task, final Configuration taskModel, final TaskContext taskContext ) @@ -109,12 +116,14 @@ public class DefaultExecutor final String message = REZ.getString( "config.error", taskModel.getName(), - taskModel.getLocation(), - throwable.getMessage() ); + taskModel.getLocation() ); throw new TaskException( message, throwable ); } } + /** + * Sets the context for a task. + */ protected final void doContextualize( final Task task, final Configuration taskModel, final TaskContext context ) @@ -129,12 +138,14 @@ public class DefaultExecutor final String message = REZ.getString( "contextualize.error", taskModel.getName(), - taskModel.getLocation(), - throwable.getMessage() ); + taskModel.getLocation() ); throw new TaskException( message, throwable ); } } + /** + * Sets the logger for a task. + */ protected final void doLogEnabled( final Task task, final Configuration taskModel, final Logger logger ) @@ -151,8 +162,7 @@ public class DefaultExecutor final String message = REZ.getString( "logger.error", taskModel.getName(), - taskModel.getLocation(), - throwable.getMessage() ); + taskModel.getLocation() ); throw new TaskException( message, throwable ); } } diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/Resources.properties b/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/Resources.properties index f1d179cdd..034ce2200 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/Resources.properties +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/Resources.properties @@ -1,17 +1,13 @@ -creating.notice=Creating. -logger.notice=Setting Logger. -contextualizing.notice=Contextualizing. -configuring.notice=Configuring. -initializing.notice=Initializing. -executing.notice=Executing. -disposing.notice=Disposing. +creating.notice=Creating {0}. +logger.notice=Setting Logger {0}. +contextualizing.notice=Contextualizing {0}. +configuring.notice=Configuring {0}. +executing.notice=Executing {0}. -no-create.error=Unable to create task {0}. -config.error=Error configuring task {0} at {1} (Reason: {2}). -contextualize.error=Error contextualizing task {0} at {1} (Reason: {2}). -dispose.error=Error disposing task {0} at {1} (Reason: {2}). -init.error=Error initializing task {0} at {1} (Reason: {2}). -logger.error=Error setting logger for task {0} at {1} (Reason: {2}). +no-create.error=Could not create task "{0}". +config.error={1}: Could not configure task "{0}". +contextualize.error={1}: Could not set the context for task "{0}". +logger.error={1}: Could not set the logger for task "{0}". unused-settings.error=Unused aspect settings for namespace {0} (parameterCount={1} elementCount={2}). dispatch-settings.notice=Dispatching Aspect Settings to namespace {0} (parameterCount={1} elementCount={2}).