test.java
来自「RESIN 3.2 最新源码」· Java 代码 · 共 73 行
JAVA
73 行
package example;import javax.management.ObjectName;import javax.management.MBeanServer;import javax.management.MBeanRegistration;/** * Implements a resource which is a plain-old bean, which exposes * the <code>getData()</code> method as a JMX-managed attribute. */public class Test implements TestMBean, MBeanRegistration { /** * The bean's name. */ private ObjectName _name; /** * Gets the name. */ public ObjectName getObjectName() { return _name; } /** * Called before the registration. * * @param server the mbean server to be registered * @param name the client's name to be registered * * @return the name the object wans the be registered as */ public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { _name = name; return name; } /** * Called after the registration. * * @param registrationDone true if the registration was successful. */ public void postRegister(Boolean registrationDone) { } /** * Called before deregistration. */ public void preDeregister() throws Exception { } /** * Called after the deregistration. */ public void postDeregister() { } /** * Returns a printable version of the resource. */ public String toString() { return "Test[" + _name + "]"; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?