Author: rgodfrey
Date: Wed Nov 21 16:58:05 2012
New Revision: 1412192
URL: http://svn.apache.org/viewvc?rev=1412192&view=rev
Log:
PROTON-153 : Throw IllegalStateException when trying to send on a closed link
Modified:
qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SenderImpl.java
Modified:
qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SenderImpl.java
URL:
http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SenderImpl.java?rev=1412192&r1=1412191&r2=1412192&view=diff
==============================================================================
---
qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SenderImpl.java
(original)
+++
qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SenderImpl.java
Wed Nov 21 16:58:05 2012
@@ -21,6 +21,7 @@
package org.apache.qpid.proton.engine.impl;
import org.apache.qpid.proton.engine.Delivery;
+import org.apache.qpid.proton.engine.EndpointState;
import org.apache.qpid.proton.engine.Sender;
import org.apache.qpid.proton.engine.Sequence;
@@ -42,6 +43,10 @@ public class SenderImpl extends LinkImp
public int send(final byte[] bytes, int offset, int length)
{
+ if( getLocalState() == EndpointState.CLOSED )
+ {
+ throw new IllegalStateException("send not allowed after the sender
is closed.");
+ }
DeliveryImpl current = current();
if(current == null || current.getLink() != this)
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]