DSL: Fix package tangles

This commit is contained in:
Artem Bilan
2014-10-29 12:43:40 +02:00
parent 4005ff874d
commit 74102a022d
8 changed files with 61 additions and 30 deletions

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.integration.dsl.core;
package org.springframework.integration.dsl.config;
import java.util.Arrays;
import java.util.List;
@@ -25,6 +25,8 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.integration.config.IntegrationConfigurationInitializer;
import org.springframework.integration.dsl.core.IntegrationComponentSpec;
import org.springframework.integration.dsl.config.IntegrationFlowBeanPostProcessor;
import org.springframework.util.Assert;
/**

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.integration.dsl.core;
package org.springframework.integration.dsl.config;
import java.util.Collection;
@@ -36,6 +36,8 @@ import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.IntegrationFlowBuilder;
import org.springframework.integration.dsl.IntegrationFlows;
import org.springframework.integration.dsl.SourcePollingChannelAdapterSpec;
import org.springframework.integration.dsl.core.ConsumerEndpointSpec;
import org.springframework.integration.dsl.core.IntegrationComponentSpec;
import org.springframework.integration.dsl.support.MessageChannelReference;
import org.springframework.integration.support.context.NamedComponent;
import org.springframework.messaging.MessageChannel;

View File

@@ -0,0 +1,4 @@
/**
* Provides config classes of the Spring Integration Java DSL.
*/
package org.springframework.integration.dsl.config;

View File

@@ -19,8 +19,8 @@ package org.springframework.integration.dsl.core;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.core.ResolvableType;
import org.springframework.integration.dsl.support.Function;
import org.springframework.integration.dsl.support.tuple.Tuple;
import org.springframework.integration.dsl.support.tuple.Tuple2;
import org.springframework.integration.dsl.support.tuple.Tuples;
import org.springframework.integration.scheduling.PollerMetadata;
import org.springframework.util.Assert;
@@ -37,7 +37,7 @@ public abstract class EndpointSpec<S extends EndpointSpec<S, F, H>, F extends Be
try {
Class<?> fClass = ResolvableType.forClass(this.getClass()).as(EndpointSpec.class).resolveGenerics()[1];
F endpointFactoryBean = (F) fClass.newInstance();
this.target = Tuple.of(endpointFactoryBean, handler);
this.target = Tuples.of(endpointFactoryBean, handler);
}
catch (Exception e) {
throw new IllegalStateException(e);

View File

@@ -41,7 +41,7 @@ public abstract class IntegrationComponentSpec<S extends IntegrationComponentSpe
return _this();
}
final String getId() {
public final String getId() {
return id;
}

View File

@@ -60,30 +60,6 @@ public class Tuple implements Iterable, Serializable {
this.size = values.length;
}
/**
* Create a {@link Tuple1} with the given object.
*
* @param t1 The first value in the tuple.
* @param <T1> The type of the first value.
* @return The new {@link Tuple1}.
*/
public static <T1> Tuple1<T1> of(T1 t1) {
return new Tuple1<T1>(t1);
}
/**
* Create a {@link Tuple2} with the given objects.
*
* @param t1 The first value in the tuple.
* @param t2 The second value in the tuple.
* @param <T1> The type of the first value.
* @param <T2> The type of the second value.
* @return The new {@link Tuple2}.
*/
public static <T1, T2> Tuple2<T1, T2> of(T1 t1, T2 t2) {
return new Tuple2<T1, T2>(t1, t2);
}
/**
* Get the object at the given index.

View File

@@ -0,0 +1,47 @@
/*
* Copyright 2014 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
*
* http://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.integration.dsl.support.tuple;
/**
* @author Artem Bilan
*/
public abstract class Tuples {
/**
* Create a {@link Tuple1} with the given object.
*
* @param t1 The first value in the tuple.
* @param <T1> The type of the first value.
* @return The new {@link Tuple1}.
*/
public static <T1> Tuple1<T1> of(T1 t1) {
return new Tuple1<T1>(t1);
}
/**
* Create a {@link Tuple2} with the given objects.
*
* @param t1 The first value in the tuple.
* @param t2 The second value in the tuple.
* @param <T1> The type of the first value.
* @param <T2> The type of the second value.
* @return The new {@link Tuple2}.
*/
public static <T1, T2> Tuple2<T1, T2> of(T1 t1, T2 t2) {
return new Tuple2<T1, T2>(t1, t2);
}
}

View File

@@ -1,2 +1,2 @@
org.springframework.integration.config.IntegrationConfigurationInitializer=\
org.springframework.integration.dsl.core.DslIntegrationConfigurationInitializer
org.springframework.integration.dsl.config.DslIntegrationConfigurationInitializer