Ce contenu n'est pas disponible dans la langue sélectionnée.

6.4.4. Registering Advanced Externalizers


In JBoss Data Grid, AdvancedExternalizer implementation can be registered using XML or Programmatic configuration, or via annotation.
An Advanced Externalizer implementation for Person object stored as a static inner class can be configured programmatically or declaratively.
Declarative Configuration:

The following is an example of a declarative configuration for an advanced Externalizer implementation:

<infinispan>
  <global>
    <serialization>
      <advancedExternalizers>
        <advancedExternalizer externalizerClass="Person$PersonExternalizer"/>
      </advancedExternalizers>
    </serialization>
  </global>
  ...
</infinispan>
Copy to Clipboard Toggle word wrap
Programmatic Configuration:

The following is an example of a programmatic configuration for an advanced Externalizer implementation:

GlobalConfigurationBuilder builder = ...
builder.serialization()
   .addAdvancedExternalizer(new Person.PersonExternalizer());
Copy to Clipboard Toggle word wrap
An AdvancedExternalizer implementation must be associated with an identifier, regardless of the configuration method used.
If an identifier in an AdvancedExternalizer implementation is defined using both XML/Programmatic configuration as well as annotation, XML/Programmatic defined value will be used.
The following example shows an Externalizer where the identifier is defined at the time of registration:
Declarative Configuration:

The following is a declarative configuration for the location of the identifier definition during registration:

<infinispan>
  <global>
    <serialization>
      <advancedExternalizers>
        <advancedExternalizer id="123"
                              externalizerClass="Person$PersonExternalizer"/>
      </advancedExternalizers>
    </serialization>
  </global>
  ...
</infinispan>
Copy to Clipboard Toggle word wrap
Programmatic Configuration:

The following is a programmatic configuration for the location of the identifier definition during registration:

GlobalConfigurationBuilder builder = ...
builder.serialization()
   .addAdvancedExternalizer(123, new Person.PersonExternalizer());
Copy to Clipboard Toggle word wrap
Retour au début
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2025 Red Hat