Show Table of Contents
23.3.4. 编辑线程池
JBoss 管理员可以用管理控制台或 CLI 来编辑线程池。
过程 23.13. 用管理控制台编辑线程池
- 登录到管理控制台。第 3.4.2 节 “登录到管理控制台”。
- 点击屏幕顶部的 标签页。展开 菜单并选择 。然后选择 标签页。
- 选择要编辑的线程池。
- 点击 。
- 编辑要修改的内容,您只可以修改
Thread Factory、Max Threads、Keepalive Timeout和Keepalive Timeout Unit。 - 点击完成。
过程 23.14. 用 CLI 编辑线程池
- 登录 CLI 工具并连接到您的服务器。请参考 第 3.5.4 节 “用管理 CLI 连接受管服务器实例”。
- 对需要修改的每个线程池属性使用
write_attribute操作和下列语法。/subsystem=ejb3/thread-pool=THREADPOOLNAME:write-attribute(name="ATTRIBUTE", value="VALUE")
- 用线程池的名称替换 THREADPOOLNAME。
- 用要编辑的属性的名称替换 ATTRIBUTE。可以编辑的这些属性是
keepalive-time、max-threads和thread-factory。 - 用所需的属性值替换 VALUE。
- 请用
read-resource操作来确认对线程池的修改。/subsystem=ejb3/thread-pool=THREADPOOLNAME:read-resource
重要
当用 CLI 修改
keepalive-time 属性的值时,所需的值是一个对象形式。它具有下列语法。
/subsystem=ejb3/thread-pool=THREADPOOLNAME:write-attribute(name="keepalive-time", value={"time" => "VALUE","unit" => "UNIT"}例 23.10. 用 CLI 设置线程池的 Maxsize 值
[standalone@localhost:9999 /] /subsystem=ejb3/thread-pool=HSThreads:write-attribute(name="max-threads", value="50")
{"outcome" => "success"}
[standalone@localhost:9999 /]例 23.11. 用 CLI 设置线程池的 keepalive-time 值
[standalone@localhost:9999 /] /subsystem=ejb3/thread-pool=HSThreads:write-attribute(name="keepalive-time", value={"time"=>"150"})
{"outcome" => "success"}
[standalone@localhost:9999 /]
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.