public class ThreadLocalMarshallerProvider extends java.lang.Object implements MarshallerProvider
UnmarshallerProvider
实现,它使用ThreadLocal
来存储对Marshaller
实例的引用。
这可能会给你一些性能提升,如果你需要编组许多小Object
的和你的实际线程数不大
Constructor and Description |
---|
ThreadLocalMarshallerProvider(org.jboss.marshalling.MarshallerFactory factory, org.jboss.marshalling.MarshallingConfiguration config)
创建一个 ThreadLocalMarshallerProvider 的新实例
|
Modifier and Type | Method and Description |
---|---|
org.jboss.marshalling.Marshaller |
getMarshaller(ChannelHandlerContext ctx)
获得 Marshaller 的Marshaller
|
public ThreadLocalMarshallerProvider(org.jboss.marshalling.MarshallerFactory factory, org.jboss.marshalling.MarshallingConfiguration config)
ThreadLocalMarshallerProvider
的新实例
factory
-
MarshallerFactory
用于根据需要创建
Marshaller
config
- 使用
MarshallingConfiguration
public org.jboss.marshalling.Marshaller getMarshaller(ChannelHandlerContext ctx) throws java.lang.Exception
MarshallerProvider
Marshaller
给定的ChannelHandlerContext
getMarshaller
,界面
MarshallerProvider
java.lang.Exception
Copyright © 2008–2018 The Netty Project. All rights reserved.