mirror of
https://github.com/corda/corda.git
synced 2024-12-30 17:57:02 +00:00
Merge pull request #7347 from corda/parkri/ENT-9838-deserialization-logger
ENT-9838 DeserializationInput creates a logger each time.
This commit is contained in:
commit
32326a168f
@ -2,8 +2,8 @@ package net.corda.serialization.internal.amqp
|
|||||||
|
|
||||||
import net.corda.core.KeepForDJVM
|
import net.corda.core.KeepForDJVM
|
||||||
import net.corda.core.internal.VisibleForTesting
|
import net.corda.core.internal.VisibleForTesting
|
||||||
import net.corda.core.serialization.EncodingWhitelist
|
|
||||||
import net.corda.core.serialization.AMQP_ENVELOPE_CACHE_PROPERTY
|
import net.corda.core.serialization.AMQP_ENVELOPE_CACHE_PROPERTY
|
||||||
|
import net.corda.core.serialization.EncodingWhitelist
|
||||||
import net.corda.core.serialization.SerializationContext
|
import net.corda.core.serialization.SerializationContext
|
||||||
import net.corda.core.serialization.SerializedBytes
|
import net.corda.core.serialization.SerializedBytes
|
||||||
import net.corda.core.utilities.ByteSequence
|
import net.corda.core.utilities.ByteSequence
|
||||||
@ -21,7 +21,6 @@ import org.apache.qpid.proton.amqp.UnsignedInteger
|
|||||||
import org.apache.qpid.proton.codec.Data
|
import org.apache.qpid.proton.codec.Data
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
import java.io.NotSerializableException
|
import java.io.NotSerializableException
|
||||||
import java.lang.Exception
|
|
||||||
import java.lang.reflect.ParameterizedType
|
import java.lang.reflect.ParameterizedType
|
||||||
import java.lang.reflect.Type
|
import java.lang.reflect.Type
|
||||||
import java.lang.reflect.TypeVariable
|
import java.lang.reflect.TypeVariable
|
||||||
@ -41,16 +40,17 @@ class DeserializationInput constructor(
|
|||||||
private val serializerFactory: SerializerFactory
|
private val serializerFactory: SerializerFactory
|
||||||
) {
|
) {
|
||||||
private val objectHistory: MutableList<Any> = mutableListOf()
|
private val objectHistory: MutableList<Any> = mutableListOf()
|
||||||
private val logger = loggerFor<DeserializationInput>()
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
private val logger = loggerFor<DeserializationInput>()
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
@Throws(AMQPNoTypeNotSerializableException::class)
|
@Throws(AMQPNoTypeNotSerializableException::class)
|
||||||
fun <T> withDataBytes(
|
fun <T> withDataBytes(
|
||||||
byteSequence: ByteSequence,
|
byteSequence: ByteSequence,
|
||||||
encodingWhitelist: EncodingWhitelist,
|
encodingWhitelist: EncodingWhitelist,
|
||||||
task: (ByteBuffer) -> T
|
task: (ByteBuffer) -> T
|
||||||
) : T {
|
): T {
|
||||||
// Check that the lead bytes match expected header
|
// Check that the lead bytes match expected header
|
||||||
val amqpSequence = amqpMagic.consume(byteSequence)
|
val amqpSequence = amqpMagic.consume(byteSequence)
|
||||||
?: throw AMQPNoTypeNotSerializableException("Serialization header does not match.")
|
?: throw AMQPNoTypeNotSerializableException("Serialization header does not match.")
|
||||||
|
Loading…
Reference in New Issue
Block a user