Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
164 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
### Jetty | ||
|
||
This plugin lists local JVMs running on your machine and allows you to install the Jolokia JVM agent into a running JVM and connect to it. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<div ng-controller="JVM.JVMsController"> | ||
|
||
<div class="logbar"> | ||
<div class="wiki logbar-container"> | ||
<ul class="nav nav-tabs"> | ||
<li class="pull-right"> | ||
<a href='' ng-click="fetch()"><i class="icon-refresh"></i> Refresh</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
|
||
<div class="wiki-fixed row-fluid"> | ||
<table class='centered table table-bordered table-condensed table-striped'> | ||
<thead> | ||
<tr> | ||
<th>PID</th> | ||
<th>Name</th> | ||
<th>Agent URL</th> | ||
<th></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr ng-repeat="jvm in data"> | ||
<td>{{jvm.id}}</td> | ||
<td>{{jvm.alias}}</td> | ||
<td><a href='' title="Connect to this agent" ng-click="connectTo(jvm.agentUrl)">{{jvm.agentUrl}}</a></td> | ||
<td> | ||
<a class='btn' href="" title="Stop Agent" ng-show="jvm.agentUrl" ng-click="stopAgent(jvm.id)"><i class="icon-stop"></i></a> | ||
<a class='btn' href="" title="Start Agent" ng-hide="jvm.agentUrl" ng-click="startAgent(jvm.id)"><i class="icon-play"></i></a> | ||
</td> | ||
</tr> | ||
|
||
</tbody> | ||
</table> | ||
|
||
</div> | ||
|
||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module Jvm { | ||
|
||
var pluginName = 'jvm'; | ||
|
||
angular.module(pluginName, ['bootstrap', 'ngResource', 'datatable', 'hawtioCore']). | ||
config(($routeProvider) => { | ||
$routeProvider. | ||
when('/jvms', {templateUrl: 'app/jvm/html/jvms.html'}); | ||
}). | ||
constant('mbeanName', 'io.hawt.jvm.local:type=JVMList'). | ||
run(($location, workspace, viewRegistry, layoutFull) => { | ||
|
||
viewRegistry[pluginName] = layoutFull; | ||
|
||
workspace.topLevelTabs.push({ | ||
content: "JVMs", | ||
title: "View local JVMs and connect hawtio to them", | ||
isValid: (workspace) => workspace.treeContainsDomainAndProperties('io.hawt.jvm.local', {type: 'JVMList'}), | ||
href: () => '#/jvms', | ||
isActive: (workspace: Workspace) => workspace.isLinkActive("jvms") | ||
|
||
}); | ||
|
||
}); | ||
|
||
|
||
|
||
hawtioPluginLoader.addModule(pluginName); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
module JVM { | ||
|
||
export function JVMsController($scope, $window, jolokia, mbeanName) { | ||
|
||
$scope.data = []; | ||
|
||
|
||
$scope.fetch = () => { | ||
jolokia.request({ | ||
type: 'exec', mbean: mbeanName, | ||
operation: 'listLocalJVMs()', | ||
arguments: [] | ||
}, onSuccess(render)); | ||
} | ||
|
||
$scope.stopAgent = (pid) => { | ||
jolokia.request({ | ||
type: 'exec', mbean: mbeanName, | ||
operation: 'stopAgent(java.lang.String)', | ||
arguments: [pid] | ||
}, onSuccess($scope.fetch)); | ||
} | ||
|
||
$scope.startAgent = (pid) => { | ||
jolokia.request({ | ||
type: 'exec', mbean: mbeanName, | ||
operation: 'startAgent(java.lang.String)', | ||
arguments: [pid] | ||
}, onSuccess($scope.fetch)); | ||
} | ||
|
||
$scope.connectTo = (url) => { | ||
$window.open("?url=" + encodeURIComponent(url)); | ||
} | ||
|
||
|
||
function render(response) { | ||
console.log("Got: ", response); | ||
$scope.data = response.value | ||
$scope.$apply(); | ||
} | ||
|
||
$scope.fetch(); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters