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 ...

Get Java EE 8 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.