infinispan / infinispan/protostream
Support for generic marshallers
- Dominant language
- Java
- Stars
- 56
- Forks
- 39
- Avg merge
- 5h 36m
- Merged PRs (30d)
- 5
Description
I would like a way to use generic marshallers without relying on deprecated methods, right now org.infinispan.protostream.impl.SerializationContextImpl looks up marshallers using a hashmap with the class as a key which doesn't find a compatible marshaller. I am currently working around this by creating a MarshallerProvider.. would you consider keeping MarshallerProvider in order to maintain this functionality?
```java
serializationContext.registerMarshallerProvider(new MarshallerProvider() {
@Override
public BaseMarshaller getMarshaller(String typeName) {
return null;
}
@Override
public BaseMarshaller getMarshaller(Class javaClass) {
if (AbstractActor.class.isAssignableFrom(javaClass)) {
return getContext().getMarshaller(AbstractActor.class);
}
if (ActorObserver.class.isAssignableFrom(javaClass)) {
return getContext().getMarshaller(ActorObserver.class);
}
if (RemoteReference.class.isAssignableFrom(javaClass)) {
return getContext().getMarshaller(RemoteReference.class);
}
return null;
}
});
```
Contributor guide
Research direction
Start by reading org.infinispan.protostream.impl.SerializationContextImpl, especially its marshaller lookup, and the MarshallerProvider registration path. Trace how BaseMarshaller instances are selected for a Java class; done should mean generic compatible marshallers can be used without relying on deprecated methods, with the intended provider behavior clarified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100