📄 testresource.java
字号:
package test;import java.util.logging.Logger;import javax.annotation.PostConstruct;/** * Implements a resource which is a plain-old bean. * * The resource is configured in the resin.conf (or web.xml) using * bean-style configuration and saved in JNDI. * * <pre> * <bean class="test.TestResource"> * <init> * <value>sample configuration</value> * </init> * </resource> * </pre> * * <p>Applications will use WebBeans to retrieve the resource:</p> * * <code><pre> * @In TestResource resource; * </pre></code> */public class TestResource { private static final Logger log = Logger.getLogger(TestResource.class.getName()); /** * Sample initialization param set by the <resource> */ private String _value = "default"; /** * Sets the value. */ public void setValue(String value) { _value = value; } /** * init() is called at the end of the configuration. */ @PostConstruct public void init() { log.config("TestResource[" + _value + "] init"); } /** * Returns a printable version of the resource. */ public String toString() { return "TestResource[" + _value + "]"; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -