Skip to content

Commit

Permalink
Use jmxTreeUpdated event to trigger auto reload of apps in jboss
Browse files Browse the repository at this point in the history
  • Loading branch information
davsclaus committed Apr 18, 2013
1 parent 0bf4027 commit 8abf239
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
13 changes: 8 additions & 5 deletions hawtio-web/src/main/webapp/app/jboss/js/connectors.ts
Expand Up @@ -72,11 +72,14 @@ module JBoss {
Core.$apply($scope);
};

$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 JBoss connector data...");
Expand Down
13 changes: 8 additions & 5 deletions hawtio-web/src/main/webapp/app/jboss/js/jboss.ts
Expand Up @@ -125,11 +125,14 @@ module JBoss {
//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 JBoss webapp data...");
Expand Down
13 changes: 8 additions & 5 deletions hawtio-web/src/main/webapp/app/tomcat/js/sessions.ts
Expand Up @@ -140,11 +140,14 @@ module Tomcat {
Core.$apply($scope);
};

$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 session data...");
Expand Down

0 comments on commit 8abf239

Please sign in to comment.