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.