Migrated RoleManager to separate package. A few other minor nits. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269203 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -14,7 +14,7 @@ import org.apache.avalon.framework.configuration.Configurable; | |||||
| import org.apache.avalon.framework.configuration.Configuration; | import org.apache.avalon.framework.configuration.Configuration; | ||||
| import org.apache.avalon.framework.configuration.ConfigurationException; | import org.apache.avalon.framework.configuration.ConfigurationException; | ||||
| import org.apache.myrmidon.framework.AbstractContainerTask; | import org.apache.myrmidon.framework.AbstractContainerTask; | ||||
| import org.apache.myrmidon.api.DataType; | |||||
| import org.apache.myrmidon.framework.DataType; | |||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.api.TaskContext; | import org.apache.myrmidon.api.TaskContext; | ||||
| import org.apache.myrmidon.components.type.TypeManager; | import org.apache.myrmidon.components.type.TypeManager; | ||||
| @@ -14,7 +14,7 @@ package org.apache.myrmidon; | |||||
| */ | */ | ||||
| public interface Constants | public interface Constants | ||||
| { | { | ||||
| //Constants to indicate the build of Ant/Myrmidon | |||||
| //Constants to indicate the build of Myrmidon | |||||
| String BUILD_DATE = "@@DATE@@"; | String BUILD_DATE = "@@DATE@@"; | ||||
| String BUILD_VERSION = "@@VERSION@@"; | String BUILD_VERSION = "@@VERSION@@"; | ||||
| @@ -70,7 +70,7 @@ public class DefaultConfigurer | |||||
| * configurers. | * configurers. | ||||
| * This one does it by first checking if object implements Configurable | * This one does it by first checking if object implements Configurable | ||||
| * and if it does will pass the task the configuration - else it will use | * and if it does will pass the task the configuration - else it will use | ||||
| * ants rules to map configuration to types | |||||
| * mapping rules to map configuration to types | |||||
| * | * | ||||
| * @param object the object | * @param object the object | ||||
| * @param configuration the configuration | * @param configuration the configuration | ||||
| @@ -22,11 +22,11 @@ import org.apache.avalon.framework.configuration.Configuration; | |||||
| import org.apache.avalon.framework.configuration.ConfigurationException; | import org.apache.avalon.framework.configuration.ConfigurationException; | ||||
| import org.apache.avalon.framework.configuration.SAXConfigurationHandler; | import org.apache.avalon.framework.configuration.SAXConfigurationHandler; | ||||
| import org.apache.avalon.framework.logger.AbstractLoggable; | import org.apache.avalon.framework.logger.AbstractLoggable; | ||||
| import org.apache.myrmidon.api.DataType; | |||||
| import org.apache.myrmidon.api.Task; | import org.apache.myrmidon.api.Task; | ||||
| import org.apache.myrmidon.components.converter.ConverterRegistry; | import org.apache.myrmidon.components.converter.ConverterRegistry; | ||||
| import org.apache.myrmidon.components.type.DefaultTypeFactory; | import org.apache.myrmidon.components.type.DefaultTypeFactory; | ||||
| import org.apache.myrmidon.components.type.TypeManager; | import org.apache.myrmidon.components.type.TypeManager; | ||||
| import org.apache.myrmidon.components.role.RoleManager; | |||||
| import org.apache.myrmidon.converter.Converter; | import org.apache.myrmidon.converter.Converter; | ||||
| import org.xml.sax.SAXException; | import org.xml.sax.SAXException; | ||||
| import org.xml.sax.XMLReader; | import org.xml.sax.XMLReader; | ||||
| @@ -27,7 +27,7 @@ import org.apache.myrmidon.components.converter.ConverterRegistry; | |||||
| import org.apache.myrmidon.components.converter.MasterConverter; | import org.apache.myrmidon.components.converter.MasterConverter; | ||||
| import org.apache.myrmidon.components.deployer.Deployer; | import org.apache.myrmidon.components.deployer.Deployer; | ||||
| import org.apache.myrmidon.components.deployer.DeploymentException; | import org.apache.myrmidon.components.deployer.DeploymentException; | ||||
| import org.apache.myrmidon.components.deployer.RoleManager; | |||||
| import org.apache.myrmidon.components.role.RoleManager; | |||||
| import org.apache.myrmidon.components.executor.Executor; | import org.apache.myrmidon.components.executor.Executor; | ||||
| import org.apache.myrmidon.components.manager.ProjectManager; | import org.apache.myrmidon.components.manager.ProjectManager; | ||||
| import org.apache.myrmidon.components.type.TypeFactory; | import org.apache.myrmidon.components.type.TypeFactory; | ||||
| @@ -228,7 +228,7 @@ public class DefaultEmbeddor | |||||
| defaults.setParameter( AspectManager.ROLE, | defaults.setParameter( AspectManager.ROLE, | ||||
| "org.apache.myrmidon.components.aspect.DefaultAspectManager" ); | "org.apache.myrmidon.components.aspect.DefaultAspectManager" ); | ||||
| defaults.setParameter( RoleManager.ROLE, | defaults.setParameter( RoleManager.ROLE, | ||||
| "org.apache.myrmidon.components.deployer.DefaultRoleManager" ); | |||||
| "org.apache.myrmidon.components.role.DefaultRoleManager" ); | |||||
| defaults.setParameter( MasterConverter.ROLE, | defaults.setParameter( MasterConverter.ROLE, | ||||
| "org.apache.myrmidon.components.converter.DefaultMasterConverter" ); | "org.apache.myrmidon.components.converter.DefaultMasterConverter" ); | ||||
| defaults.setParameter( ConverterRegistry.ROLE, | defaults.setParameter( ConverterRegistry.ROLE, | ||||
| @@ -240,9 +240,6 @@ public class DefaultEmbeddor | |||||
| "org.apache.myrmidon.components.executor.AspectAwareExecutor" ); | "org.apache.myrmidon.components.executor.AspectAwareExecutor" ); | ||||
| defaults.setParameter( ProjectManager.ROLE, | defaults.setParameter( ProjectManager.ROLE, | ||||
| "org.apache.myrmidon.components.manager.DefaultProjectManager" ); | "org.apache.myrmidon.components.manager.DefaultProjectManager" ); | ||||
| //defaults.setParameter( ProjectBuilder.ROLE, | |||||
| //"org.apache.myrmidon.components.builder.DefaultProjectBuilder" ); | |||||
| //"org.apache.myrmidon.components.builder.XSLProjectBuilder" ); | |||||
| defaults.setParameter( Deployer.ROLE, | defaults.setParameter( Deployer.ROLE, | ||||
| "org.apache.myrmidon.components.deployer.DefaultDeployer" ); | "org.apache.myrmidon.components.deployer.DefaultDeployer" ); | ||||
| defaults.setParameter( Configurer.ROLE, | defaults.setParameter( Configurer.ROLE, | ||||
| @@ -22,9 +22,9 @@ import org.apache.myrmidon.components.configurer.Configurer; | |||||
| import org.apache.myrmidon.components.converter.ConverterRegistry; | import org.apache.myrmidon.components.converter.ConverterRegistry; | ||||
| import org.apache.myrmidon.components.converter.MasterConverter; | import org.apache.myrmidon.components.converter.MasterConverter; | ||||
| import org.apache.myrmidon.components.deployer.Deployer; | import org.apache.myrmidon.components.deployer.Deployer; | ||||
| import org.apache.myrmidon.components.deployer.RoleManager; | |||||
| import org.apache.myrmidon.components.executor.Executor; | import org.apache.myrmidon.components.executor.Executor; | ||||
| import org.apache.myrmidon.components.manager.ProjectManager; | import org.apache.myrmidon.components.manager.ProjectManager; | ||||
| import org.apache.myrmidon.components.role.RoleManager; | |||||
| import org.apache.myrmidon.components.type.TypeManager; | import org.apache.myrmidon.components.type.TypeManager; | ||||
| /** | /** | ||||
| @@ -60,38 +60,6 @@ public class DefaultExecutionFrame | |||||
| public void compose( final ComponentManager componentManager ) | public void compose( final ComponentManager componentManager ) | ||||
| throws ComponentException | throws ComponentException | ||||
| { | { | ||||
| /* | |||||
| final RoleManager roleManager = (RoleManager)componentManager.lookup( RoleManager.ROLE ); | |||||
| m_componentManager.put( RoleManager.ROLE, roleManager ); | |||||
| final Configurer configurer = (Configurer)componentManager.lookup( Configurer.ROLE ); | |||||
| m_componentManager.put( Configurer.ROLE, configurer ); | |||||
| final MasterConverter masterConverter = | |||||
| (MasterConverter)componentManager.lookup( MasterConverter.ROLE ); | |||||
| m_componentManager.put( MasterConverter.ROLE, masterConverter ); | |||||
| final AspectManager aspectManager = (AspectManager)componentManager.lookup( AspectManager.ROLE ); | |||||
| m_componentManager.put( AspectManager.ROLE, aspectManager ); | |||||
| final Deployer deployer = (Deployer)componentManager.lookup( Deployer.ROLE ); | |||||
| m_componentManager.put( Deployer.ROLE, deployer ); | |||||
| final Executor executor = (Executor)componentManager.lookup( Executor.ROLE ); | |||||
| m_componentManager.put( Executor.ROLE, executor ); | |||||
| final ProjectManager projectManager = | |||||
| (ProjectManager)componentManager.lookup( ProjectManager.ROLE ); | |||||
| m_componentManager.put( ProjectManager.ROLE, projectManager ); | |||||
| final ProjectBuilder projectBuilder = | |||||
| (ProjectBuilder)componentManager.lookup( ProjectBuilder.ROLE ); | |||||
| m_componentManager.put( ProjectBuilder.ROLE, projectBuilder ); | |||||
| final ConverterRegistry converterRegistry = | |||||
| (ConverterRegistry)componentManager.lookup( ConverterRegistry.ROLE ); | |||||
| m_componentManager.put( ConverterRegistry.ROLE, converterRegistry ); | |||||
| */ | |||||
| m_componentManager = componentManager; | m_componentManager = componentManager; | ||||
| m_typeManager = (TypeManager)componentManager.lookup( TypeManager.ROLE ); | m_typeManager = (TypeManager)componentManager.lookup( TypeManager.ROLE ); | ||||
| @@ -157,7 +157,7 @@ public class DefaultProjectManager | |||||
| componentManager.put( TypeManager.ROLE, m_typeManager.createChildTypeManager() ); | componentManager.put( TypeManager.ROLE, m_typeManager.createChildTypeManager() ); | ||||
| //We need to place projects and ProjectManager | //We need to place projects and ProjectManager | ||||
| //in ComponentManager so as to support project-local antcall | |||||
| //in ComponentManager so as to support project-local call() | |||||
| componentManager.put( ProjectManager.ROLE, this ); | componentManager.put( ProjectManager.ROLE, this ); | ||||
| componentManager.put( Project.ROLE, project ); | componentManager.put( Project.ROLE, project ); | ||||
| @@ -25,13 +25,13 @@ public interface Project | |||||
| String ROLE = "org.apache.myrmidon.components.model.Project"; | String ROLE = "org.apache.myrmidon.components.model.Project"; | ||||
| // the name of currently executing project | // the name of currently executing project | ||||
| String PROJECT = "ant.project.name"; | |||||
| String PROJECT = "myrmidon.project.name"; | |||||
| // the name of currently executing project | // the name of currently executing project | ||||
| //String PROJECT_FILE = "ant.project.file"; | |||||
| //String PROJECT_FILE = "myrmidon.project.file"; | |||||
| // the name of currently executing target | // the name of currently executing target | ||||
| //String TARGET = "ant.target.name"; | |||||
| //String TARGET = "myrmidon.target.name"; | |||||
| /** | /** | ||||
| * Get the imports for project. | * Get the imports for project. | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE file. | * the LICENSE file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.deployer; | |||||
| package org.apache.myrmidon.components.role; | |||||
| import java.net.URL; | import java.net.URL; | ||||
| import java.util.Enumeration; | import java.util.Enumeration; | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE file. | * the LICENSE file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.deployer; | |||||
| package org.apache.myrmidon.components.role; | |||||
| import org.apache.avalon.framework.component.Component; | import org.apache.avalon.framework.component.Component; | ||||
| @@ -23,7 +23,7 @@ public interface RoleManager | |||||
| { | { | ||||
| String ROLE = "org.apache.myrmidon.components.deployer.RoleManager"; | String ROLE = "org.apache.myrmidon.components.deployer.RoleManager"; | ||||
| /** | |||||
| /** | |||||
| * Find Role name based on shorthand name. | * Find Role name based on shorthand name. | ||||
| * | * | ||||
| * @param shorthandName the shorthand name | * @param shorthandName the shorthand name | ||||
| @@ -15,7 +15,7 @@ import org.apache.avalon.framework.component.ComponentManager; | |||||
| import org.apache.avalon.framework.component.Composable; | import org.apache.avalon.framework.component.Composable; | ||||
| import org.apache.myrmidon.api.AbstractTask; | import org.apache.myrmidon.api.AbstractTask; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.components.deployer.RoleManager; | |||||
| import org.apache.myrmidon.components.role.RoleManager; | |||||
| import org.apache.myrmidon.components.type.DefaultTypeFactory; | import org.apache.myrmidon.components.type.DefaultTypeFactory; | ||||
| import org.apache.myrmidon.components.type.TypeException; | import org.apache.myrmidon.components.type.TypeException; | ||||
| import org.apache.myrmidon.components.type.TypeManager; | import org.apache.myrmidon.components.type.TypeManager; | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE file. | * the LICENSE file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.api; | |||||
| package org.apache.myrmidon.framework; | |||||
| /** | /** | ||||
| * Base class for those classes that can appear inside the build file | * Base class for those classes that can appear inside the build file | ||||
| @@ -7,8 +7,6 @@ | |||||
| */ | */ | ||||
| package org.apache.myrmidon.framework; | package org.apache.myrmidon.framework; | ||||
| import org.apache.myrmidon.api.DataType; | |||||
| /** | /** | ||||
| * Interface for ItemSet. | * Interface for ItemSet. | ||||
| * An item set contains a number of items. Example item sets include | * An item set contains a number of items. Example item sets include | ||||
| @@ -7,8 +7,6 @@ | |||||
| */ | */ | ||||
| package org.apache.myrmidon.framework; | package org.apache.myrmidon.framework; | ||||
| import org.apache.myrmidon.api.DataType; | |||||
| /** | /** | ||||
| * Interface for Mappers. | * Interface for Mappers. | ||||
| * Mappers are responsible for mapping source items to targets items. | * Mappers are responsible for mapping source items to targets items. | ||||
| @@ -7,7 +7,6 @@ | |||||
| */ | */ | ||||
| package org.apache.myrmidon.framework; | package org.apache.myrmidon.framework; | ||||
| import org.apache.myrmidon.api.DataType; | |||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.components.model.Condition; | import org.apache.myrmidon.components.model.Condition; | ||||
| @@ -44,7 +43,7 @@ public class Pattern | |||||
| /** | /** | ||||
| * Setter method for name/value of pattern. | * Setter method for name/value of pattern. | ||||
| * Conforms to ant setter patterns | |||||
| * Conforms to setter patterns | |||||
| * | * | ||||
| * @param name the value | * @param name the value | ||||
| */ | */ | ||||
| @@ -14,7 +14,6 @@ import org.apache.avalon.framework.configuration.Configurable; | |||||
| import org.apache.avalon.framework.configuration.Configuration; | import org.apache.avalon.framework.configuration.Configuration; | ||||
| import org.apache.avalon.framework.configuration.ConfigurationException; | import org.apache.avalon.framework.configuration.ConfigurationException; | ||||
| import org.apache.avalon.framework.configuration.DefaultConfiguration; | import org.apache.avalon.framework.configuration.DefaultConfiguration; | ||||
| import org.apache.myrmidon.api.DataType; | |||||
| import org.apache.myrmidon.api.TaskContext; | import org.apache.myrmidon.api.TaskContext; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.components.type.TypeException; | import org.apache.myrmidon.components.type.TypeException; | ||||
| @@ -10,7 +10,6 @@ package org.apache.myrmidon.libs.ant1; | |||||
| import org.apache.avalon.framework.configuration.Configurable; | import org.apache.avalon.framework.configuration.Configurable; | ||||
| import org.apache.avalon.framework.configuration.Configuration; | import org.apache.avalon.framework.configuration.Configuration; | ||||
| import org.apache.avalon.framework.configuration.ConfigurationException; | import org.apache.avalon.framework.configuration.ConfigurationException; | ||||
| import org.apache.myrmidon.api.DataType; | |||||
| import org.apache.myrmidon.api.TaskContext; | import org.apache.myrmidon.api.TaskContext; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.components.type.TypeException; | import org.apache.myrmidon.components.type.TypeException; | ||||
| @@ -20,7 +19,7 @@ import org.apache.myrmidon.framework.AbstractContainerTask; | |||||
| import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
| /** | /** | ||||
| * Adapter of Ant1 tasks to ant2. | |||||
| * Adapter of Ant1 tasks to myrmidon. | |||||
| * | * | ||||
| * @author <a href="mailto:donaldp@apache.org">Peter Donald</a> | * @author <a href="mailto:donaldp@apache.org">Peter Donald</a> | ||||
| */ | */ | ||||
| @@ -28,17 +27,17 @@ public class TaskAdapter | |||||
| extends AbstractContainerTask | extends AbstractContainerTask | ||||
| implements Configurable | implements Configurable | ||||
| { | { | ||||
| private Task m_ant1Task; | |||||
| private Task m_task; | |||||
| private Ant1Project m_project = new Ant1Project(); | private Ant1Project m_project = new Ant1Project(); | ||||
| public TaskAdapter( final Task ant1Task ) | |||||
| public TaskAdapter( final Task task ) | |||||
| { | { | ||||
| m_ant1Task = ant1Task; | |||||
| m_task = task; | |||||
| } | } | ||||
| protected final Task getTask() | protected final Task getTask() | ||||
| { | { | ||||
| return m_ant1Task; | |||||
| return m_task; | |||||
| } | } | ||||
| protected final Ant1Project getProject() | protected final Ant1Project getProject() | ||||
| @@ -1,6 +1,6 @@ | |||||
| <roles> | <roles> | ||||
| <role shorthand="task" name="org.apache.myrmidon.api.Task"/> | <role shorthand="task" name="org.apache.myrmidon.api.Task"/> | ||||
| <role shorthand="data-type" name="org.apache.myrmidon.api.DataType"/> | |||||
| <role shorthand="data-type" name="org.apache.myrmidon.framework.DataType"/> | |||||
| <role shorthand="listener" name="org.apache.myrmidon.listeners.ProjectListener"/> | <role shorthand="listener" name="org.apache.myrmidon.listeners.ProjectListener"/> | ||||
| <role shorthand="aspect" name="org.apache.myrmidon.aspects.AspectHandler"/> | <role shorthand="aspect" name="org.apache.myrmidon.aspects.AspectHandler"/> | ||||
| <role shorthand="project-builder" name="org.apache.myrmidon.components.builder.ProjectBuilder"/> | <role shorthand="project-builder" name="org.apache.myrmidon.components.builder.ProjectBuilder"/> | ||||