diff --git a/ee/src/main/java/org/jboss/as/ee/component/ComponentDescription.java b/ee/src/main/java/org/jboss/as/ee/component/ComponentDescription.java index f6a3bbb9c02d..d70f18eabf4e 100644 --- a/ee/src/main/java/org/jboss/as/ee/component/ComponentDescription.java +++ b/ee/src/main/java/org/jboss/as/ee/component/ComponentDescription.java @@ -78,7 +78,7 @@ public class ComponentDescription implements ResourceInjectionTarget { private boolean excludeDefaultInterceptors = false; private boolean ignoreLifecycleInterceptors = false; - private final Map dependencies = new HashMap(); + private final Set dependencies = new HashSet(); private ComponentNamingMode namingMode = ComponentNamingMode.USE_MODULE; @@ -434,16 +434,15 @@ public void addDependency(ServiceName serviceName) { if (serviceName == null) { throw EeLogger.ROOT_LOGGER.nullVar("serviceName", "component", componentName); } - final Map dependencies = this.dependencies; - dependencies.put(serviceName, ServiceBuilder.DependencyType.REQUIRED); + dependencies.add(serviceName); } /** - * Get the dependency map. + * Get the dependency set. * - * @return the dependency map + * @return the dependency set */ - public Map getDependencies() { + public Set getDependencies() { return dependencies; } diff --git a/ee/src/main/java/org/jboss/as/ee/component/DefaultComponentViewConfigurator.java b/ee/src/main/java/org/jboss/as/ee/component/DefaultComponentViewConfigurator.java index 5b8bed889830..c15495245a94 100644 --- a/ee/src/main/java/org/jboss/as/ee/component/DefaultComponentViewConfigurator.java +++ b/ee/src/main/java/org/jboss/as/ee/component/DefaultComponentViewConfigurator.java @@ -1,7 +1,28 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2011, Red Hat, Inc., and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + package org.jboss.as.ee.component; import java.io.Serializable; -import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import org.jboss.as.ee.logging.EeLogger; @@ -18,6 +39,7 @@ /** * @author Stuart Douglas + * @author Richard Opalka */ class DefaultComponentViewConfigurator extends AbstractComponentConfigurator implements ComponentConfigurator { @@ -71,11 +93,10 @@ public void configure(final DeploymentPhaseContext context, final ComponentDescr configuration.getStartDependencies().add(new DependencyConfigurator() { @Override - public void configureDependency(final ServiceBuilder serviceBuilder, ComponentStartService service) throws DeploymentUnitProcessingException { - for (final Map.Entry entry : description.getDependencies().entrySet()) { - serviceBuilder.addDependency(entry.getValue(), entry.getKey()); + public void configureDependency(final ServiceBuilder serviceBuilder, ComponentStartService service) { + for (ServiceName dependencyName : description.getDependencies()) { + serviceBuilder.addDependency(dependencyName); } - } }); }