Skip to content

Commit

Permalink
[WFLY-10578] Changing ComponentDescription.getDependencies() method r…
Browse files Browse the repository at this point in the history
…eturn type.
  • Loading branch information
ropalka committed Jun 14, 2018
1 parent 4070bbf commit ddf1504
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
Expand Up @@ -78,7 +78,7 @@ public class ComponentDescription implements ResourceInjectionTarget {
private boolean excludeDefaultInterceptors = false; private boolean excludeDefaultInterceptors = false;
private boolean ignoreLifecycleInterceptors = false; private boolean ignoreLifecycleInterceptors = false;


private final Map<ServiceName, ServiceBuilder.DependencyType> dependencies = new HashMap<ServiceName, ServiceBuilder.DependencyType>(); private final Set<ServiceName> dependencies = new HashSet<ServiceName>();


private ComponentNamingMode namingMode = ComponentNamingMode.USE_MODULE; private ComponentNamingMode namingMode = ComponentNamingMode.USE_MODULE;


Expand Down Expand Up @@ -434,16 +434,15 @@ public void addDependency(ServiceName serviceName) {
if (serviceName == null) { if (serviceName == null) {
throw EeLogger.ROOT_LOGGER.nullVar("serviceName", "component", componentName); throw EeLogger.ROOT_LOGGER.nullVar("serviceName", "component", componentName);
} }
final Map<ServiceName, ServiceBuilder.DependencyType> dependencies = this.dependencies; dependencies.add(serviceName);
dependencies.put(serviceName, ServiceBuilder.DependencyType.REQUIRED);
} }


/** /**
* Get the dependency map. * Get the dependency set.
* *
* @return the dependency map * @return the dependency set
*/ */
public Map<ServiceName, ServiceBuilder.DependencyType> getDependencies() { public Set<ServiceName> getDependencies() {
return dependencies; return dependencies;
} }


Expand Down
@@ -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; package org.jboss.as.ee.component;


import java.io.Serializable; import java.io.Serializable;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;


import org.jboss.as.ee.logging.EeLogger; import org.jboss.as.ee.logging.EeLogger;
Expand All @@ -18,6 +39,7 @@


/** /**
* @author Stuart Douglas * @author Stuart Douglas
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/ */
class DefaultComponentViewConfigurator extends AbstractComponentConfigurator implements ComponentConfigurator { class DefaultComponentViewConfigurator extends AbstractComponentConfigurator implements ComponentConfigurator {


Expand Down Expand Up @@ -71,11 +93,10 @@ public void configure(final DeploymentPhaseContext context, final ComponentDescr


configuration.getStartDependencies().add(new DependencyConfigurator<ComponentStartService>() { configuration.getStartDependencies().add(new DependencyConfigurator<ComponentStartService>() {
@Override @Override
public void configureDependency(final ServiceBuilder<?> serviceBuilder, ComponentStartService service) throws DeploymentUnitProcessingException { public void configureDependency(final ServiceBuilder<?> serviceBuilder, ComponentStartService service) {
for (final Map.Entry<ServiceName, ServiceBuilder.DependencyType> entry : description.getDependencies().entrySet()) { for (ServiceName dependencyName : description.getDependencies()) {
serviceBuilder.addDependency(entry.getValue(), entry.getKey()); serviceBuilder.addDependency(dependencyName);
} }

} }
}); });
} }
Expand Down

0 comments on commit ddf1504

Please sign in to comment.