Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdavies committed Nov 12, 2013
1 parent bc9751a commit 7e000d5
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,8 @@ public InetSocketAddress getSocketAddress() {
public boolean isSslServer() {
return next.isSslServer();
}

public boolean isAllowLinkStealing() {
return next.isAllowLinkStealing();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -343,7 +345,7 @@ public String toString() {

/**
* @param socket
* @param inetAddress
* @param bindAddress
* @return real hostName
* @throws UnknownHostException
*/
Expand Down Expand Up @@ -511,4 +513,13 @@ public void stopped(Service service) {
public boolean isSslServer() {
return false;
}

@Override
public boolean isAllowLinkStealing() {
return allowLinkStealing;
}

public void setAllowLinkStealing(boolean allowLinkStealing) {
this.allowLinkStealing = allowLinkStealing;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -189,4 +190,13 @@ public InetSocketAddress getSocketAddress() {
public boolean isSslServer() {
return false;
}

@Override
public boolean isAllowLinkStealing() {
return allowLinkStealing;
}

public void setAllowLinkStealing(boolean allowLinkStealing) {
this.allowLinkStealing = allowLinkStealing;
}
}

0 comments on commit 7e000d5

Please sign in to comment.