Fix javadoc warnings.

This commit is contained in:
Timothy Bish 2015-08-05 19:01:08 -04:00
parent 61b2f6b40e
commit d8c0ff1417
7 changed files with 45 additions and 31 deletions

View File

@ -32,10 +32,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* A {@link ReliableTransportChannel} which uses a {@link DiscoveryAgent} to
* A {@link TransportFilter} which uses a {@link DiscoveryAgent} to
* discover remote broker instances and dynamically connect to them.
*
*
*/
public class DiscoveryTransport extends TransportFilter implements DiscoveryListener {

View File

@ -31,6 +31,7 @@ import org.apache.activemq.util.URISupport.CompositeData;
public class MockTransportFactory extends TransportFactory {
@Override
public Transport doConnect(URI location) throws URISyntaxException, Exception {
Transport transport = createTransport(URISupport.parseComposite(location));
transport = new MutexTransport(transport);
@ -38,13 +39,14 @@ public class MockTransportFactory extends TransportFactory {
return transport;
}
@Override
public Transport doCompositeConnect(URI location) throws URISyntaxException, Exception {
return createTransport(URISupport.parseComposite(location));
}
/**
* @param location
* @return
* @return a new Transport instance.
* @throws Exception
*/
public Transport createTransport(CompositeData compositData) throws Exception {
@ -53,8 +55,8 @@ public class MockTransportFactory extends TransportFactory {
return transport;
}
@Override
public TransportServer doBind(URI location) throws IOException {
throw new IOException("This protocol does not support being bound.");
}
}

View File

@ -20,8 +20,6 @@ import org.apache.activemq.command.Response;
/**
* ResponseHolder utility
*
*
*/
public class ResponseHolder {
protected Response response;
@ -37,7 +35,8 @@ public class ResponseHolder {
/**
* Set the Response for this holder
*
* @param r
* @param response
* the response returned from the remote peer.
*/
public void setResponse(Response r) {
synchronized (lock) {
@ -57,10 +56,10 @@ public class ResponseHolder {
}
/**
* wait upto <Code>timeout</Code> timeout ms to get a receipt
* wait up to <Code>timeout</Code> timeout milliseconds to get a receipt
*
* @param timeout
* @return
* @return the Response that was set or null if none set yet.
*/
public Response getResponse(int timeout) {
synchronized (lock) {

View File

@ -45,11 +45,13 @@ import org.slf4j.LoggerFactory;
* factory will have their needClientAuth option set to false.
*/
public class SslTransportFactory extends TcpTransportFactory {
private static final Logger LOG = LoggerFactory.getLogger(SslTransportFactory.class);
/**
* Overriding to use SslTransportServer and allow for proper reflection.
*/
@Override
public TransportServer doBind(final URI location) throws IOException {
try {
Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location));
@ -74,7 +76,7 @@ public class SslTransportFactory extends TcpTransportFactory {
*
* @param location
* @param serverSocketFactory
* @return
* @return a new SslTransportServer initialized from the given location and socket factory.
* @throws IOException
* @throws URISyntaxException
*/
@ -86,9 +88,10 @@ public class SslTransportFactory extends TcpTransportFactory {
* Overriding to allow for proper configuration through reflection but delegate to get common
* configuration
*/
@Override
@SuppressWarnings("rawtypes")
public Transport compositeConfigure(Transport transport, WireFormat format, Map options) {
SslTransport sslTransport = (SslTransport)transport.narrow(SslTransport.class);
SslTransport sslTransport = transport.narrow(SslTransport.class);
IntrospectionSupport.setProperties(sslTransport, options);
return super.compositeConfigure(transport, format, options);
@ -97,6 +100,7 @@ public class SslTransportFactory extends TcpTransportFactory {
/**
* Overriding to use SslTransports.
*/
@Override
protected Transport createTransport(URI location, WireFormat wf) throws UnknownHostException, IOException {
URI localLocation = null;
String path = location.getPath();
@ -122,6 +126,7 @@ public class SslTransportFactory extends TcpTransportFactory {
* @return Newly created (Ssl)ServerSocketFactory.
* @throws IOException
*/
@Override
protected ServerSocketFactory createServerSocketFactory() throws IOException {
if( SslContext.getCurrentSslContext()!=null ) {
SslContext ctx = SslContext.getCurrentSslContext();
@ -142,6 +147,7 @@ public class SslTransportFactory extends TcpTransportFactory {
* @return Newly created (Ssl)SocketFactory.
* @throws IOException
*/
@Override
protected SocketFactory createSocketFactory() throws IOException {
if( SslContext.getCurrentSslContext()!=null ) {
SslContext ctx = SslContext.getCurrentSslContext();

View File

@ -28,7 +28,11 @@ import javax.net.SocketFactory;
import org.apache.activemq.TransportLoggerSupport;
import org.apache.activemq.openwire.OpenWireFormat;
import org.apache.activemq.transport.*;
import org.apache.activemq.transport.InactivityMonitor;
import org.apache.activemq.transport.Transport;
import org.apache.activemq.transport.TransportFactory;
import org.apache.activemq.transport.TransportServer;
import org.apache.activemq.transport.WireFormatNegotiator;
import org.apache.activemq.util.IOExceptionSupport;
import org.apache.activemq.util.IntrospectionSupport;
import org.apache.activemq.util.URISupport;
@ -36,13 +40,11 @@ import org.apache.activemq.wireformat.WireFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author David Martin Clavo david(dot)martin(dot)clavo(at)gmail.com (logging improvement modifications)
*
*/
public class TcpTransportFactory extends TransportFactory {
private static final Logger LOG = LoggerFactory.getLogger(TcpTransportFactory.class);
@Override
public TransportServer doBind(final URI location) throws IOException {
try {
Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location));
@ -67,7 +69,7 @@ public class TcpTransportFactory extends TransportFactory {
*
* @param location
* @param serverSocketFactory
* @return
* @return a new TcpTransportServer instance.
* @throws IOException
* @throws URISyntaxException
*/
@ -75,10 +77,11 @@ public class TcpTransportFactory extends TransportFactory {
return new TcpTransportServer(this, location, serverSocketFactory);
}
@Override
@SuppressWarnings("rawtypes")
public Transport compositeConfigure(Transport transport, WireFormat format, Map options) {
TcpTransport tcpTransport = (TcpTransport)transport.narrow(TcpTransport.class);
TcpTransport tcpTransport = transport.narrow(TcpTransport.class);
IntrospectionSupport.setProperties(tcpTransport, options);
Map<String, Object> socketOptions = IntrospectionSupport.extractProperties(options, "socket.");
@ -108,12 +111,13 @@ public class TcpTransportFactory extends TransportFactory {
/**
* Returns true if the inactivity monitor should be used on the transport
* @return true if the inactivity monitor should be used on the transport
*/
protected boolean isUseInactivityMonitor(Transport transport) {
return true;
}
@Override
protected Transport createTransport(URI location, WireFormat wf) throws UnknownHostException, IOException {
URI localLocation = null;
String path = location.getPath();
@ -137,13 +141,15 @@ public class TcpTransportFactory extends TransportFactory {
/**
* Allows subclasses of TcpTransportFactory to provide a create custom
* TcpTransport intances.
* TcpTransport instances.
*
* @param location
* @param wf
* @param socketFactory
* @param location
* @param localLocation
* @return
*
* @return a new TcpTransport instance connected to the given location.
*
* @throws UnknownHostException
* @throws IOException
*/

View File

@ -378,7 +378,9 @@ public class TcpTransportServer extends TransportServerThreadSupport implements
*
* @param socket
* @param format
* @return
*
* @return a new Transport instance.
*
* @throws IOException
*/
protected Transport createTransport(Socket socket, WireFormat format) throws IOException {

View File

@ -21,10 +21,8 @@ import java.util.ArrayList;
import java.util.List;
/**
* A default implementation of {@link BufferPool} which keeps a pool of direct
* A default implementation of {@link SimpleBufferPool} which keeps a pool of direct
* byte buffers.
*
*
*/
public class DefaultBufferPool extends SimpleBufferPool implements ByteBufferPool {
@ -39,6 +37,7 @@ public class DefaultBufferPool extends SimpleBufferPool implements ByteBufferPoo
super(useDirect);
}
@Override
public synchronized ByteBuffer borrowBuffer() {
synchronized (lock) {
int size = buffers.size();
@ -49,15 +48,18 @@ public class DefaultBufferPool extends SimpleBufferPool implements ByteBufferPoo
return createBuffer();
}
@Override
public void returnBuffer(ByteBuffer buffer) {
synchronized (lock) {
buffers.add(buffer);
}
}
@Override
public void start() throws Exception {
}
@Override
public void stop() throws Exception {
synchronized (lock) {
/*
@ -67,5 +69,4 @@ public class DefaultBufferPool extends SimpleBufferPool implements ByteBufferPoo
buffers.clear();
}
}
}