diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binding/AbstractBindableProxyFactory.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binding/AbstractBindableProxyFactory.java index 92b4d2d9f..a64ab7a20 100644 --- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binding/AbstractBindableProxyFactory.java +++ b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binding/AbstractBindableProxyFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2021 the original author or authors. + * Copyright 2019-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,14 +23,9 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.ListableBeanFactory; -import org.springframework.beans.factory.annotation.Value; import org.springframework.cloud.stream.binder.Binding; -import org.springframework.cloud.stream.internal.InternalPropertyNames; import org.springframework.util.StringUtils; /** @@ -44,11 +39,6 @@ import org.springframework.util.StringUtils; */ public class AbstractBindableProxyFactory implements Bindable { - private static Log log = LogFactory.getLog(AbstractBindableProxyFactory.class); - - @Value("${" + InternalPropertyNames.NAMESPACE_PROPERTY_NAME + ":}") - private String namespace; - protected Map bindingTargetFactories; protected Map inputHolders = new LinkedHashMap<>(); @@ -100,19 +90,11 @@ public class AbstractBindableProxyFactory implements Bindable { public Collection> createAndBindInputs( BindingService bindingService) { List> bindings = new ArrayList<>(); - if (log.isDebugEnabled()) { - log.debug( - String.format("Binding inputs for %s:%s", this.namespace, this.type)); - } for (Map.Entry boundTargetHolderEntry : this.inputHolders .entrySet()) { String inputTargetName = boundTargetHolderEntry.getKey(); BoundTargetHolder boundTargetHolder = boundTargetHolderEntry.getValue(); if (boundTargetHolder.isBindable()) { - if (log.isDebugEnabled()) { - log.debug(String.format("Binding %s:%s:%s", this.namespace, this.type, - inputTargetName)); - } bindings.addAll(bindingService.bindConsumer( boundTargetHolder.getBoundTarget(), inputTargetName)); } @@ -124,19 +106,12 @@ public class AbstractBindableProxyFactory implements Bindable { public Collection> createAndBindOutputs( BindingService bindingService) { List> bindings = new ArrayList<>(); - if (log.isDebugEnabled()) { - log.debug(String.format("Binding outputs for %s:%s", this.namespace, - this.type)); - } + for (Map.Entry boundTargetHolderEntry : this.outputHolders .entrySet()) { BoundTargetHolder boundTargetHolder = boundTargetHolderEntry.getValue(); String outputTargetName = boundTargetHolderEntry.getKey(); if (boundTargetHolderEntry.getValue().isBindable()) { - if (log.isDebugEnabled()) { - log.debug(String.format("Binding %s:%s:%s", this.namespace, this.type, - outputTargetName)); - } bindings.add(bindingService.bindProducer( boundTargetHolder.getBoundTarget(), outputTargetName)); } @@ -146,17 +121,9 @@ public class AbstractBindableProxyFactory implements Bindable { @Override public void unbindInputs(BindingService bindingService) { - if (log.isDebugEnabled()) { - log.debug(String.format("Unbinding inputs for %s:%s", this.namespace, - this.type)); - } for (Map.Entry boundTargetHolderEntry : this.inputHolders .entrySet()) { if (boundTargetHolderEntry.getValue().isBindable()) { - if (log.isDebugEnabled()) { - log.debug(String.format("Unbinding %s:%s:%s", this.namespace, - this.type, boundTargetHolderEntry.getKey())); - } bindingService.unbindConsumers(boundTargetHolderEntry.getKey()); } } @@ -164,17 +131,9 @@ public class AbstractBindableProxyFactory implements Bindable { @Override public void unbindOutputs(BindingService bindingService) { - if (log.isDebugEnabled()) { - log.debug(String.format("Unbinding outputs for %s:%s", this.namespace, - this.type)); - } for (Map.Entry boundTargetHolderEntry : this.outputHolders .entrySet()) { if (boundTargetHolderEntry.getValue().isBindable()) { - if (log.isDebugEnabled()) { - log.debug(String.format("Binding %s:%s:%s", this.namespace, this.type, - boundTargetHolderEntry.getKey())); - } bindingService.unbindProducers(boundTargetHolderEntry.getKey()); } } diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/internal/InternalPropertyNames.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/internal/InternalPropertyNames.java deleted file mode 100644 index e4cf19c60..000000000 --- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/internal/InternalPropertyNames.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2016-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.cloud.stream.internal; - -/** - * Contains the names of properties for the internal use of Spring Cloud Stream. - * - * @author Marius Bogoevici - */ -public abstract class InternalPropertyNames { - - /** - * Prefix for internal Spring Cloud Stream properties. - */ - public static final String SPRING_CLOUD_STREAM_INTERNAL_PREFIX = "spring.cloud.stream.internal"; - - /** - * Namespace property for internal Spring Cloud Stream properties. - */ - public static final String NAMESPACE_PROPERTY_NAME = SPRING_CLOUD_STREAM_INTERNAL_PREFIX - + ".namespace"; - - /** - * Self contained property for internal Spring Cloud Stream properties. - */ - public static final String SELF_CONTAINED_APP_PROPERTY_NAME = SPRING_CLOUD_STREAM_INTERNAL_PREFIX - + ".selfContained"; - -}