INT-2964 Various JavaDoc Fixes
INT-2964 - JavaDoc: <emphasis> should be <em>
INT-2964 - JavaDoc: <p/> should be <p>
INT-2964 - JavaDoc polishing
* <li></li> should be wrapped in <ul></ul>
* wrap code snippets in {@code myCode()}
* change <code>false</false> to <code>false</code>
INT-2964 - Polish - Fix more JavaDoc errors
* Mockito-all dependency causes JavaDoc error. Change dependency to Mockito-Core.
This commit is contained in:
committed by
Gary Russell
parent
4c348d3785
commit
05062aa0b2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2001-2012 the original author or authors.
|
||||
* Copyright 2001-2013 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.
|
||||
@@ -42,7 +42,7 @@ import org.springframework.util.Assert;
|
||||
* single use connections, each request is blocked until the previous response is received
|
||||
* (or times out). Asynchronous requests/responses over the same connection are not
|
||||
* supported - use a pair of outbound/inbound adapters for that use case.
|
||||
* <p/>
|
||||
* <p>
|
||||
* {@link SmartLifecycle} methods delegate to the underlying {@link AbstractConnectionFactory}
|
||||
*
|
||||
*
|
||||
|
||||
@@ -397,7 +397,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport
|
||||
|
||||
/**
|
||||
* How often we clean up closed NIO connections if soTimeout is 0.
|
||||
* Ignored when soTimeout > 0 because the clean up
|
||||
* Ignored when {@code soTimeout > 0} because the clean up
|
||||
* process is run as part of the timeout handling.
|
||||
* Default 2000 milliseconds.
|
||||
* @param nioHarvestInterval The interval in milliseconds.
|
||||
@@ -504,7 +504,8 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport
|
||||
|
||||
/**
|
||||
*
|
||||
* Times out any expired connections then, if selectionCount > 0, processes the selected keys.
|
||||
* Times out any expired connections then, if {@code selectionCount > 0},
|
||||
* processes the selected keys.
|
||||
* Removes closed connections from the connections field, and from the connections parameter.
|
||||
*
|
||||
* @param selectionCount Number of IO Events, if 0 we were probably woken up by a close.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2011 the original author or authors.
|
||||
* Copyright 2002-2013 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,7 +23,7 @@ import org.springframework.jmx.export.annotation.ManagedOperation;
|
||||
* of running in client-mode. For inbound endpoints,
|
||||
* this means that the endpoint establishes the connection
|
||||
* and then receives incoming data.
|
||||
* <p/>
|
||||
* <p>
|
||||
* For an outbound adapter, it means that the adapter
|
||||
* will establish the connection rather than waiting
|
||||
* for a message to cause the connection to be
|
||||
|
||||
@@ -59,17 +59,17 @@ public class FailoverClientConnectionFactory extends AbstractClientConnectionFac
|
||||
* data need a Listener to send the messages to.
|
||||
* This applies to client factories used for outbound gateways
|
||||
* or for a pair of collaborating channel adapters.
|
||||
* <p/>
|
||||
* <p>
|
||||
* During initialization, if a factory detects it has no listener
|
||||
* it's listening logic (active thread) is terminated.
|
||||
* <p/>
|
||||
* <p>
|
||||
* The listener registered with a factory is provided to each
|
||||
* connection it creates so it can call the onMessage() method.
|
||||
* <p/>
|
||||
* <p>
|
||||
* This code satisfies the first requirement in that this
|
||||
* listener signals to the factory that it needs to run
|
||||
* its listening logic.
|
||||
* <p/>
|
||||
* <p>
|
||||
* When we wrap actual connections with FailoverTcpConnections,
|
||||
* the connection is given the wrapper as a listener, so it
|
||||
* can enhance the headers in onMessage(); the wrapper then invokes
|
||||
|
||||
@@ -78,7 +78,7 @@ public class TcpMessageMapper implements
|
||||
* Override to provide additional headers. The standard headers cannot be overridden
|
||||
* and any such headers will be ignored if provided in the result.
|
||||
* @param connection the connection.
|
||||
* @return A Map of <String, ?> headers to be added to the message.
|
||||
* @return A Map of {@code <String, ?>} headers to be added to the message.
|
||||
*/
|
||||
protected Map<String, ?> supplyCustomHeaders(TcpConnection connection) {
|
||||
return null;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2013 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.
|
||||
@@ -32,7 +32,8 @@ public interface TcpSSLContextSupport {
|
||||
/**
|
||||
* Gets an SSLContext.
|
||||
* @return the SSLContext.
|
||||
* @throws Exception
|
||||
* @throws GeneralSecurityException
|
||||
* @throws IOException
|
||||
*/
|
||||
SSLContext getSSLContext() throws GeneralSecurityException, IOException;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2013 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.
|
||||
@@ -26,51 +26,51 @@ import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Reads data in an InputStream to a byte[]; data must be preceded by
|
||||
* a binary length (network byte order, not included in resulting byte[]).
|
||||
*
|
||||
* a binary length (network byte order, not included in resulting byte[]).
|
||||
*
|
||||
* Writes a byte[] to an OutputStream after a binary length.
|
||||
* The length field contains the length of data following the length
|
||||
* field. (network byte order).
|
||||
*
|
||||
*
|
||||
* The default length field is a 4 byte signed integer. During deserialization,
|
||||
* negative values will be rejected.
|
||||
* Other options are an unsigned byte, and unsigned short.
|
||||
*
|
||||
*
|
||||
* For other header formats, override {@link #readHeader(InputStream)} and
|
||||
* {@link #writeHeader(OutputStream, int)}.
|
||||
*
|
||||
*
|
||||
* @author Gary Russell
|
||||
* @since 2.0
|
||||
*/
|
||||
public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Default length-header field, allows for data up to 2**31-1 bytes.
|
||||
*/
|
||||
public static final int HEADER_SIZE_INT = 4; // default
|
||||
|
||||
|
||||
/**
|
||||
* A single unsigned byte, for data up to 255 bytes.
|
||||
*/
|
||||
public static final int HEADER_SIZE_UNSIGNED_BYTE = 1;
|
||||
|
||||
|
||||
/**
|
||||
* An unsigned short, for data up to 2**16 bytes.
|
||||
*/
|
||||
public static final int HEADER_SIZE_UNSIGNED_SHORT = 2;
|
||||
|
||||
|
||||
private final int headerSize;
|
||||
|
||||
private Log logger = LogFactory.getLog(this.getClass());
|
||||
|
||||
|
||||
private final Log logger = LogFactory.getLog(this.getClass());
|
||||
|
||||
/**
|
||||
* Constructs the serializer using {@link #HEADER_SIZE_INT}
|
||||
*/
|
||||
public ByteArrayLengthHeaderSerializer() {
|
||||
this(HEADER_SIZE_INT);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructs the serializer using the supplied header size.
|
||||
* Valid header sizes are {@link #HEADER_SIZE_INT} (default),
|
||||
@@ -85,21 +85,21 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer
|
||||
}
|
||||
this.headerSize = headerSize;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reads the header from the stream and then reads the provided length
|
||||
* from the stream and returns the data in a byte[]. Throws an
|
||||
* IOException if the length field exceeds the maxMessageSize.
|
||||
* Throws a {@link SoftEndOfStreamException} if the stream
|
||||
* is closed between messages.
|
||||
* is closed between messages.
|
||||
*/
|
||||
public byte[] deserialize(InputStream inputStream) throws IOException {
|
||||
int messageLength = this.readHeader(inputStream);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Message length is " + messageLength);
|
||||
}
|
||||
}
|
||||
if (messageLength > this.maxMessageSize) {
|
||||
throw new IOException("Message length " + messageLength +
|
||||
throw new IOException("Message length " + messageLength +
|
||||
" exceeds max message length: " + this.maxMessageSize);
|
||||
}
|
||||
byte[] messagePart = new byte[messageLength];
|
||||
@@ -120,12 +120,12 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer
|
||||
/**
|
||||
* Reads data from the socket and puts the data in buffer. Blocks until
|
||||
* buffer is full or a socket timeout occurs.
|
||||
* @param buffer
|
||||
* @param buffer the buffer into which the data should be read
|
||||
* @param header true if we are reading the header
|
||||
* @return < 0 if socket closed and not in the middle of a message
|
||||
* @return {@code < 0} if socket closed and not in the middle of a message
|
||||
* @throws IOException
|
||||
*/
|
||||
protected int read(InputStream inputStream, byte[] buffer, boolean header)
|
||||
protected int read(InputStream inputStream, byte[] buffer, boolean header)
|
||||
throws IOException {
|
||||
int lengthRead = 0;
|
||||
int needed = buffer.length;
|
||||
@@ -141,7 +141,7 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer
|
||||
}
|
||||
lengthRead += len;
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Read " + len + " bytes, buffer is now at " +
|
||||
logger.debug("Read " + len + " bytes, buffer is now at " +
|
||||
lengthRead + " of " +
|
||||
needed);
|
||||
}
|
||||
@@ -153,13 +153,13 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer
|
||||
* Writes the header, according to the header format.
|
||||
* @param outputStream
|
||||
* @param length
|
||||
* @throws IOException
|
||||
* @throws IOException
|
||||
*/
|
||||
protected void writeHeader(OutputStream outputStream, int length) throws IOException {
|
||||
ByteBuffer lengthPart = ByteBuffer.allocate(this.headerSize);
|
||||
switch (this.headerSize) {
|
||||
case HEADER_SIZE_INT:
|
||||
lengthPart.putInt(length);
|
||||
lengthPart.putInt(length);
|
||||
break;
|
||||
case HEADER_SIZE_UNSIGNED_BYTE:
|
||||
if (length > 0xff) {
|
||||
@@ -178,7 +178,7 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer
|
||||
lengthPart.putShort((short) length);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Bad header size:" + headerSize);
|
||||
throw new IllegalArgumentException("Bad header size:" + headerSize);
|
||||
}
|
||||
outputStream.write(lengthPart.array());
|
||||
}
|
||||
@@ -187,7 +187,8 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer
|
||||
* Reads the header and returns the length of the data part.
|
||||
* @param inputStream
|
||||
* @return The length of the data part
|
||||
* @throws IOException, {@link SoftEndOfStreamException} if socket closes
|
||||
* @throws IOException
|
||||
* @throws SoftEndOfStreamException if socket closes
|
||||
* before any length data read.
|
||||
*/
|
||||
protected int readHeader(InputStream inputStream) throws IOException {
|
||||
@@ -202,7 +203,7 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer
|
||||
messageLength = ByteBuffer.wrap(lengthPart).getInt();
|
||||
if (messageLength < 0) {
|
||||
throw new IllegalArgumentException("Length header:"
|
||||
+ messageLength
|
||||
+ messageLength
|
||||
+ " is negative");
|
||||
}
|
||||
break;
|
||||
@@ -213,7 +214,7 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer
|
||||
messageLength = ByteBuffer.wrap(lengthPart).getShort() & 0xffff;
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Bad header size:" + headerSize);
|
||||
throw new IllegalArgumentException("Bad header size:" + headerSize);
|
||||
}
|
||||
return messageLength;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2011 the original author or authors.
|
||||
* Copyright 2002-2013 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,11 +23,12 @@ import java.io.OutputStream;
|
||||
* A byte array (de)serializer that does nothing with the payload; sends it raw.
|
||||
* Message termination for assembly purposes is signaled by the client closing the
|
||||
* connection. The serializer does not, itself, close the connection after
|
||||
* writing the bytes.<p/>
|
||||
* writing the bytes.
|
||||
* <p>
|
||||
* Because the socket must be closed to indicate message end, this (de)serializer
|
||||
* can only be used by uni-directional (non-collaborating) channel adapters, and
|
||||
* can only be used by uni-directional (non-collaborating) channel adapters, and
|
||||
* not by gateways.
|
||||
*
|
||||
*
|
||||
* @author Gary Russell
|
||||
* @since 2.0.3
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2013 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.
|
||||
@@ -18,26 +18,28 @@ package org.springframework.integration.ip.util;
|
||||
|
||||
/**
|
||||
* Regular Expression Utilities.
|
||||
*
|
||||
*
|
||||
* @author Gary Russell
|
||||
* @since 2.0
|
||||
*/
|
||||
public abstract class RegexUtils {
|
||||
|
||||
/**
|
||||
* Escapes (precedes with \) any characters in the parameter in the set<br/><br/>
|
||||
* <code>.$[]^*+{}()\?|</code><br/><br/>
|
||||
* Escapes (precedes with \) any characters in the parameter in the set
|
||||
* <p>
|
||||
* <code>.$[]^*+{}()\?|</code>
|
||||
* <p>
|
||||
* Used to escape a string that is used as a regular expression pattern, to remove
|
||||
* the special meaning of these characters.
|
||||
* @param stringToEscape The string to escape.
|
||||
* @return The escaped string.
|
||||
*/
|
||||
public static String escapeRegexSpecials(String stringToEscape) {
|
||||
// In the following, we look for all the specials and any we find
|
||||
// are escaped in the output string, allowing that string to
|
||||
// In the following, we look for all the specials and any we find
|
||||
// are escaped in the output string, allowing that string to
|
||||
// be used as a pattern containing the literal specials.
|
||||
String out = stringToEscape.replaceAll(
|
||||
"(\\.|\\$|\\[|\\]|\\^|\\*|\\+|\\{|\\}|\\(|\\)|\\\\|\\?|\\|)",
|
||||
"(\\.|\\$|\\[|\\]|\\^|\\*|\\+|\\{|\\}|\\(|\\)|\\\\|\\?|\\|)",
|
||||
"\\\\$1");
|
||||
return out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user