【问题标题】:Example hawtio plugin monitoring resources via REST示例 hawtio 插件通过 REST 监控资源
【发布时间】:2014-07-11 22:28:16
【问题描述】:

是否有一个通过 REST 监控资源的 hawtio 插件的简单示例。我了解 hawtio 通过 jolokia REST 接口发现 JMX 资源。但我希望监控一些没有 mbean 的资源 - 只有一个 REST API。

我在以下位置关注了简单的插件:

https://github.com/hawtio/hawtio/blob/master/hawtio-plugin-examples/simple-plugin/src/main/webapp/plugin/js/simplePlugin.js

我看到控制器如何使用 jolokia 服务:

Core.register(jolokia, $scope, {
  type: 'read', mbean: 'java.lang:type=OperatingSystem',
  arguments: []
}, onSuccess(render));

是否有使用 RESTful 服务的类似示例?

(PS:hawtio 和 AngularJS 的新手,如果这很明显,请道歉)

【问题讨论】:

    标签: hawtio


    【解决方案1】:

    angularjs 有 $http 用于进行 HTTP/REST 调用。

    jquery 也有 $ajax

    如果您在 hawtio-web 中搜索 hawtio 源代码,您可以找到我们使用它的示例。

    【讨论】:

    • 对于其他你想在 Angular 中使用 $resource 服务的东西,你没有理由不能在 hawtio 插件中使用 $resource -> code.angularjs.org/1.1.5/docs/tutorial/step_11。需要注意的一件事是 hawtio 仍然在 angularjs 1.1.5
    猜你喜欢
    • 2015-09-21
    • 1970-01-01
    • 2021-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-12
    • 2022-12-06
    • 2017-12-26
    相关资源
    最近更新 更多