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

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.

主站蜘蛛池模板: 江孜县| 昌吉市| 南川市| 平阴县| 驻马店市| 荥阳市| 临湘市| 潮州市| 佳木斯市| 会宁县| 依兰县| 三穗县| 晋城| 祁阳县| 久治县| 山西省| 上杭县| 桦南县| 文昌市| 武清区| 兴城市| 邳州市| 大田县| 中西区| 祁连县| 金川县| 柳州市| 永城市| 木里| 汝城县| 扎赉特旗| 桦川县| 泗水县| 肇源县| 闸北区| 比如县| 陈巴尔虎旗| 张家界市| 义乌市| 马山县| 买车|