![JAR search and dependency download from the Maven repository](/logo.png)
org.wildfly.clustering.ejb.cache.timer.TimerSerializationContextInitializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wildfly-clustering-ejb-cache Show documentation
Show all versions of wildfly-clustering-ejb-cache Show documentation
Contains code common to the wildfly-clustering-ejb-hotrod and wildfly-clustering-ejb-infinispan modules.
/*
* Copyright The WildFly Authors
* SPDX-License-Identifier: Apache-2.0
*/
package org.wildfly.clustering.ejb.cache.timer;
import java.time.Duration;
import org.kohsuke.MetaInfServices;
import org.wildfly.clustering.marshalling.protostream.AbstractSerializationContextInitializer;
import org.wildfly.clustering.marshalling.protostream.ProtoStreamMarshaller;
import org.wildfly.clustering.marshalling.protostream.SerializationContext;
import org.wildfly.clustering.marshalling.protostream.SerializationContextInitializer;
import org.wildfly.clustering.server.offset.Offset;
/**
* @author Paul Ferraro
*/
@MetaInfServices(SerializationContextInitializer.class)
public class TimerSerializationContextInitializer extends AbstractSerializationContextInitializer {
@Override
public void registerMarshallers(SerializationContext context) {
context.registerMarshaller(new IntervalTimerMetaDataEntryMarshaller());
context.registerMarshaller(new ScheduleTimerMetaDataEntryMarshaller());
@SuppressWarnings("unchecked")
ProtoStreamMarshaller> offsetMarshaller = context.getMarshaller((Class>) Offset.forDuration(Duration.ZERO).getClass());
context.registerMarshaller(offsetMarshaller.wrap(TimerMetaDataEntryFunction.class, TimerMetaDataEntryFunction::getOffset, TimerMetaDataEntryFunction::new));
context.registerMarshaller(TimeoutDescriptorMarshaller.INSTANCE.asMarshaller());
context.registerMarshaller(new TimerIndexMarshaller());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy