This commit is contained in:
Rob Davies 2013-11-12 08:07:33 +00:00
parent bc9751ac23
commit 7e000d5a40
4 changed files with 33 additions and 1 deletions

View File

@ -65,4 +65,11 @@ public interface TransportServer extends Service {
* connections.
*/
boolean isSslServer();
/**
* Some protocols allow link stealing by default (if 2 connections have the same clientID - the youngest wins).
* This is the default for AMQP and MQTT. However, JMS 1.1 spec requires the opposite
* @return
*/
boolean isAllowLinkStealing();
}

View File

@ -59,4 +59,8 @@ public class TransportServerFilter implements TransportServer {
public boolean isSslServer() {
return next.isSslServer();
}
public boolean isAllowLinkStealing() {
return next.isAllowLinkStealing();
}
}

View File

@ -72,6 +72,8 @@ public class TcpTransportServer extends TransportServerThreadSupport implements
protected long maxInactivityDurationInitalDelay = 10000;
protected int minmumWireFormatVersion;
protected boolean useQueueForAccept = true;
protected boolean allowLinkStealing;
/**
* trace=true -> the Transport stack where this TcpTransport object will be, will have a TransportLogger layer
@ -343,7 +345,7 @@ public class TcpTransportServer extends TransportServerThreadSupport implements
/**
* @param socket
* @param inetAddress
* @param bindAddress
* @return real hostName
* @throws UnknownHostException
*/
@ -511,4 +513,13 @@ public class TcpTransportServer extends TransportServerThreadSupport implements
public boolean isSslServer() {
return false;
}
@Override
public boolean isAllowLinkStealing() {
return allowLinkStealing;
}
public void setAllowLinkStealing(boolean allowLinkStealing) {
this.allowLinkStealing = allowLinkStealing;
}
}

View File

@ -52,6 +52,7 @@ public class UdpTransportServer extends TransportServerSupport {
private final Transport configuredTransport;
private boolean usingWireFormatNegotiation;
private final Map<DatagramEndpoint, Transport> transports = new HashMap<DatagramEndpoint, Transport>();
private boolean allowLinkStealing;
public UdpTransportServer(URI connectURI, UdpTransport serverTransport, Transport configuredTransport, ReplayStrategy replayStrategy) {
super(connectURI);
@ -189,4 +190,13 @@ public class UdpTransportServer extends TransportServerSupport {
public boolean isSslServer() {
return false;
}
@Override
public boolean isAllowLinkStealing() {
return allowLinkStealing;
}
public void setAllowLinkStealing(boolean allowLinkStealing) {
this.allowLinkStealing = allowLinkStealing;
}
}