Skip to content

Commit

Permalink
Release MessageBodyWorkers when Response gets closed.
Browse files Browse the repository at this point in the history
Signed-off-by: jansupol <[email protected]>
  • Loading branch information
jansupol committed Apr 13, 2022
1 parent 8f7fa99 commit 3619316
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -754,6 +754,9 @@ public Link.Builder getLinkBuilder(String relation) {
* @return context message body workers.
*/
public MessageBodyWorkers getWorkers() {
if (workers == null) {
throw new ProcessingException(LocalizationMessages.RESPONSE_CLOSED());
}
return workers;
}

Expand Down Expand Up @@ -948,6 +951,7 @@ public boolean bufferEntity() throws ProcessingException {
*/
public void close() {
entityContent.close(true);
setWorkers(null);
}

/**
Expand Down

0 comments on commit 3619316

Please sign in to comment.