Ehcache can be used directly. It can also be used with the popular Hibernate Object/Relational tool. Finally, it can be used for JEE Servlet Caching.
This quick guide gets you started on each of these. The rest of the documentation can be explored for a deeper understanding.
See Code Samples for more information on direct interaction with ehcache.
See Hibernate Caching for more information.
See JEE Servlet Caching for more information.
Usually, with these, you are using ehcache without even realising it. The first steps in getting more control over what is happening are: