@@ -242,7 +242,7 @@ public void releaseChannelNumber() {
242242 if (method instanceof Basic .Deliver ) {
243243 Basic .Deliver m = (Basic .Deliver ) method ;
244244
245- Consumer callback = _consumers .get (m .consumerTag );
245+ Consumer callback = _consumers .get (m .getConsumerTag () );
246246 if (callback == null ) {
247247 if (defaultConsumer == null ) {
248248 // No handler set. We should blow up as this message
@@ -257,20 +257,20 @@ public void releaseChannelNumber() {
257257 }
258258 }
259259
260- Envelope envelope = new Envelope (m .deliveryTag ,
261- m .redelivered ,
262- m .exchange ,
263- m .routingKey );
260+ Envelope envelope = new Envelope (m .getDeliveryTag () ,
261+ m .getRedelivered () ,
262+ m .getExchange () ,
263+ m .getRoutingKey () );
264264 try {
265- callback .handleDelivery (m .consumerTag ,
265+ callback .handleDelivery (m .getConsumerTag () ,
266266 envelope ,
267267 (BasicProperties ) command .getContentHeader (),
268268 command .getContentBody ());
269269 } catch (Throwable ex ) {
270270 _connection .getExceptionHandler ().handleConsumerException (this ,
271271 ex ,
272272 callback ,
273- m .consumerTag ,
273+ m .getConsumerTag () ,
274274 "handleDelivery" );
275275 }
276276 return true ;
@@ -279,10 +279,10 @@ public void releaseChannelNumber() {
279279 if (l != null ) {
280280 Basic .Return basicReturn = (Basic .Return ) method ;
281281 try {
282- l .handleReturn (basicReturn .replyCode ,
283- basicReturn .replyText ,
284- basicReturn .exchange ,
285- basicReturn .routingKey ,
282+ l .handleReturn (basicReturn .getReplyCode () ,
283+ basicReturn .getReplyText () ,
284+ basicReturn .getExchange () ,
285+ basicReturn .getRoutingKey () ,
286286 (BasicProperties )
287287 command .getContentHeader (),
288288 command .getContentBody ());
@@ -295,14 +295,14 @@ public void releaseChannelNumber() {
295295 } else if (method instanceof Channel .Flow ) {
296296 Channel .Flow channelFlow = (Channel .Flow ) method ;
297297 synchronized (_channelMutex ) {
298- _blockContent = !channelFlow .active ;
299- transmit (new Channel .FlowOk (channelFlow . active ));
298+ _blockContent = !channelFlow .getActive () ;
299+ transmit (new Channel .FlowOk (! _blockContent ));
300300 _channelMutex .notifyAll ();
301301 }
302302 FlowListener l = getFlowListener ();
303303 if (l != null ) {
304304 try {
305- l .handleFlow (channelFlow .active );
305+ l .handleFlow (channelFlow .getActive () );
306306 } catch (Throwable ex ) {
307307 _connection .getExceptionHandler ().handleFlowListenerException (this , ex );
308308 }
@@ -711,13 +711,13 @@ public GetResponse basicGet(String queue, boolean autoAck)
711711
712712 if (method instanceof Basic .GetOk ) {
713713 Basic .GetOk getOk = (Basic .GetOk )method ;
714- Envelope envelope = new Envelope (getOk .deliveryTag ,
715- getOk .redelivered ,
716- getOk .exchange ,
717- getOk .routingKey );
714+ Envelope envelope = new Envelope (getOk .getDeliveryTag () ,
715+ getOk .getRedelivered () ,
716+ getOk .getExchange () ,
717+ getOk .getRoutingKey () );
718718 BasicProperties props = (BasicProperties )replyCommand .getContentHeader ();
719719 byte [] body = replyCommand .getContentBody ();
720- int messageCount = getOk .messageCount ;
720+ int messageCount = getOk .getMessageCount () ;
721721 return new GetResponse (envelope , props , body , messageCount );
722722 } else if (method instanceof Basic .GetEmpty ) {
723723 return null ;
@@ -777,7 +777,7 @@ public String basicConsume(String queue, boolean autoAck, String consumerTag,
777777 {
778778 BlockingRpcContinuation <String > k = new BlockingRpcContinuation <String >() {
779779 public String transformReply (AMQCommand replyCommand ) {
780- String actualConsumerTag = ((Basic .ConsumeOk ) replyCommand .getMethod ()).consumerTag ;
780+ String actualConsumerTag = ((Basic .ConsumeOk ) replyCommand .getMethod ()).getConsumerTag () ;
781781 _consumers .put (actualConsumerTag , callback );
782782 // We need to call back inside the connection thread
783783 // in order avoid races with 'deliver' commands
@@ -896,7 +896,7 @@ public Confirm.SelectOk confirmSelect()
896896
897897 /** Public API - {@inheritDoc} */
898898 public Channel .FlowOk flow (final boolean a ) throws IOException {
899- return (Channel .FlowOk ) exnWrappingRpc (new Channel .Flow () {{ active = a ;}} ).getMethod ();
899+ return (Channel .FlowOk ) exnWrappingRpc (new Channel .Flow (a ) ).getMethod ();
900900 }
901901
902902 /** Public API - {@inheritDoc} */
@@ -908,5 +908,14 @@ public Channel.FlowOk getFlow() {
908908 public long getNextPublishSeqNo () {
909909 return nextPublishSeqNo ;
910910 }
911-
911+
912+ public void asyncRpc (com .rabbitmq .client .Method method ) throws IOException {
913+ // This cast should eventually go
914+ transmit ((com .rabbitmq .client .impl .Method )method );
915+ }
916+
917+ public com .rabbitmq .client .Method rpc (com .rabbitmq .client .Method method ) throws IOException {
918+ return exnWrappingRpc ((com .rabbitmq .client .impl .Method )method ).getMethod ();
919+ }
920+
912921}
0 commit comments