INT-2828 Remove Package Tangle

* Remove Class Tangle in JPA
* tcp.connection
* tcp.connection.support
* Add Comment to MessageGroupCallback
  - Comment that it is moving into MGS in 3.0.
  - Convert DOS newlines to Unix.

For reference see: https://jira.springsource.org/browse/INT-2828
This commit is contained in:
Gary Russell
2012-11-21 13:06:51 -05:00
committed by Gunnar Hillert
parent 9bed860838
commit c4a4b59848
12 changed files with 171 additions and 117 deletions

View File

@@ -1,26 +1,30 @@
/*
* Copyright 2002-2010 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.store;
/**
* @author Dave Syer
*
* @since 2.0
*
*/
public interface MessageGroupCallback {
void execute(MessageGroupStore messageGroupStore, MessageGroup group);
}
/*
* Copyright 2002-2012 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.store;
/**
* Invoked when a MessageGroupStore expires a group.
* <p/>
* <strong>Note: This interface will become an inner interface of
* MessageGroupStore in release 3.0.</strong>
* @author Dave Syer
*
* @since 2.0
*
*/
public interface MessageGroupCallback {
void execute(MessageGroupStore messageGroupStore, MessageGroup group);
}

View File

@@ -25,18 +25,18 @@ import org.springframework.core.serializer.Deserializer;
import org.springframework.core.serializer.Serializer;
import org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory;
import org.springframework.integration.ip.tcp.connection.AbstractServerConnectionFactory;
import org.springframework.integration.ip.tcp.connection.DefaultTcpNioConnectionSupport;
import org.springframework.integration.ip.tcp.connection.DefaultTcpNioSSLConnectionSupport;
import org.springframework.integration.ip.tcp.connection.TcpConnectionInterceptorFactoryChain;
import org.springframework.integration.ip.tcp.connection.TcpMessageMapper;
import org.springframework.integration.ip.tcp.connection.TcpNetClientConnectionFactory;
import org.springframework.integration.ip.tcp.connection.TcpNetServerConnectionFactory;
import org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory;
import org.springframework.integration.ip.tcp.connection.TcpNioConnectionSupport;
import org.springframework.integration.ip.tcp.connection.TcpNioServerConnectionFactory;
import org.springframework.integration.ip.tcp.connection.support.DefaultTcpNetSSLSocketFactorySupport;
import org.springframework.integration.ip.tcp.connection.support.DefaultTcpNetSocketFactorySupport;
import org.springframework.integration.ip.tcp.connection.support.DefaultTcpNioConnectionSupport;
import org.springframework.integration.ip.tcp.connection.support.DefaultTcpNioSSLConnectionSupport;
import org.springframework.integration.ip.tcp.connection.support.DefaultTcpSocketSupport;
import org.springframework.integration.ip.tcp.connection.support.TcpNioConnectionSupport;
import org.springframework.integration.ip.tcp.connection.support.TcpSSLContextSupport;
import org.springframework.integration.ip.tcp.connection.support.TcpSocketFactorySupport;
import org.springframework.integration.ip.tcp.connection.support.TcpSocketSupport;

View File

@@ -13,11 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.ip.tcp.connection.support;
package org.springframework.integration.ip.tcp.connection;
import java.nio.channels.SocketChannel;
import org.springframework.integration.ip.tcp.connection.TcpNioConnection;
/**
* Implementation of {@link TcpNioConnectionSupport} for non-SSL

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.ip.tcp.connection.support;
package org.springframework.integration.ip.tcp.connection;
import java.nio.channels.SocketChannel;
@@ -21,8 +21,7 @@ import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.integration.ip.tcp.connection.TcpNioConnection;
import org.springframework.integration.ip.tcp.connection.TcpNioSSLConnection;
import org.springframework.integration.ip.tcp.connection.support.TcpSSLContextSupport;
import org.springframework.util.Assert;
/**

View File

@@ -30,8 +30,6 @@ import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.LinkedBlockingQueue;
import org.springframework.integration.ip.tcp.connection.support.DefaultTcpNioConnectionSupport;
import org.springframework.integration.ip.tcp.connection.support.TcpNioConnectionSupport;
import org.springframework.util.Assert;

View File

@@ -13,11 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.ip.tcp.connection.support;
package org.springframework.integration.ip.tcp.connection;
import java.nio.channels.SocketChannel;
import org.springframework.integration.ip.tcp.connection.TcpNioConnection;
/**
* Used by NIO connection factories to instantiate a {@link TcpNioConnection} object.

View File

@@ -30,8 +30,6 @@ import java.nio.channels.SocketChannel;
import java.util.HashMap;
import java.util.Map;
import org.springframework.integration.ip.tcp.connection.support.DefaultTcpNioConnectionSupport;
import org.springframework.integration.ip.tcp.connection.support.TcpNioConnectionSupport;
import org.springframework.util.Assert;
/**

View File

@@ -48,12 +48,12 @@ import org.springframework.integration.ip.tcp.TcpOutboundGateway;
import org.springframework.integration.ip.tcp.TcpReceivingChannelAdapter;
import org.springframework.integration.ip.tcp.TcpSendingMessageHandler;
import org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory;
import org.springframework.integration.ip.tcp.connection.DefaultTcpNioSSLConnectionSupport;
import org.springframework.integration.ip.tcp.connection.TcpNetClientConnectionFactory;
import org.springframework.integration.ip.tcp.connection.TcpNetServerConnectionFactory;
import org.springframework.integration.ip.tcp.connection.TcpNioClientConnectionFactory;
import org.springframework.integration.ip.tcp.connection.TcpNioServerConnectionFactory;
import org.springframework.integration.ip.tcp.connection.support.DefaultTcpNetSSLSocketFactorySupport;
import org.springframework.integration.ip.tcp.connection.support.DefaultTcpNioSSLConnectionSupport;
import org.springframework.integration.ip.tcp.connection.support.TcpSocketFactorySupport;
import org.springframework.integration.ip.tcp.connection.support.TcpSocketSupport;
import org.springframework.integration.ip.udp.DatagramPacketMessageMapper;

View File

@@ -41,7 +41,6 @@ import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.springframework.integration.Message;
import org.springframework.integration.ip.tcp.connection.support.DefaultTcpNetSSLSocketFactorySupport;
import org.springframework.integration.ip.tcp.connection.support.DefaultTcpNioSSLConnectionSupport;
import org.springframework.integration.ip.tcp.connection.support.DefaultTcpSSLContextSupport;
import org.springframework.integration.ip.tcp.connection.support.TcpSSLContextSupport;
import org.springframework.integration.ip.tcp.connection.support.TcpSocketFactorySupport;

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2002-2012 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.jpa.support.parametersource;
import java.util.Collection;
@@ -9,9 +24,15 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.expression.ExpressionException;
import org.springframework.integration.jpa.support.JpaParameter;
import org.springframework.integration.jpa.support.parametersource.ExpressionEvaluatingParameterSourceFactory.ParameterExpressionEvaluator;
import org.springframework.integration.jpa.support.parametersource.ExpressionEvaluatingParameterSourceUtils.ParameterExpressionEvaluator;
import org.springframework.util.Assert;
/**
*
* @author Gunnar Hillert
* @since 2.2
*
*/
class ExpressionEvaluatingParameterSource implements PositionSupportingParameterSource {
private static final Log logger = LogFactory.getLog(ExpressionEvaluatingParameterSource.class);
@@ -33,8 +54,8 @@ class ExpressionEvaluatingParameterSource implements PositionSupportingParameter
this.input = input;
this.expressionEvaluator = expressionEvaluator;
this.parameters = parameters;
this.parameterExpressions = ExpressionEvaluatingParameterSourceFactory.convertExpressions(parameters);
this.values.putAll(ExpressionEvaluatingParameterSourceFactory.convertStaticParameters(parameters));
this.parameterExpressions = ExpressionEvaluatingParameterSourceUtils.convertExpressions(parameters);
this.values.putAll(ExpressionEvaluatingParameterSourceUtils.convertStaticParameters(parameters));
}

View File

@@ -16,15 +16,11 @@
package org.springframework.integration.jpa.support.parametersource;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.integration.jpa.support.JpaParameter;
import org.springframework.integration.util.AbstractExpressionEvaluator;
import org.springframework.integration.jpa.support.parametersource.ExpressionEvaluatingParameterSourceUtils.ParameterExpressionEvaluator;
import org.springframework.util.Assert;
/**
@@ -56,7 +52,8 @@ public class ExpressionEvaluatingParameterSourceFactory implements ParameterSour
}
this.parameters = parameters;
expressionEvaluator.getEvaluationContext().setVariable("staticParameters", convertStaticParameters(parameters));
expressionEvaluator.getEvaluationContext().setVariable("staticParameters",
ExpressionEvaluatingParameterSourceUtils.convertStaticParameters(parameters));
}
@@ -64,70 +61,4 @@ public class ExpressionEvaluatingParameterSourceFactory implements ParameterSour
return new ExpressionEvaluatingParameterSource(input, this.parameters, expressionEvaluator);
}
/**
* Utility method that converts a Collection of {@link JpaParameter} to
* a Map containing only expression parameters.
*
* @param jpaParameters Must not be null.
* @return Map containing only the Expression bound parameters. Will never be null.
*/
public static Map<String, String> convertExpressions(Collection<JpaParameter> jpaParameters) {
Assert.notNull(jpaParameters, "The Collection of jpaParameters must not be null.");
for (JpaParameter parameter : jpaParameters) {
Assert.notNull(parameter, "'jpaParameters' must not contain null values.");
}
final Map<String, String> staticParameters = new HashMap<String, String>();
for (JpaParameter parameter : jpaParameters) {
if (parameter.getExpression() != null) {
staticParameters.put(parameter.getName(), parameter.getExpression());
}
}
return staticParameters;
}
/**
* Utility method that converts a Collection of {@link JpaParameter} to
* a Map containing only static parameters.
*
* @param jpaParameters Must not be null.
* @return Map containing only the static parameters. Will never be null.
*/
public static Map<String, Object> convertStaticParameters(Collection<JpaParameter> jpaParameters) {
Assert.notNull(jpaParameters, "The Collection of jpaParameters must not be null.");
for (JpaParameter parameter : jpaParameters) {
Assert.notNull(parameter, "'jpaParameters' must not contain null values.");
}
final Map<String, Object> staticParameters = new HashMap<String, Object>();
for (JpaParameter parameter : jpaParameters) {
if (parameter.getValue() != null) {
staticParameters.put(parameter.getName(), parameter.getValue());
}
}
return staticParameters;
}
public class ParameterExpressionEvaluator extends AbstractExpressionEvaluator {
@Override
public StandardEvaluationContext getEvaluationContext() {
return super.getEvaluationContext();
}
@Override
public Object evaluateExpression(String expression, Object input) {
return super.evaluateExpression(expression, input);
}
}
}

View File

@@ -0,0 +1,106 @@
/*
* Copyright 2002-2012 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.jpa.support.parametersource;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.integration.jpa.support.JpaParameter;
import org.springframework.integration.util.AbstractExpressionEvaluator;
import org.springframework.util.Assert;
/**
*
* @author Gunnar Hillert
* @author Gary Russell
* @since 2.2
*
*/
class ExpressionEvaluatingParameterSourceUtils {
private ExpressionEvaluatingParameterSourceUtils() {
throw new AssertionError();
}
/**
* Utility method that converts a Collection of {@link JpaParameter} to
* a Map containing only expression parameters.
*
* @param jpaParameters Must not be null.
* @return Map containing only the Expression bound parameters. Will never be null.
*/
public static Map<String, String> convertExpressions(Collection<JpaParameter> jpaParameters) {
Assert.notNull(jpaParameters, "The Collection of jpaParameters must not be null.");
for (JpaParameter parameter : jpaParameters) {
Assert.notNull(parameter, "'jpaParameters' must not contain null values.");
}
final Map<String, String> staticParameters = new HashMap<String, String>();
for (JpaParameter parameter : jpaParameters) {
if (parameter.getExpression() != null) {
staticParameters.put(parameter.getName(), parameter.getExpression());
}
}
return staticParameters;
}
/**
* Utility method that converts a Collection of {@link JpaParameter} to
* a Map containing only static parameters.
*
* @param jpaParameters Must not be null.
* @return Map containing only the static parameters. Will never be null.
*/
public static Map<String, Object> convertStaticParameters(Collection<JpaParameter> jpaParameters) {
Assert.notNull(jpaParameters, "The Collection of jpaParameters must not be null.");
for (JpaParameter parameter : jpaParameters) {
Assert.notNull(parameter, "'jpaParameters' must not contain null values.");
}
final Map<String, Object> staticParameters = new HashMap<String, Object>();
for (JpaParameter parameter : jpaParameters) {
if (parameter.getValue() != null) {
staticParameters.put(parameter.getName(), parameter.getValue());
}
}
return staticParameters;
}
public static class ParameterExpressionEvaluator extends AbstractExpressionEvaluator {
@Override
public StandardEvaluationContext getEvaluationContext() {
return super.getEvaluationContext();
}
@Override
public Object evaluateExpression(String expression, Object input) {
return super.evaluateExpression(expression, input);
}
}
}