Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 33. Integration with the Spring Framework


JBoss Data Grid allows users to define a Spring Cache provider, providing applications a method of easily adding caching support, and allowing users familiar with Spring's programming model a way to have caching fulfilled by JBoss Data Grid.
The following steps and examples demonstrate methods that Administrators can use to configure JBoss Data Grid nodes for Spring support. Additional information, including how to include Spring annotations inside applications, can be found in the JBoss Data Grid Developer Guide.

33.1. Enabling Spring Cache Support Declaratively (Library Mode)

Spring's cache support can be enabled through the xml file by performing the following steps:
  1. Add <cache:annotation-driven/> to the xml file. This line enables the standard spring annotations to be used by the application.
  2. Define a cache manager using the <infinispan:embedded-cache-manager ... />.
The following example demonstrates these changes:

Example 33.1. Sample Declarative Configuration

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:infinispan="http://www.infinispan.org/schemas/spring"
       xmlns:cache="http://www.springframework.org/schema/cache"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd
       http://www.infinispan.org/schemas/spring http://www.infinispan.org/schemas/infinispan-spring.xsd">
[...]
<cache:annotation-driven/>

<infinispan:embedded-cache-manager
            configuration="classpath:/path/to/cache-config.xml"/>
[...]
Copy to Clipboard Toggle word wrap
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat