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

  • Java EE 8 High Performance
  • Romain Manni Bucau
  • 179字
  • 2021-06-30 19:14:29

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.

主站蜘蛛池模板: 堆龙德庆县| 道孚县| 沁源县| 奇台县| 德阳市| 柘城县| 曲松县| 治县。| 阿巴嘎旗| 葵青区| 四川省| 阳高县| 安福县| 班戈县| 满洲里市| 渑池县| 建水县| 灯塔市| 合阳县| 定州市| 林周县| 渝北区| 革吉县| 荔浦县| 天峨县| 巢湖市| 锦州市| 中宁县| 新闻| 富民县| 红桥区| 大名县| 普定县| 北碚区| 分宜县| 宁海县| 万宁市| 榆社县| 错那县| 莆田市| 龙州县|