官术网_书友最值得收藏!

Server resources

At several layers, the server provides your application with some resources. In our quote manager we have our datasource injected into the persistence unit through its JNDI name:

<jta-data-source>java:app/jdbc/quote_manager</jta-data-source>

This datasource can also be injected anywhere else in the code:

@Resource(lookup = "java:app/jdbc/quote_manager")
private DataSource datasource;

But the server manages way more resources. Resources are important because they are provided and handled by the server but used from the application. In other words it is a way to control how the application behaves from the outside of it. It enables you to develop without having to care about the configuration and to tune it later or to adapt it depending on the environment you deploy your application to. The next table lists a subset of the most useful JavaEE resource types which can impact your performances and you can need to watch out if your application uses some of them.

There are other types of resources, but those are the main ones linked to the outside of the application and with performance related configuration, like pooling configuration.

主站蜘蛛池模板: 长垣县| 庄河市| 卓尼县| 桂平市| 郎溪县| 天全县| 慈溪市| 神农架林区| 固安县| 始兴县| 府谷县| 习水县| 额尔古纳市| 闽清县| 平湖市| 垣曲县| 汽车| 潼关县| 石泉县| 隆昌县| 嘉祥县| 夏邑县| 正宁县| 鸡西市| 临潭县| 隆回县| 克山县| 甘谷县| 东阿县| 通渭县| 界首市| 区。| 开鲁县| 甘肃省| 济阳县| 合作市| 临汾市| 龙南县| 梁河县| 台东市| 梅河口市|