2.2. Creating serialization context initializers


A serialization context initializer lets you register the following with Data Grid:

  • Protobuf schemas that describe user types.
  • Marshallers that provide serialization and deserialization capabilities.

From a high level, you should do the following to create a serialization context initializer:

  1. Add ProtoStream annotations to your Java classes.
  2. Use the ProtoStream processor that Data Grid provides to compile your SerializationContextInitializer implementation.
참고

The org.infinispan.protostream.MessageMarshaller interface is deprecated and planned for removal in a future version of ProtoStream. You should ignore any code examples or documentation that show how to use MessageMarshaller until it is completely removed.

2.2.1. Adding the ProtoStream processor

Data Grid provides a ProtoStream processor artifact that processes Java annotations in your classes at compile time to generate Protobuf schemas, accompanying marshallers, and a concrete implementation of the SerializationContextInitializer interface.

Procedure

  • Add the protostream-processor to the annotation processors configuration of maven-compiler-plugin to your pom.xml.

    <build>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>...</version>
          <configuration>
            <annotationProcessorPaths>
              <annotationProcessorPath>
                <groupId>org.infinispan.protostream</groupId>
                <artifactId>protostream-processor</artifactId>
                <version>...</version>
              </annotationProcessorPath>
            </annotationProcessorPaths>
          </configuration>
        </plugin>
      </plugins>
    </build>
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동