Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3109 from bstansberry/WFCORE-3597
[WFCORE-3597] Allow reload handler to signal when to send the early r…
- Loading branch information
Showing
17 changed files
with
306 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
controller/src/main/java/org/jboss/as/controller/remote/EarlyResponseSendListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
Copyright 2018 Red Hat, Inc. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package org.jboss.as.controller.remote; | ||
|
||
import org.jboss.as.controller.OperationContext; | ||
|
||
/** | ||
* Callback that can be provided to operation step handlers for operations like 'reload' and 'shutdown' | ||
* where the response needs to be sent to the caller before the operation completes. The handler will | ||
* invoke the callback when the operation has reached the point where it is safe to send the response. | ||
* <p> | ||
* No callback should be attached before the operation is committed. | ||
* | ||
* @author Brian Stansberry | ||
*/ | ||
public interface EarlyResponseSendListener { | ||
/** | ||
* Key under which a listener would be | ||
* {@link OperationContext#attach(OperationContext.AttachmentKey, Object) attached to an operation context} | ||
* if notification that it's safe | ||
*/ | ||
OperationContext.AttachmentKey<EarlyResponseSendListener> ATTACHMENT_KEY = OperationContext.AttachmentKey.create(EarlyResponseSendListener.class); | ||
|
||
/** | ||
* Informs the management kernel that it is ok to send an early response to the operation. | ||
* <strong>Note:</strong> It is valid for this method to be invoked multiple times for the same | ||
* listener. It is the responsibility of the listener implementation to ensure that only one | ||
* response is sent to the caller. | ||
* | ||
* @param resultAction the result of the operation for which an early response is being sent | ||
*/ | ||
void sendEarlyResponse(OperationContext.ResultAction resultAction); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.