You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2013/01/29 20:29:23 UTC
svn commit: r1440073 - in
/activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport:
reliable/ReliableTransport.java udp/UdpTransportFactory.java
udp/UdpTransportServer.java
Author: tabish
Date: Tue Jan 29 19:29:23 2013
New Revision: 1440073
URL: http://svn.apache.org/viewvc?rev=1440073&view=rev
Log:
fix https://issues.apache.org/jira/browse/AMQ-4279
mark the Udp and Reliable as deprecated.
Modified:
activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/reliable/ReliableTransport.java
activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/udp/UdpTransportFactory.java
activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/udp/UdpTransportServer.java
Modified: activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/reliable/ReliableTransport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/reliable/ReliableTransport.java?rev=1440073&r1=1440072&r2=1440073&view=diff
==============================================================================
--- activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/reliable/ReliableTransport.java (original)
+++ activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/reliable/ReliableTransport.java Tue Jan 29 19:29:23 2013
@@ -34,14 +34,15 @@ import org.slf4j.LoggerFactory;
/**
* This interceptor deals with out of order commands together with being able to
* handle dropped commands and the re-requesting dropped commands.
- *
- *
+ *
+ * @deprecated
*/
+@Deprecated
public class ReliableTransport extends ResponseCorrelator {
private static final Logger LOG = LoggerFactory.getLogger(ReliableTransport.class);
private ReplayStrategy replayStrategy;
- private SortedSet<Command> commands = new TreeSet<Command>(new CommandIdComparator());
+ private final SortedSet<Command> commands = new TreeSet<Command>(new CommandIdComparator());
private int expectedCounter = 1;
private int replayBufferCommandCount = 50;
private int requestTimeout = 2000;
@@ -74,6 +75,7 @@ public class ReliableTransport extends R
}
}
+ @Override
public Object request(Object o) throws IOException {
final Command command = (Command)o;
FutureResponse response = asyncRequest(command, null);
@@ -86,6 +88,7 @@ public class ReliableTransport extends R
}
}
+ @Override
public Object request(Object o, int timeout) throws IOException {
final Command command = (Command)o;
FutureResponse response = asyncRequest(command, null);
@@ -104,6 +107,7 @@ public class ReliableTransport extends R
return response.getResult(0);
}
+ @Override
public void onCommand(Object o) {
Command command = (Command)o;
// lets pass wireformat through
@@ -243,10 +247,12 @@ public class ReliableTransport extends R
this.replayer = replayer;
}
+ @Override
public String toString() {
return next.toString();
}
+ @Override
public void start() throws Exception {
if (udpTransport != null) {
udpTransport.setReplayBuffer(getReplayBuffer());
Modified: activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/udp/UdpTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/udp/UdpTransportFactory.java?rev=1440073&r1=1440072&r2=1440073&view=diff
==============================================================================
--- activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/udp/UdpTransportFactory.java (original)
+++ activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/udp/UdpTransportFactory.java Tue Jan 29 19:29:23 2013
@@ -16,10 +16,25 @@
*/
package org.apache.activemq.transport.udp;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.UnknownHostException;
+import java.util.HashMap;
+import java.util.Map;
+
import org.apache.activemq.TransportLoggerSupport;
import org.apache.activemq.openwire.OpenWireFormat;
-import org.apache.activemq.transport.*;
-import org.apache.activemq.transport.reliable.*;
+import org.apache.activemq.transport.CommandJoiner;
+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.reliable.DefaultReplayStrategy;
+import org.apache.activemq.transport.reliable.ExceptionIfDroppedReplayStrategy;
+import org.apache.activemq.transport.reliable.ReliableTransport;
+import org.apache.activemq.transport.reliable.ReplayStrategy;
+import org.apache.activemq.transport.reliable.Replayer;
import org.apache.activemq.transport.tcp.TcpTransportFactory;
import org.apache.activemq.util.IOExceptionSupport;
import org.apache.activemq.util.IntrospectionSupport;
@@ -28,21 +43,17 @@ import org.apache.activemq.wireformat.Wi
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.UnknownHostException;
-import java.util.HashMap;
-import java.util.Map;
-
/**
* @author David Martin Clavo david(dot)martin(dot)clavo(at)gmail.com (logging improvement modifications)
- *
+ *
+ * @deprecated
*/
+@Deprecated
public class UdpTransportFactory 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));
@@ -64,10 +75,12 @@ public class UdpTransportFactory extends
}
}
+ @Override
public Transport configure(Transport transport, WireFormat format, Map options) throws Exception {
return configure(transport, format, options, false);
}
+ @Override
public Transport compositeConfigure(Transport transport, WireFormat format, Map options) {
IntrospectionSupport.setProperties(transport, options);
final UdpTransport udpTransport = (UdpTransport)transport;
@@ -92,6 +105,7 @@ public class UdpTransportFactory extends
return transport;
}
+ @Override
protected Transport createTransport(URI location, WireFormat wf) throws UnknownHostException, IOException {
OpenWireFormat wireFormat = asOpenWireFormat(wf);
return new UdpTransport(wireFormat, location);
@@ -104,7 +118,7 @@ public class UdpTransportFactory extends
/**
* Configures the transport
- *
+ *
* @param acceptServer true if this transport is used purely as an 'accept'
* transport for new connections which work like TCP
* SocketServers where new connections spin up a new separate
Modified: activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/udp/UdpTransportServer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/udp/UdpTransportServer.java?rev=1440073&r1=1440072&r2=1440073&view=diff
==============================================================================
--- activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/udp/UdpTransportServer.java (original)
+++ activemq/trunk/activemq-client/src/main/java/org/apache/activemq/transport/udp/UdpTransportServer.java Tue Jan 29 19:29:23 2013
@@ -41,17 +41,17 @@ import org.slf4j.LoggerFactory;
/**
* A UDP based implementation of {@link TransportServer}
*
- *
+ * @deprecated
*/
-
+@Deprecated
public class UdpTransportServer extends TransportServerSupport {
private static final Logger LOG = LoggerFactory.getLogger(UdpTransportServer.class);
- private UdpTransport serverTransport;
- private ReplayStrategy replayStrategy;
- private Transport configuredTransport;
+ private final UdpTransport serverTransport;
+ private final ReplayStrategy replayStrategy;
+ private final Transport configuredTransport;
private boolean usingWireFormatNegotiation;
- private Map<DatagramEndpoint, Transport> transports = new HashMap<DatagramEndpoint, Transport>();
+ private final Map<DatagramEndpoint, Transport> transports = new HashMap<DatagramEndpoint, Transport>();
public UdpTransportServer(URI connectURI, UdpTransport serverTransport, Transport configuredTransport, ReplayStrategy replayStrategy) {
super(connectURI);
@@ -60,6 +60,7 @@ public class UdpTransportServer extends
this.replayStrategy = replayStrategy;
}
+ @Override
public String toString() {
return "UdpTransportServer@" + serverTransport;
}
@@ -71,31 +72,38 @@ public class UdpTransportServer extends
return serverTransport;
}
+ @Override
public void setBrokerInfo(BrokerInfo brokerInfo) {
}
+ @Override
protected void doStart() throws Exception {
LOG.info("Starting " + this);
configuredTransport.setTransportListener(new TransportListener() {
+ @Override
public void onCommand(Object o) {
final Command command = (Command)o;
processInboundConnection(command);
}
+ @Override
public void onException(IOException error) {
LOG.error("Caught: " + error, error);
}
+ @Override
public void transportInterupted() {
}
+ @Override
public void transportResumed() {
}
});
configuredTransport.start();
}
+ @Override
protected void doStop(ServiceStopper stopper) throws Exception {
configuredTransport.stop();
}
@@ -151,6 +159,7 @@ public class UdpTransportServer extends
// Joiner must be on outside as the inbound messages must be processed
// by the reliable transport first
return new CommandJoiner(reliableTransport, connectionWireFormat) {
+ @Override
public void start() throws Exception {
super.start();
reliableTransport.onCommand(command);
@@ -171,6 +180,7 @@ public class UdpTransportServer extends
*/
}
+ @Override
public InetSocketAddress getSocketAddress() {
return serverTransport.getLocalSocketAddress();
}