ARTEMIS-357 No need to check copy any longer
This commit is contained in:
parent
4a33d2d489
commit
7957f574f6
|
@ -84,8 +84,6 @@ public abstract class MessageImpl implements MessageInternal {
|
|||
|
||||
private int endOfMessagePosition;
|
||||
|
||||
private boolean copied = true;
|
||||
|
||||
private UUID userID;
|
||||
|
||||
// Constructors --------------------------------------------------
|
||||
|
@ -152,7 +150,6 @@ public abstract class MessageImpl implements MessageInternal {
|
|||
bufferValid = other.bufferValid;
|
||||
endOfBodyPosition = other.endOfBodyPosition;
|
||||
endOfMessagePosition = other.endOfMessagePosition;
|
||||
copied = other.copied;
|
||||
|
||||
if (other.buffer != null) {
|
||||
// We need to copy the underlying buffer too, since the different messsages thereafter might have different
|
||||
|
@ -438,29 +435,11 @@ public abstract class MessageImpl implements MessageInternal {
|
|||
|
||||
@Override
|
||||
public void bodyChanged() {
|
||||
// If the body is changed we must copy the buffer otherwise can affect the previously sent message
|
||||
// which might be in the Netty write queue
|
||||
checkCopy();
|
||||
|
||||
bufferValid = false;
|
||||
|
||||
endOfBodyPosition = -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void checkCopy() {
|
||||
if (!copied) {
|
||||
forceCopy();
|
||||
|
||||
copied = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void resetCopied() {
|
||||
copied = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEndOfMessagePosition() {
|
||||
return endOfMessagePosition;
|
||||
|
|
|
@ -33,12 +33,8 @@ public interface MessageInternal extends Message {
|
|||
|
||||
int getEndOfBodyPosition();
|
||||
|
||||
void checkCopy();
|
||||
|
||||
void bodyChanged();
|
||||
|
||||
void resetCopied();
|
||||
|
||||
boolean isServerMessage();
|
||||
|
||||
ActiveMQBuffer getEncodedBuffer();
|
||||
|
|
|
@ -93,8 +93,6 @@ public class SessionSendMessage extends MessagePacket {
|
|||
// Position reader for reading by Netty
|
||||
bufferWrite.readerIndex(0);
|
||||
|
||||
message.resetCopied();
|
||||
|
||||
return bufferWrite;
|
||||
}
|
||||
|
||||
|
|
|
@ -429,21 +429,11 @@ public class ScheduledDeliveryHandlerTest extends Assert {
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkCopy() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bodyChanged() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetCopied() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isServerMessage() {
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue