mirror of
https://github.com/corda/corda.git
synced 2025-01-20 11:39:09 +00:00
Separate server contexts from shared contexts. (#2044)
This commit is contained in:
parent
687a992262
commit
2a961b8e2c
@ -36,20 +36,6 @@ val KRYO_STORAGE_CONTEXT = SerializationContextImpl(KryoHeaderV0_1,
|
|||||||
true,
|
true,
|
||||||
SerializationContext.UseCase.Storage)
|
SerializationContext.UseCase.Storage)
|
||||||
|
|
||||||
val KRYO_P2P_CONTEXT = SerializationContextImpl(KryoHeaderV0_1,
|
|
||||||
SerializationDefaults.javaClass.classLoader,
|
|
||||||
GlobalTransientClassWhiteList(BuiltInExceptionsWhitelist()),
|
|
||||||
emptyMap(),
|
|
||||||
true,
|
|
||||||
SerializationContext.UseCase.P2P)
|
|
||||||
|
|
||||||
val KRYO_CHECKPOINT_CONTEXT = SerializationContextImpl(KryoHeaderV0_1,
|
|
||||||
SerializationDefaults.javaClass.classLoader,
|
|
||||||
QuasarWhitelist,
|
|
||||||
emptyMap(),
|
|
||||||
true,
|
|
||||||
SerializationContext.UseCase.Checkpoint)
|
|
||||||
|
|
||||||
|
|
||||||
val AMQP_STORAGE_CONTEXT = SerializationContextImpl(AmqpHeaderV1_0,
|
val AMQP_STORAGE_CONTEXT = SerializationContextImpl(AmqpHeaderV1_0,
|
||||||
SerializationDefaults.javaClass.classLoader,
|
SerializationDefaults.javaClass.classLoader,
|
||||||
@ -58,17 +44,9 @@ val AMQP_STORAGE_CONTEXT = SerializationContextImpl(AmqpHeaderV1_0,
|
|||||||
true,
|
true,
|
||||||
SerializationContext.UseCase.Storage)
|
SerializationContext.UseCase.Storage)
|
||||||
|
|
||||||
val AMQP_P2P_CONTEXT = SerializationContextImpl(AmqpHeaderV1_0,
|
|
||||||
SerializationDefaults.javaClass.classLoader,
|
|
||||||
GlobalTransientClassWhiteList(BuiltInExceptionsWhitelist()),
|
|
||||||
emptyMap(),
|
|
||||||
true,
|
|
||||||
SerializationContext.UseCase.P2P)
|
|
||||||
|
|
||||||
val AMQP_RPC_SERVER_CONTEXT = SerializationContextImpl(AmqpHeaderV1_0,
|
val AMQP_RPC_SERVER_CONTEXT = SerializationContextImpl(AmqpHeaderV1_0,
|
||||||
SerializationDefaults.javaClass.classLoader,
|
SerializationDefaults.javaClass.classLoader,
|
||||||
GlobalTransientClassWhiteList(BuiltInExceptionsWhitelist()),
|
GlobalTransientClassWhiteList(BuiltInExceptionsWhitelist()),
|
||||||
emptyMap(),
|
emptyMap(),
|
||||||
true,
|
true,
|
||||||
SerializationContext.UseCase.RPCServer)
|
SerializationContext.UseCase.RPCServer)
|
||||||
|
|
||||||
|
@ -0,0 +1,39 @@
|
|||||||
|
@file:JvmName("SharedContexts")
|
||||||
|
|
||||||
|
package net.corda.nodeapi.internal.serialization
|
||||||
|
|
||||||
|
import net.corda.core.serialization.SerializationContext
|
||||||
|
import net.corda.core.serialization.SerializationDefaults
|
||||||
|
import net.corda.nodeapi.internal.serialization.amqp.AmqpHeaderV1_0
|
||||||
|
import net.corda.nodeapi.internal.serialization.kryo.KryoHeaderV0_1
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Serialisation contexts shared by the server and client.
|
||||||
|
*
|
||||||
|
* NOTE: The [KRYO_STORAGE_CONTEXT] and [AMQP_STORAGE_CONTEXT]
|
||||||
|
* CANNOT always be instantiated outside of the server and so
|
||||||
|
* MUST be kept separate from these ones!
|
||||||
|
*/
|
||||||
|
|
||||||
|
val KRYO_P2P_CONTEXT = SerializationContextImpl(KryoHeaderV0_1,
|
||||||
|
SerializationDefaults.javaClass.classLoader,
|
||||||
|
GlobalTransientClassWhiteList(BuiltInExceptionsWhitelist()),
|
||||||
|
emptyMap(),
|
||||||
|
true,
|
||||||
|
SerializationContext.UseCase.P2P)
|
||||||
|
|
||||||
|
val KRYO_CHECKPOINT_CONTEXT = SerializationContextImpl(KryoHeaderV0_1,
|
||||||
|
SerializationDefaults.javaClass.classLoader,
|
||||||
|
QuasarWhitelist,
|
||||||
|
emptyMap(),
|
||||||
|
true,
|
||||||
|
SerializationContext.UseCase.Checkpoint)
|
||||||
|
|
||||||
|
val AMQP_P2P_CONTEXT = SerializationContextImpl(AmqpHeaderV1_0,
|
||||||
|
SerializationDefaults.javaClass.classLoader,
|
||||||
|
GlobalTransientClassWhiteList(BuiltInExceptionsWhitelist()),
|
||||||
|
emptyMap(),
|
||||||
|
true,
|
||||||
|
SerializationContext.UseCase.P2P)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user