コード例 #1
0
  private void resetLargeMessageController() {

    LargeMessageController controller = currentLargeMessageController;
    if (controller != null) {
      controller.cancel();
      currentLargeMessageController = null;
    }
  }
コード例 #2
0
 @Override
 public boolean waitOutputStreamCompletion(final long timeMilliseconds) throws ActiveMQException {
   if (bodyBuffer != null) {
     return super.waitOutputStreamCompletion(timeMilliseconds);
   } else {
     return largeMessageController.waitCompletion(timeMilliseconds);
   }
 }
コード例 #3
0
 @Override
 public void discardBody() {
   if (bodyBuffer != null) {
     super.discardBody();
   } else {
     largeMessageController.discardUnusedPackets();
   }
 }
コード例 #4
0
 @Override
 public void saveToOutputStream(final OutputStream out) throws ActiveMQException {
   if (bodyBuffer != null) {
     // The body was rebuilt on the client, so we need to behave as a regular message on this case
     super.saveToOutputStream(out);
   } else {
     largeMessageController.saveBuffer(out);
   }
 }
コード例 #5
0
  @Override
  public ClientLargeMessageImpl setOutputStream(final OutputStream out) throws ActiveMQException {
    if (bodyBuffer != null) {
      super.setOutputStream(out);
    } else {
      largeMessageController.setOutputStream(out);
    }

    return this;
  }
コード例 #6
0
  private void checkBuffer() throws ActiveMQException {
    if (bodyBuffer == null) {

      long bodySize = this.largeMessageSize + BODY_OFFSET;
      if (bodySize > Integer.MAX_VALUE) {
        bodySize = Integer.MAX_VALUE;
      }
      createBody((int) bodySize);

      bodyBuffer = new ResetLimitWrappedActiveMQBuffer(BODY_OFFSET, buffer, this);

      largeMessageController.saveBuffer(new ActiveMQOutputStream(bodyBuffer));
    }
  }
コード例 #7
0
 /** @param timeWait Milliseconds to Wait. 0 means forever */
 public synchronized boolean waitCompletion(final long timeWait) throws HornetQException {
   return bufferDelegate.waitCompletion(timeWait);
 }
コード例 #8
0
 public void setOutputStream(final OutputStream output) throws HornetQException {
   bufferDelegate.setOutputStream(new InflaterWriter(output));
 }
コード例 #9
0
 public synchronized void close() {
   bufferDelegate.cancel();
 }
コード例 #10
0
 /** Add a buff to the List, or save it to the OutputStream if set */
 public void addPacket(byte[] chunk, int flowControlSize, boolean isContinues) {
   bufferDelegate.addPacket(chunk, flowControlSize, isContinues);
 }
コード例 #11
0
 public void discardUnusedPackets() {
   bufferDelegate.discardUnusedPackets();
 }