diff options
| author | Robert Gemmell <robbie@apache.org> | 2013-03-31 21:46:12 +0000 |
|---|---|---|
| committer | Robert Gemmell <robbie@apache.org> | 2013-03-31 21:46:12 +0000 |
| commit | 05edb8356e4043c779e578ea857d0d4b4c07c549 (patch) | |
| tree | f2c722a93c3f203351f2b4c196705617012b6fc7 /qpid/java/broker/src/main | |
| parent | 32a75682236f06ad5bf4c9b2fb5a1980b882ca67 (diff) | |
| download | qpid-python-05edb8356e4043c779e578ea857d0d4b4c07c549.tar.gz | |
QPID-4594, QPID-4682: changes from review of new 'management mode' functionality
- Tweak the command line options for the management mode ports to group the options and make it clear they are only for management mode, and remove a naming clash with old options that had different behaviour.
- Make the virtualhosts load during management mode, enabling them to normally be managed as well.
- Add a new command line option to quiesce the virtualhosts during mangement mode if required.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1463061 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker/src/main')
3 files changed, 32 insertions, 13 deletions
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/BrokerOptions.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/BrokerOptions.java index 289cfebc29..8384af915f 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/BrokerOptions.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/BrokerOptions.java @@ -43,6 +43,7 @@ public class BrokerOptions private String _initialConfigurationLocation; private boolean _managementMode; + private boolean _managementModeQuiesceVhosts; private int _managementModeRmiPort; private int _managementModeConnectorPort; private int _managementModeHttpPort; @@ -83,6 +84,16 @@ public class BrokerOptions _managementMode = managementMode; } + public boolean isManagementModeQuiesceVirtualHosts() + { + return _managementModeQuiesceVhosts; + } + + public void setManagementModeQuiesceVirtualHosts(boolean managementModeQuiesceVhosts) + { + _managementModeQuiesceVhosts = managementModeQuiesceVhosts; + } + public int getManagementModeRmiPort() { return _managementModeRmiPort; diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java index ddda137bcc..f4757cad21 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java @@ -64,12 +64,14 @@ public class Main private static final Option OPTION_MANAGEMENT_MODE = OptionBuilder.withDescription("start broker in a management mode") .withLongOpt("management-mode").create("mm"); - private static final Option OPTION_RMI_PORT = OptionBuilder.withArgName("port").hasArg() - .withDescription("override jmx rmi port in management mode").withLongOpt("jmxregistryport").create("rmi"); - private static final Option OPTION_CONNECTOR_PORT = OptionBuilder.withArgName("port").hasArg() - .withDescription("override jmx connector port in management mode").withLongOpt("jmxconnectorport").create("jmxrmi"); - private static final Option OPTION_HTTP_PORT = OptionBuilder.withArgName("port").hasArg() - .withDescription("override web management port in management mode").withLongOpt("httpport").create("http"); + private static final Option OPTION_MM_QUIESCE_VHOST = OptionBuilder.withDescription("make virtualhosts stay in the quiesced state during management mode.") + .withLongOpt("management-mode-quiesce-virtualhosts").create("mmqv"); + private static final Option OPTION_MM_RMI_PORT = OptionBuilder.withArgName("port").hasArg() + .withDescription("override jmx rmi registry port in management mode").withLongOpt("management-mode-rmi-registry-port").create("mmrmi"); + private static final Option OPTION_MM_CONNECTOR_PORT = OptionBuilder.withArgName("port").hasArg() + .withDescription("override jmx connector port in management mode").withLongOpt("management-mode-jmx-connector-port").create("mmjmx"); + private static final Option OPTION_MM_HTTP_PORT = OptionBuilder.withArgName("port").hasArg() + .withDescription("override http management port in management mode").withLongOpt("management-mode-http-port").create("mmhttp"); private static final Options OPTIONS = new Options(); @@ -83,9 +85,10 @@ public class Main OPTIONS.addOption(OPTION_LOG_WATCH); OPTIONS.addOption(OPTION_INITIAL_CONFIGURATION_PATH); OPTIONS.addOption(OPTION_MANAGEMENT_MODE); - OPTIONS.addOption(OPTION_RMI_PORT); - OPTIONS.addOption(OPTION_CONNECTOR_PORT); - OPTIONS.addOption(OPTION_HTTP_PORT); + OPTIONS.addOption(OPTION_MM_QUIESCE_VHOST); + OPTIONS.addOption(OPTION_MM_RMI_PORT); + OPTIONS.addOption(OPTION_MM_CONNECTOR_PORT); + OPTIONS.addOption(OPTION_MM_HTTP_PORT); } protected CommandLine _commandLine; @@ -200,21 +203,26 @@ public class Main if (managmentMode) { options.setManagementMode(true); - String rmiPort = _commandLine.getOptionValue(OPTION_RMI_PORT.getOpt()); + String rmiPort = _commandLine.getOptionValue(OPTION_MM_RMI_PORT.getOpt()); if (rmiPort != null) { options.setManagementModeRmiPort(Integer.parseInt(rmiPort)); } - String connectorPort = _commandLine.getOptionValue(OPTION_CONNECTOR_PORT.getOpt()); + String connectorPort = _commandLine.getOptionValue(OPTION_MM_CONNECTOR_PORT.getOpt()); if (connectorPort != null) { options.setManagementModeConnectorPort(Integer.parseInt(connectorPort)); } - String httpPort = _commandLine.getOptionValue(OPTION_HTTP_PORT.getOpt()); + String httpPort = _commandLine.getOptionValue(OPTION_MM_HTTP_PORT.getOpt()); if (httpPort != null) { options.setManagementModeHttpPort(Integer.parseInt(httpPort)); } + boolean quiesceVhosts = _commandLine.hasOption(OPTION_MM_QUIESCE_VHOST.getOpt()); + if (quiesceVhosts) + { + options.setManagementModeQuiesceVirtualHosts(true); + } } setExceptionHandler(); diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandler.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandler.java index 385d2f7327..6733c8ee2d 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandler.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandler.java @@ -244,7 +244,7 @@ public class ManagementModeStoreHandler implements ConfigurationEntryStore String entryType = entry.getType(); Map<String, Object> attributes = entry.getAttributes(); boolean quiesce = false; - if (VIRTUAL_HOST_TYPE.equals(entryType)) + if (VIRTUAL_HOST_TYPE.equals(entryType) && options.isManagementModeQuiesceVirtualHosts()) { quiesce = true; } |
