perl JMX::Jmx4Perl
NAME ^ JMX::Jmx4Perl - JMX access for Perl SYNOPSIS ^ Simple: use strict; print “Memory Used: “, use strict; my $jmx = new JMX::Jmx4Perl(url => “http://localhost:8080/j4p“, # Get general server information DESCRIPTION ^ Jmx4Perl is here to connect the Java and Perl Enterprise world by providing transparent access to the Java Management Extensions (JMX) from the perl side. Jmx4Perl 是连接到Java和 Perl Enterprise world 通过提供透明的访问到Java 管理扩展(JMX) It uses a traditional request-response paradigma for performing JMX operations on a remote Java Virtual machine. 它使用一个传统的请求-响应范式用于执行JMX 操作在一个远程的Java 虚拟机。 There a various ways how JMX information can be transfered. Jmx4Perl is based on a Jolokia agent (www.jolokia.org),which needs to deployed on the target platform. 有各种方式 JMX信息可以被转移,Jmx4Perl是基于Jolokia agent(www.jolokia.org),需要部署在目标平台。 它起一个代理的角色,一方面和MBeanServer通讯和传输JMX相关的信息通过HTTP和JSON 给客户端(i.e. this module). 请参考JMX::Jmx4Perl::Manual 查看安装说明和如何部署Jolokia agent。 An alternative and more ‘java like’ approach is the usage of JSR 160 connectors. However,the default connectors provided by the Java Virtual Machine (JVM) since version 1.5 support only proprietary protocols which require serialized Java objects to be exchanged. This implies that a JVM needs to be started on the client side adding quite some overhead if used from within Perl. If you absolutely require JSR 160 communication (e.g. because a agent can not be deployed on the target for some reason),you can still use Jmx4Perl operating with the so called proxy mode. 一个不寻常的,更加‘java like’的方法是JSR 160连接器的使用。然而,默认的连接器提供通过Java Virtual Machine (JVM) 自从1.5版本只支持 专有的额系诶需要学历恶化的Java对象被执行。 这意味着JVM需要被启动在客户端上增加一些开销,如果从Perl内部使用。 For further discussion comparing both approaches,please refer to JMX::Jmx4Perl::Manual 为进一步讨论比较的方法,请参阅JMX::Jmx4Perl::Manual JMX itself knows about the following operations on so called MBeans,which are specific “managed beans” designed for JMX and providing access to management functions: Reading and writing of attributes of an MBean (like memory usage or connected users) JMX 本身知道以下操作所谓的MBean,指定为”managed beans” 设计用于JMX 和提供访问管理功能: 读取和写MBean的属性(like memory usage or connected users) 执行操作(like triggering a garbage collection) 当某事件发生时,将从应用服务器发送通知的通知注册 METHODS 方法: $jmx = JMX::Jmx4Perl->new(mode =>,….) Create a new instance. The call is dispatched to an Jmx4Perl implementation by selecting an appropriate mode. For now,the only mode supported is “agent”, which uses the JMX::Jmx4Perl::Agent backend. Hence,the mode can be submitted for now. 创建一个新实例,请求被调度到一个Jmx4Perl 实现通过选择一个适当的模式。现在,唯一的方式是代理,使用JMX::Jmx4Perl::Agent后台,因此, 该模式可以提交现在。 Options can be given via key value pairs (or via a hash). Recognized options are: 选项可以通过键值对(或者通过hash),公认的选项: server by default,.j4p in the users home directory is used. 你能提供一个server name,在配置文件里查找。配置文件的名字可以被给定通过config_file(见下文) 默认的,.j4p 在用户家目录被使用。 config_file 配置文件使用路径 config JMX::Jmx4Perl::Config 配置对象用于配置,使用你已经从配置读取的 product 如果你提供一个产品id 通过命名的参数产品你可以指定jmx4perl 一个hint,默认的 这个模块是使用自动检查的 来猜测server的类型。 你需要提供这个参数只要如果你使用jmx4perl’s alias 功能,如果你需要加速(自动检查可能是相当慢的因为这个需要server JMX 请求来检测产品指定的MBean 属性0 timeout method Any other named parameters are interpreted by the backend,please refer to its documentation for details (i.e. JMX::Jmx4Perl::Agent)
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |