ARTEMIS-3822 get broker name via management
This commit is contained in:
parent
41d5ba7664
commit
466597e83b
|
@ -32,6 +32,12 @@ public interface ActiveMQServerControl {
|
|||
String ADDRESS_MEMORY_USAGE_PERCENTAGE_DESCRIPTION = "Memory used by all the addresses on broker as a percentage of the global-max-size";
|
||||
String DISK_STORE_USAGE_DESCRIPTION = "Fraction of total disk store used";
|
||||
|
||||
/**
|
||||
* Returns this server's name.
|
||||
*/
|
||||
@Attribute(desc = "Server's name")
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Returns this server's version.
|
||||
*/
|
||||
|
|
|
@ -204,6 +204,21 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
if (AuditLogger.isBaseLoggingEnabled()) {
|
||||
AuditLogger.getName(this.server);
|
||||
}
|
||||
checkStarted();
|
||||
|
||||
clearIO();
|
||||
try {
|
||||
return server.getConfiguration().getName();
|
||||
} finally {
|
||||
blockOnIO();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
if (AuditLogger.isBaseLoggingEnabled()) {
|
||||
|
|
|
@ -161,6 +161,8 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
|
|||
public void testGetAttributes() throws Exception {
|
||||
ActiveMQServerControl serverControl = createManagementControl();
|
||||
|
||||
Assert.assertEquals(server.getConfiguration().getName(), serverControl.getName());
|
||||
|
||||
Assert.assertEquals(server.getVersion().getFullVersion(), serverControl.getVersion());
|
||||
|
||||
Assert.assertEquals(conf.isClustered(), serverControl.isClustered());
|
||||
|
|
|
@ -587,6 +587,11 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
|
|||
return (Long) proxy.retrieveAttributeValue("transactionTimeoutScanPeriod", Long.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return (String) proxy.retrieveAttributeValue("name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return proxy.retrieveAttributeValue("version").toString();
|
||||
|
|
Loading…
Reference in New Issue