Package org.jboss.as.test.shared
Class ServerReload
java.lang.Object
org.jboss.as.test.shared.ServerReload
Utilities for correctly reloading a server process.
- Author:
- Stuart Douglas
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault time in ms to wait for a server process to return to started state following a reload -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidexecuteReloadAndWaitForCompletion(org.jboss.as.arquillian.container.ManagementClient managementClient) Reload the server and wait for it to reach running state.static voidexecuteReloadAndWaitForCompletion(org.jboss.as.arquillian.container.ManagementClient managementClient, boolean adminOnly) Reload the server and wait for it to reach running state, optionally reloading into admin-only mode.static voidexecuteReloadAndWaitForCompletion(org.jboss.as.arquillian.container.ManagementClient managementClient, int timeout) Reload the server and wait for it to reach running state.static voidexecuteReloadAndWaitForCompletion(org.jboss.as.arquillian.container.ManagementClient managementClient, String serverConfig) Reload the server and wait for it to reach running state, instructing the server to use the configuration file with the given name once it reloads.static voidexecuteReloadAndWaitForCompletion(org.jboss.as.controller.client.ModelControllerClient client) Deprecated.static voidexecuteReloadAndWaitForCompletion(org.jboss.as.controller.client.ModelControllerClient client, boolean adminOnly) Deprecated.Use {@link #executeReloadAndWaitForCompletion(ManagementClient boolean)} which will allow completion waiting to check on the correct address for reload completion if the server is not using the default management address or portstatic voidexecuteReloadAndWaitForCompletion(org.jboss.as.controller.client.ModelControllerClient client, int timeout) Deprecated.Use {@link #executeReloadAndWaitForCompletion(ManagementClient int)} which will allow completion waiting to check on the correct address for reload completion if the server is not using the default management address or portstatic voidexecuteReloadAndWaitForCompletion(org.jboss.as.controller.client.ModelControllerClient client, int timeout, boolean adminOnly, boolean startSuspended, String serverAddress, int serverPort, String serverConfig) static voidexecuteReloadAndWaitForCompletion(org.jboss.as.controller.client.ModelControllerClient client, int timeout, boolean adminOnly, String serverAddress, int serverPort) static voidexecuteReloadAndWaitForCompletion(org.jboss.as.controller.client.ModelControllerClient client, int timeout, boolean adminOnly, String serverAddress, int serverPort, String serverConfig) static voidexecuteReloadAndWaitForCompletion(org.jboss.as.controller.client.ModelControllerClient client, String serverConfig) Deprecated.UseexecuteReloadAndWaitForCompletion(ManagementClient String)which will allow completion waiting to check on the correct address for reload completion if the server is not using the default management address or portstatic StringgetContainerRunningState(org.jboss.as.arquillian.container.ManagementClient managementClient) Gets the current value of the server root resource'sserver-stateattribute.static StringgetContainerRunningState(org.jboss.as.controller.client.ModelControllerClient modelControllerClient) Gets the current value of the server root resource'sserver-stateattribute.static voidreloadIfRequired(org.jboss.as.arquillian.container.ManagementClient managementClient) Check if the server is in reload-required state and if it is, executeexecuteReloadAndWaitForCompletion(ManagementClient).static voidreloadIfRequired(org.jboss.as.controller.client.ModelControllerClient controllerClient) Deprecated.UsereloadIfRequired(ManagementClient)which will allow completion waiting to check on the correct address for reload completion if the server is not using the default management address or port
-
Field Details
-
TIMEOUT
public static final int TIMEOUTDefault time in ms to wait for a server process to return to started state following a reload- See Also:
-
-
Constructor Details
-
ServerReload
public ServerReload()
-
-
Method Details
-
executeReloadAndWaitForCompletion
@Deprecated public static void executeReloadAndWaitForCompletion(org.jboss.as.controller.client.ModelControllerClient client) Deprecated.UseexecuteReloadAndWaitForCompletion(ManagementClient)which will allow completion waiting to check on the correct address for reload completion if the server is not using the default management address or port -
executeReloadAndWaitForCompletion
@Deprecated public static void executeReloadAndWaitForCompletion(org.jboss.as.controller.client.ModelControllerClient client, String serverConfig) Deprecated.UseexecuteReloadAndWaitForCompletion(ManagementClient String)which will allow completion waiting to check on the correct address for reload completion if the server is not using the default management address or port -
executeReloadAndWaitForCompletion
@Deprecated public static void executeReloadAndWaitForCompletion(org.jboss.as.controller.client.ModelControllerClient client, boolean adminOnly) Deprecated.Use {@link #executeReloadAndWaitForCompletion(ManagementClient boolean)} which will allow completion waiting to check on the correct address for reload completion if the server is not using the default management address or port -
executeReloadAndWaitForCompletion
@Deprecated public static void executeReloadAndWaitForCompletion(org.jboss.as.controller.client.ModelControllerClient client, int timeout) Deprecated.Use {@link #executeReloadAndWaitForCompletion(ManagementClient int)} which will allow completion waiting to check on the correct address for reload completion if the server is not using the default management address or port -
executeReloadAndWaitForCompletion
public static void executeReloadAndWaitForCompletion(org.jboss.as.arquillian.container.ManagementClient managementClient) Reload the server and wait for it to reach running state. Reloaded server will not be in admin-only mode.- Parameters:
managementClient- client to use to execute the reload and to provide host and port information for reconnecting to wait for completion of the reload
-
executeReloadAndWaitForCompletion
public static void executeReloadAndWaitForCompletion(org.jboss.as.arquillian.container.ManagementClient managementClient, String serverConfig) Reload the server and wait for it to reach running state, instructing the server to use the configuration file with the given name once it reloads. Reloaded server will not be in admin-only mode.- Parameters:
managementClient- client to use to execute the reload and to provide host and port information for * reconnecting to wait for completion of the reloadserverConfig- the configuration file the server should use following reload. May benullin which case the server will use the same configuration file it used before the reload.
-
executeReloadAndWaitForCompletion
public static void executeReloadAndWaitForCompletion(org.jboss.as.arquillian.container.ManagementClient managementClient, boolean adminOnly) Reload the server and wait for it to reach running state, optionally reloading into admin-only mode.- Parameters:
managementClient- client to use to execute the reload and to provide host and port information for reconnecting to wait for completion of the reloadadminOnly- true if the server should be in admin-only mode following the reload
-
executeReloadAndWaitForCompletion
public static void executeReloadAndWaitForCompletion(org.jboss.as.arquillian.container.ManagementClient managementClient, int timeout) Reload the server and wait for it to reach running state. Reloaded server will not be in admin-only mode.- Parameters:
managementClient- client to use to execute the reload and to provide host and port information for * reconnecting to wait for completion of the reloadtimeout- time in ms to wait for a server process to return to running state following the reload
-
executeReloadAndWaitForCompletion
public static void executeReloadAndWaitForCompletion(org.jboss.as.controller.client.ModelControllerClient client, int timeout, boolean adminOnly, String serverAddress, int serverPort) - Parameters:
client- client to use to instruct the server to reloadtimeout- time in ms to wait for a server process to return to running state following the reloadadminOnly- iftrue, the server will be reloaded in admin-only modeserverAddress- ifnull, useTestSuiteEnvironment.getServerAddress()to create the ModelControllerClientserverPort- if-1, useTestSuiteEnvironment.getServerPort()to create the ModelControllerClient
-
executeReloadAndWaitForCompletion
public static void executeReloadAndWaitForCompletion(org.jboss.as.controller.client.ModelControllerClient client, int timeout, boolean adminOnly, String serverAddress, int serverPort, String serverConfig) - Parameters:
client- client to use to instruct the server to reloadtimeout- time in ms to wait for a server process to return to running state following the reloadadminOnly- iftrue, the server will be reloaded in admin-only modeserverAddress- ifnull, useTestSuiteEnvironment.getServerAddress()to create the ModelControllerClientserverPort- if-1, useTestSuiteEnvironment.getServerPort()to create the ModelControllerClient
-
executeReloadAndWaitForCompletion
public static void executeReloadAndWaitForCompletion(org.jboss.as.controller.client.ModelControllerClient client, int timeout, boolean adminOnly, boolean startSuspended, String serverAddress, int serverPort, String serverConfig) - Parameters:
client- client to use to instruct the server to reloadtimeout- time in ms to wait for a server process to return to running state following the reloadadminOnly- iftrue, the server will be reloaded in admin-only modestartSuspended- iftrue, the service will be reloaded in suspended stateserverAddress- ifnull, useTestSuiteEnvironment.getServerAddress()to create the ModelControllerClientserverPort- if-1, useTestSuiteEnvironment.getServerPort()to create the ModelControllerClient
-
getContainerRunningState
public static String getContainerRunningState(org.jboss.as.arquillian.container.ManagementClient managementClient) throws IOException Gets the current value of the server root resource'sserver-stateattribute.- Parameters:
managementClient- client to use to read the state- Returns:
- the server state. Will not be
null. - Throws:
IOException- if there is an IO problem reading the state
-
getContainerRunningState
public static String getContainerRunningState(org.jboss.as.controller.client.ModelControllerClient modelControllerClient) throws IOException Gets the current value of the server root resource'sserver-stateattribute.- Parameters:
modelControllerClient- client to use to read the state- Returns:
- the server state. Will not be
null. - Throws:
IOException- if there is an IO problem reading the state
-
reloadIfRequired
@Deprecated public static void reloadIfRequired(org.jboss.as.controller.client.ModelControllerClient controllerClient) throws Exception Deprecated.UsereloadIfRequired(ManagementClient)which will allow completion waiting to check on the correct address for reload completion if the server is not using the default management address or portChecks if the container status is "reload-required" and if it's the case executes reload and waits for completion. Otherwise- Throws:
Exception
-
reloadIfRequired
public static void reloadIfRequired(org.jboss.as.arquillian.container.ManagementClient managementClient) throws Exception Check if the server is in reload-required state and if it is, executeexecuteReloadAndWaitForCompletion(ManagementClient).- Parameters:
managementClient- client to use to execute the reload and to provide host and port information for * reconnecting to wait for completion of the reload- Throws:
Exception- if a failure occurs when checking if reload is required.
-
executeReloadAndWaitForCompletion(ManagementClient)which will allow completion waiting to check on the correct address for reload completion if the server is not using the default management address or port