Java EL 对象 `${pools}`

发布于 2024-12-08 00:36:04 字数 641 浏览 0 评论 0原文

我正在尝试调整 PSI Probe 中使用的代码(或者更一般地说, PSI Probe 的想法)将在我公司的 Web 应用程序内部使用。我可以获得我想要做的大部分内容,但我已经陷入了一小部分代码 - “状态”选项卡。一列数据是线程的处理时间,我真的很想拥有这些数据,但我不知道它来自哪里。这是相关的片段:

<c:forEach items="${pools}" var="pool" varStatus="poolStatus">
  <div class="poolInfo">
    <h3>${pool.name}</h3>
    <div class="processorInfo">
      <span class="name">
        <spring:message code="probe.jsp.status.processor.maxTime"/>
      </span>
      &nbsp;${pool.maxTime}

我无法弄清楚 pools 对象来自哪里!有人有此类事情的经验吗?谢谢!

I'm trying to adapt the code used in PSI Probe (or more generally, the idea of PSI Probe) to be used inside of my company's web application. I can get the majority of the portions of what I'm looking to do, but I have become stuck on one bit of code - the 'Status' tab. One column of data is the processing time for the thread, data I would really like to have, but I can't figure out where it is coming from. Here's the relevant snippet:

<c:forEach items="${pools}" var="pool" varStatus="poolStatus">
  <div class="poolInfo">
    <h3>${pool.name}</h3>
    <div class="processorInfo">
      <span class="name">
        <spring:message code="probe.jsp.status.processor.maxTime"/>
      </span>
       ${pool.maxTime}

I can't figure out where the pools object is coming from! Does anyone have experience with this sort of thing? Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

只为守护你 2024-12-15 00:36:04

查看源代码(这是 Google 代码,Google 搜索速度非常快),

池被填充在 ListThreadPoolsController

List pools = containerListenerBean.getThreadPools();
        return new ModelAndView(getViewName())
                .addObject("pools", pools);

仔细看看ContainerListenerBean

显示 status.jsp 中列出的属性

<span class="name"><spring:message code="probe.jsp.status.currentThreadCount"/></span> ${pool.currentThreadCount}
<span class="name"><spring:message code="probe.jsp.status.currentThreadsBusy"/></span> ${pool.currentThreadsBusy}
<span class="name"><spring:message code="probe.jsp.status.maxThreads"/></span> ${pool.maxThreads}
<span class="name"><spring:message code="probe.jsp.status.maxSpareThreads"/></span> ${pool.maxSpareThreads}
<span class="name"><spring:message code="probe.jsp.status.minSpareThreads"/></span> ${pool.minSpareThreads}

正在填充到 getThreadPools() 中方法

ThreadPool threadPool = new ThreadPool();
threadPool.setName(executorName.getKeyProperty("name"));
threadPool.setMaxThreads(JmxTools.getIntAttr(server, executorName, "maxThreads"));
threadPool.setMaxSpareThreads(JmxTools.getIntAttr(server, executorName, "largestPoolSize"));
threadPool.setMinSpareThreads(JmxTools.getIntAttr(server, executorName, "minSpareThreads"));
threadPool.setCurrentThreadsBusy(JmxTools.getIntAttr(server, executorName, "activeCount"));
threadPool.setCurrentThreadCount(JmxTools.getIntAttr(server, executorName, "poolSize"));

Looking at the source code (this being Google code, a Google search works really quick)

the pools is being populated in the ListThreadPoolsController

List pools = containerListenerBean.getThreadPools();
        return new ModelAndView(getViewName())
                .addObject("pools", pools);

A closer look at ContainerListenerBean

shows the properties which are listed in status.jsp

<span class="name"><spring:message code="probe.jsp.status.currentThreadCount"/></span> ${pool.currentThreadCount}
<span class="name"><spring:message code="probe.jsp.status.currentThreadsBusy"/></span> ${pool.currentThreadsBusy}
<span class="name"><spring:message code="probe.jsp.status.maxThreads"/></span> ${pool.maxThreads}
<span class="name"><spring:message code="probe.jsp.status.maxSpareThreads"/></span> ${pool.maxSpareThreads}
<span class="name"><spring:message code="probe.jsp.status.minSpareThreads"/></span> ${pool.minSpareThreads}

are being populated in the getThreadPools() method

ThreadPool threadPool = new ThreadPool();
threadPool.setName(executorName.getKeyProperty("name"));
threadPool.setMaxThreads(JmxTools.getIntAttr(server, executorName, "maxThreads"));
threadPool.setMaxSpareThreads(JmxTools.getIntAttr(server, executorName, "largestPoolSize"));
threadPool.setMinSpareThreads(JmxTools.getIntAttr(server, executorName, "minSpareThreads"));
threadPool.setCurrentThreadsBusy(JmxTools.getIntAttr(server, executorName, "activeCount"));
threadPool.setCurrentThreadCount(JmxTools.getIntAttr(server, executorName, "poolSize"));
野却迷人 2024-12-15 00:36:04

一般来说,它可以来自两个地方。在 JSP 或 Filter 之前调用的 Servlet。检查所有过滤器以及映射到您要打开的 URL 的 servlet。

It can come from two places, generally. A Servlet that is invoked before the JSP or a Filter. Check all filters, and the servlet mapped to the url you are opening.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文