Skip to content

Commit

Permalink
add jmxTreeUpdated events so that the application and connectors view…
Browse files Browse the repository at this point in the history
…s update automatically when a web app / connector starts/stops (e.g. if you drop a war into the webapps dir)
  • Loading branch information
jstrachan committed Apr 18, 2013
1 parent 3db1e93 commit 28058da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
13 changes: 8 additions & 5 deletions hawtio-web/src/main/webapp/app/tomcat/js/connectors.ts
Expand Up @@ -156,11 +156,14 @@ module Tomcat {
loadData();
};

$scope.$watch('workspace.tree', function () {
// if the JMX tree is reloaded its probably because a new MBean has been added or removed
// so lets reload, asynchronously just in case
setTimeout(loadData, 50);
});
$scope.$on('jmxTreeUpdated', reloadFunction);
$scope.$watch('workspace.tree', reloadFunction);

function reloadFunction() {
// if the JMX tree is reloaded its probably because a new MBean has been added or removed
// so lets reload, asynchronously just in case
setTimeout(loadData, 50);
}

function loadData() {
console.log("Loading tomcat connector data...");
Expand Down
13 changes: 8 additions & 5 deletions hawtio-web/src/main/webapp/app/tomcat/js/tomcat.ts
Expand Up @@ -199,11 +199,14 @@ module Tomcat {
//console.log("got response: " + response);
};

$scope.$watch('workspace.tree', function () {
// if the JMX tree is reloaded its probably because a new MBean has been added or removed
// so lets reload, asynchronously just in case
setTimeout(loadData, 50);
});
$scope.$on('jmxTreeUpdated', reloadFunction);
$scope.$watch('workspace.tree', reloadFunction);

function reloadFunction() {
// if the JMX tree is reloaded its probably because a new MBean has been added or removed
// so lets reload, asynchronously just in case
setTimeout(loadData, 50);
}

function loadData() {
console.log("Loading tomcat webapp data...");
Expand Down

0 comments on commit 28058da

Please sign in to comment.