Book Image

Infinispan Data Grid Platform

By : Francesco Marchioni, Manik Surtani
Book Image

Infinispan Data Grid Platform

By: Francesco Marchioni, Manik Surtani

Overview of this book

<p>In today's competitive business world, Enterprise systems must be able to deliver highly available, high transaction volumes with an increasing number of users. Infinispan enables you to do this as well as share and distribute data among servers in the most efficient way possible so that you achieve faster response times, while trying to avoid single points of failure.<br /><br />Infinispan Data Grid Platform will teach you the most important concepts for building Enterprise applications. Using Infinispan will give you a decisive competitive advantage over the standard clustered applications that are typical in the enterprise today. This, the only book to cover Infinispan, offers detailed instructions for installing, configuring, and effectively using the Infinispan platform. You will learn how to utilize and make the most out of every feature of its API.<br /><br />Progress from examples of adding, removing, and evicting data from a cache, to more complex scenarios such as clustering and distributing data more efficiently in the grid. Throughout the book, you will follow a simple example of an API using a ticket booking system, which will help you to learn how to set up robust and scalable Infinispan configurations. You will also see a complete demonstration of integrating the Infinispan data grid platform with JBoss AS 7.</p>
Table of Contents (13 chapters)
Infinispan Data Grid Platform
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface

Controlling storage and retrieval using CDI annotations


Some CDI annotations have been accepted into the JSR-107 (JCache) specification. All the annotations discussed in this section are a part of JSR-107 and are hence located in the javax.cache package.

These annotations provide value by intercepting method calls invoked on your CDI beans and performing storage and retrieval tasks in Infinispan as a side-effect.

Enabling cache annotations in your CDI application

All CDI applications have a beans.xml file. You need to edit your beans.xml file and add the following interceptors to your CDI beans.xml file, to enable method interception:

<beans xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
<interceptors>
<class>
org.infinispan.cdi.interceptor.CacheResultInterceptor
</class>
<class>
org.infinispan.cdi.interceptor...