Skip to content

Commit 546c0c1

Browse files
author
Matthew Sackman
committed
Merge default into bug21899 and debitrot
2 parents a0ec986 + 2d7f5ad commit 546c0c1

File tree

152 files changed

+1736
-595
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+1736
-595
lines changed

LICENSE-MPL-RabbitMQ

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,11 @@ EXHIBIT A -Mozilla Public License.
454454
are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
455455
Technologies LLC, and Rabbit Technologies Ltd.
456456

457-
Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
457+
Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
458458
Ltd. Portions created by Cohesive Financial Technologies LLC are
459-
Copyright (C) 2007-2009 Cohesive Financial Technologies
459+
Copyright (C) 2007-2010 Cohesive Financial Technologies
460460
LLC. Portions created by Rabbit Technologies Ltd are Copyright
461-
(C) 2007-2009 Rabbit Technologies Ltd.
461+
(C) 2007-2010 Rabbit Technologies Ltd.
462462

463463
All Rights Reserved.
464464

codegen.py

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
## are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
1919
## Technologies LLC, and Rabbit Technologies Ltd.
2020
##
21-
## Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
21+
## Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
2222
## Ltd. Portions created by Cohesive Financial Technologies LLC are
23-
## Copyright (C) 2007-2009 Cohesive Financial Technologies
23+
## Copyright (C) 2007-2010 Cohesive Financial Technologies
2424
## LLC. Portions created by Rabbit Technologies Ltd are Copyright
25-
## (C) 2007-2009 Rabbit Technologies Ltd.
25+
## (C) 2007-2010 Rabbit Technologies Ltd.
2626
##
2727
## All Rights Reserved.
2828
##
@@ -95,8 +95,45 @@ def java_field_type(spec, domain):
9595

9696
#---------------------------------------------------------------------------
9797

98+
def printFileHeader():
99+
print """// NOTE: This -*- java -*- source code is autogenerated from the AMQP
100+
// specification!
101+
//
102+
// The contents of this file are subject to the Mozilla Public License
103+
// Version 1.1 (the "License"); you may not use this file except in
104+
// compliance with the License. You may obtain a copy of the License at
105+
// http://www.mozilla.org/MPL/
106+
//
107+
// Software distributed under the License is distributed on an "AS IS"
108+
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
109+
// License for the specific language governing rights and limitations
110+
// under the License.
111+
//
112+
// The Original Code is RabbitMQ.
113+
//
114+
// The Initial Developers of the Original Code are LShift Ltd,
115+
// Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd.
116+
//
117+
// Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd,
118+
// Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd
119+
// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
120+
// Technologies LLC, and Rabbit Technologies Ltd.
121+
//
122+
// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
123+
// Ltd. Portions created by Cohesive Financial Technologies LLC are
124+
// Copyright (C) 2007-2010 Cohesive Financial Technologies
125+
// LLC. Portions created by Rabbit Technologies Ltd are Copyright
126+
// (C) 2007-2010 Rabbit Technologies Ltd.
127+
//
128+
// All Rights Reserved.
129+
//
130+
// Contributor(s): ______________________________________.
131+
//
132+
"""
133+
98134
def genJavaApi(spec):
99135
def printHeader():
136+
printFileHeader()
100137
print """package com.rabbitmq.client;
101138
102139
import java.io.IOException;
@@ -223,6 +260,7 @@ def printClassProperties(c):
223260

224261
def genJavaImpl(spec):
225262
def printHeader():
263+
printFileHeader()
226264
print """package com.rabbitmq.client.impl;
227265
228266
import java.io.IOException;

src/com/rabbitmq/client/Address.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
1919
// Technologies LLC, and Rabbit Technologies Ltd.
2020
//
21-
// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
21+
// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
2222
// Ltd. Portions created by Cohesive Financial Technologies LLC are
23-
// Copyright (C) 2007-2009 Cohesive Financial Technologies
23+
// Copyright (C) 2007-2010 Cohesive Financial Technologies
2424
// LLC. Portions created by Rabbit Technologies Ltd are Copyright
25-
// (C) 2007-2009 Rabbit Technologies Ltd.
25+
// (C) 2007-2010 Rabbit Technologies Ltd.
2626
//
2727
// All Rights Reserved.
2828
//

src/com/rabbitmq/client/AlreadyClosedException.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
1919
// Technologies LLC, and Rabbit Technologies Ltd.
2020
//
21-
// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
21+
// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
2222
// Ltd. Portions created by Cohesive Financial Technologies LLC are
23-
// Copyright (C) 2007-2009 Cohesive Financial Technologies
23+
// Copyright (C) 2007-2010 Cohesive Financial Technologies
2424
// LLC. Portions created by Rabbit Technologies Ltd are Copyright
25-
// (C) 2007-2009 Rabbit Technologies Ltd.
25+
// (C) 2007-2010 Rabbit Technologies Ltd.
2626
//
2727
// All Rights Reserved.
2828
//

src/com/rabbitmq/client/BasicProperties.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
1919
// Technologies LLC, and Rabbit Technologies Ltd.
2020
//
21-
// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
21+
// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
2222
// Ltd. Portions created by Cohesive Financial Technologies LLC are
23-
// Copyright (C) 2007-2009 Cohesive Financial Technologies
23+
// Copyright (C) 2007-2010 Cohesive Financial Technologies
2424
// LLC. Portions created by Rabbit Technologies Ltd are Copyright
25-
// (C) 2007-2009 Rabbit Technologies Ltd.
25+
// (C) 2007-2010 Rabbit Technologies Ltd.
2626
//
2727
// All Rights Reserved.
2828
//

src/com/rabbitmq/client/Channel.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
1919
// Technologies LLC, and Rabbit Technologies Ltd.
2020
//
21-
// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
21+
// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
2222
// Ltd. Portions created by Cohesive Financial Technologies LLC are
23-
// Copyright (C) 2007-2009 Cohesive Financial Technologies
23+
// Copyright (C) 2007-2010 Cohesive Financial Technologies
2424
// LLC. Portions created by Rabbit Technologies Ltd are Copyright
25-
// (C) 2007-2009 Rabbit Technologies Ltd.
25+
// (C) 2007-2010 Rabbit Technologies Ltd.
2626
//
2727
// All Rights Reserved.
2828
//
@@ -61,7 +61,7 @@
6161
*
6262
*/
6363

64-
public interface Channel extends ShutdownNotifier{
64+
public interface Channel extends ShutdownNotifier {
6565
/**
6666
* Retrieve this channel's channel number.
6767
* @return the channel number
@@ -77,35 +77,35 @@ public interface Channel extends ShutdownNotifier{
7777
/**
7878
* Close this channel with the {@link com.rabbitmq.client.AMQP#REPLY_SUCCESS} close code
7979
* and message 'OK'.
80-
*
80+
*
8181
* @throws java.io.IOException if an error is encountered
8282
*/
8383
void close() throws IOException;
84-
84+
8585
/**
8686
* Close this channel.
87-
*
87+
*
8888
* @param closeCode the close code (See under "Reply Codes" in the AMQP specification)
8989
* @param closeMessage a message indicating the reason for closing the connection
9090
* @throws java.io.IOException if an error is encountered
9191
*/
9292
void close(int closeCode, String closeMessage) throws IOException;
93-
93+
9494
/**
9595
* Abort this channel with the {@link com.rabbitmq.client.AMQP#REPLY_SUCCESS} close code
9696
* and message 'OK'.
97-
*
97+
*
9898
* Forces the channel to close and waits for the close operation to complete.
9999
* Any encountered exceptions in the close operation are silently discarded.
100100
*/
101101
void abort() throws IOException;
102-
102+
103103
/**
104104
* Abort this channel.
105-
*
105+
*
106106
* Forces the channel to close and waits for the close operation to complete.
107107
* Any encountered exceptions in the close operation are silently discarded.
108-
*/
108+
*/
109109
void abort(int closeCode, String closeMessage) throws IOException;
110110

111111
/**
@@ -254,7 +254,7 @@ Exchange.DeclareOk exchangeDeclare(String exchange, String type, boolean passive
254254
* @throws java.io.IOException if an error is encountered
255255
*/
256256
Queue.DeclareOk queueDeclare(String queue) throws IOException;
257-
257+
258258
/**
259259
* Actively declare a non-exclusive, non-autodelete queue
260260
* The name of the new queue is held in the "queue" field of the {@link com.rabbitmq.client.AMQP.Queue.DeclareOk} result.
@@ -329,7 +329,7 @@ Queue.DeclareOk queueDeclare(String queue, boolean passive, boolean durable, boo
329329
* @throws java.io.IOException if an error is encountered
330330
*/
331331
Queue.BindOk queueBind(String queue, String exchange, String routingKey, Map<String, Object> arguments) throws IOException;
332-
332+
333333
/**
334334
* Unbinds a queue from an exchange, with no extra arguments.
335335
* @see com.rabbitmq.client.AMQP.Queue.Unbind
@@ -370,7 +370,7 @@ Queue.DeclareOk queueDeclare(String queue, boolean passive, boolean durable, boo
370370
* @see com.rabbitmq.client.AMQP.Queue.Purge
371371
* @see com.rabbitmq.client.AMQP.Queue.PurgeOk
372372
* @param queue the name of the queue
373-
* @param nowait whether to await completion of the purge
373+
* @param nowait whether to await completion of the purge
374374
* @return a purge-confirm method if the purge was executed succesfully
375375
* @throws java.io.IOException if an error is encountered
376376
*/

src/com/rabbitmq/client/Command.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
1919
// Technologies LLC, and Rabbit Technologies Ltd.
2020
//
21-
// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
21+
// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
2222
// Ltd. Portions created by Cohesive Financial Technologies LLC are
23-
// Copyright (C) 2007-2009 Cohesive Financial Technologies
23+
// Copyright (C) 2007-2010 Cohesive Financial Technologies
2424
// LLC. Portions created by Rabbit Technologies Ltd are Copyright
25-
// (C) 2007-2009 Rabbit Technologies Ltd.
25+
// (C) 2007-2010 Rabbit Technologies Ltd.
2626
//
2727
// All Rights Reserved.
2828
//

src/com/rabbitmq/client/Connection.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
1919
// Technologies LLC, and Rabbit Technologies Ltd.
2020
//
21-
// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
21+
// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
2222
// Ltd. Portions created by Cohesive Financial Technologies LLC are
23-
// Copyright (C) 2007-2009 Cohesive Financial Technologies
23+
// Copyright (C) 2007-2010 Cohesive Financial Technologies
2424
// LLC. Portions created by Rabbit Technologies Ltd are Copyright
25-
// (C) 2007-2009 Rabbit Technologies Ltd.
25+
// (C) 2007-2010 Rabbit Technologies Ltd.
2626
//
2727
// All Rights Reserved.
2828
//

src/com/rabbitmq/client/ConnectionFactory.java

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
1919
// Technologies LLC, and Rabbit Technologies Ltd.
2020
//
21-
// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
21+
// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
2222
// Ltd. Portions created by Cohesive Financial Technologies LLC are
23-
// Copyright (C) 2007-2009 Cohesive Financial Technologies
23+
// Copyright (C) 2007-2010 Cohesive Financial Technologies
2424
// LLC. Portions created by Rabbit Technologies Ltd are Copyright
25-
// (C) 2007-2009 Rabbit Technologies Ltd.
25+
// (C) 2007-2010 Rabbit Technologies Ltd.
2626
//
2727
// All Rights Reserved.
2828
//
@@ -36,6 +36,9 @@
3636
import java.util.HashMap;
3737
import java.util.Map;
3838

39+
import java.net.Socket;
40+
import java.net.InetSocketAddress;
41+
3942
import javax.net.SocketFactory;
4043
import javax.net.ssl.SSLSocketFactory;
4144
import javax.net.ssl.SSLContext;
@@ -305,7 +308,26 @@ protected FrameHandler createFrameHandler(Address addr)
305308

306309
String hostName = addr.getHost();
307310
int portNumber = portOrDefault(addr.getPort());
308-
return new SocketFrameHandler(factory, hostName, portNumber);
311+
Socket socket = factory.createSocket();
312+
configureSocket(socket);
313+
socket.connect(new InetSocketAddress(hostName, portNumber));
314+
return new SocketFrameHandler(socket);
315+
}
316+
317+
/**
318+
* Provides a hook to insert custom configuration of the sockets used
319+
* to connect to an AMQP server before they connect.
320+
*
321+
* The default behaviour of this method is to disable Nagle's algorithm to get
322+
* more consistently low latency.
323+
* However it may be overridden freely and there is no requirement to retain
324+
* this behaviour.
325+
*
326+
* @param socket The socket that is to be used for the Connection
327+
*/
328+
protected void configureSocket(Socket socket) throws IOException{
329+
// disable Nagle's algorithm, for more consistently low latency
330+
socket.setTcpNoDelay(true);
309331
}
310332

311333
private Connection newConnection(Address[] addresses,

src/com/rabbitmq/client/Consumer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
1919
// Technologies LLC, and Rabbit Technologies Ltd.
2020
//
21-
// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
21+
// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift
2222
// Ltd. Portions created by Cohesive Financial Technologies LLC are
23-
// Copyright (C) 2007-2009 Cohesive Financial Technologies
23+
// Copyright (C) 2007-2010 Cohesive Financial Technologies
2424
// LLC. Portions created by Rabbit Technologies Ltd are Copyright
25-
// (C) 2007-2009 Rabbit Technologies Ltd.
25+
// (C) 2007-2010 Rabbit Technologies Ltd.
2626
//
2727
// All Rights Reserved.
2828
//

0 commit comments

Comments
 (0)