This repository has been archived by the owner on Aug 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return the status of a system command using the JMX command client
- Loading branch information
amckenzie
committed
Oct 9, 2019
1 parent
fa878f1
commit 47d37bd
Showing
43 changed files
with
740 additions
and
330 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
8 changes: 8 additions & 0 deletions
8
...ain/java/uk/gov/justice/services/management/shuttering/api/ShutteringFailedException.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,8 @@ | ||
package uk.gov.justice.services.management.shuttering.api; | ||
|
||
public class ShutteringFailedException extends Exception { | ||
|
||
public ShutteringFailedException(final String message) { | ||
super(message); | ||
} | ||
} |
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
4 changes: 0 additions & 4 deletions
4
...java/uk/gov/justice/services/management/shuttering/process/ShutteringExecutorsRunner.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
44 changes: 44 additions & 0 deletions
44
...n/java/uk/gov/justice/services/management/shuttering/process/ShutteringFailedHandler.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,44 @@ | ||
package uk.gov.justice.services.management.shuttering.process; | ||
|
||
import static java.lang.String.format; | ||
import static uk.gov.justice.services.management.shuttering.api.ShutteringResult.shutteringFailed; | ||
|
||
import uk.gov.justice.services.jmx.api.command.SystemCommand; | ||
import uk.gov.justice.services.management.shuttering.api.ShutteringExecutor; | ||
import uk.gov.justice.services.management.shuttering.api.ShutteringResult; | ||
|
||
import java.util.UUID; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.slf4j.Logger; | ||
|
||
public class ShutteringFailedHandler { | ||
|
||
@Inject | ||
private Logger logger; | ||
|
||
public ShutteringResult onShutteringFailed( | ||
final UUID commandId, | ||
final SystemCommand systemCommand, | ||
final ShutteringExecutor shutteringExecutor, | ||
final Throwable exception) { | ||
|
||
final String message = format( | ||
"%s failed for %s. %s: %s", | ||
systemCommand.getName(), | ||
shutteringExecutor.getName(), | ||
exception.getClass().getName(), | ||
exception.getMessage()); | ||
|
||
logger.error(message, exception); | ||
|
||
return shutteringFailed( | ||
shutteringExecutor.getName(), | ||
commandId, | ||
message, | ||
systemCommand, | ||
exception | ||
); | ||
} | ||
} |
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
Oops, something went wrong.