mirror of
https://github.com/corda/corda.git
synced 2024-12-18 20:47:57 +00:00
CORDA-2248 Remove spring boot hack. (#4305)
* CORDA-2248 Remove spring boot hack.
This commit is contained in:
parent
759fd9b5bb
commit
e4c1db4db6
@ -189,20 +189,24 @@ abstract class AbstractAMQPSerializationScheme(
|
||||
}
|
||||
|
||||
override fun <T : Any> deserialize(byteSequence: ByteSequence, clazz: Class<T>, context: SerializationContext): T {
|
||||
var contextToUse = context
|
||||
if (context.useCase == SerializationContext.UseCase.RPCClient) {
|
||||
contextToUse = context.withClassLoader(getContextClassLoader())
|
||||
}
|
||||
val serializerFactory = getSerializerFactory(contextToUse)
|
||||
// This is a hack introduced in version 3 to fix a spring boot issue - CORDA-1747.
|
||||
// It breaks the shell because it overwrites the CordappClassloader with the system classloader that doesn't know about any CorDapps.
|
||||
// In case a spring boot serialization issue with generics is found, a better solution needs to be found to address it.
|
||||
// var contextToUse = context
|
||||
// if (context.useCase == SerializationContext.UseCase.RPCClient) {
|
||||
// contextToUse = context.withClassLoader(getContextClassLoader())
|
||||
// }
|
||||
val serializerFactory = getSerializerFactory(context)
|
||||
return DeserializationInput(serializerFactory).deserialize(byteSequence, clazz, context)
|
||||
}
|
||||
|
||||
override fun <T : Any> serialize(obj: T, context: SerializationContext): SerializedBytes<T> {
|
||||
var contextToUse = context
|
||||
if (context.useCase == SerializationContext.UseCase.RPCClient) {
|
||||
contextToUse = context.withClassLoader(getContextClassLoader())
|
||||
}
|
||||
val serializerFactory = getSerializerFactory(contextToUse)
|
||||
// See the above comment.
|
||||
// var contextToUse = context
|
||||
// if (context.useCase == SerializationContext.UseCase.RPCClient) {
|
||||
// contextToUse = context.withClassLoader(getContextClassLoader())
|
||||
// }
|
||||
val serializerFactory = getSerializerFactory(context)
|
||||
return SerializationOutput(serializerFactory).serialize(obj, context)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user