Class ThreadLocalMarshallerProvider
- java.lang.Object
-
- io.netty.handler.codec.marshalling.ThreadLocalMarshallerProvider
-
- All Implemented Interfaces:
MarshallerProvider
public class ThreadLocalMarshallerProvider extends java.lang.Object implements MarshallerProvider
UnmarshallerProvider
implementation which use aThreadLocal
to store references toMarshaller
instances. This may give you some performance boost if you need to marshall many smallObject
's and your actual Thread count is not to big
-
-
Constructor Summary
Constructors Constructor Description ThreadLocalMarshallerProvider(org.jboss.marshalling.MarshallerFactory factory, org.jboss.marshalling.MarshallingConfiguration config)
Create a new instance of theThreadLocalMarshallerProvider
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.jboss.marshalling.Marshaller
getMarshaller(ChannelHandlerContext ctx)
Get aMarshaller
for the givenChannelHandlerContext
-
-
-
Constructor Detail
-
ThreadLocalMarshallerProvider
public ThreadLocalMarshallerProvider(org.jboss.marshalling.MarshallerFactory factory, org.jboss.marshalling.MarshallingConfiguration config)
Create a new instance of theThreadLocalMarshallerProvider
- Parameters:
factory
- theMarshallerFactory
to use to createMarshaller
's if neededconfig
- theMarshallingConfiguration
to use
-
-
Method Detail
-
getMarshaller
public org.jboss.marshalling.Marshaller getMarshaller(ChannelHandlerContext ctx) throws java.lang.Exception
Description copied from interface:MarshallerProvider
Get aMarshaller
for the givenChannelHandlerContext
- Specified by:
getMarshaller
in interfaceMarshallerProvider
- Throws:
java.lang.Exception
-
-