Class ThreadLocalMarshallerProvider
java.lang.Object
org.jboss.netty.handler.codec.marshalling.ThreadLocalMarshallerProvider
- All Implemented Interfaces:
MarshallerProvider
UnmarshallerProvider
implementation which use a ThreadLocal
to store references
to Marshaller
instances. This may give you some performance boost if you need to marshall
many small Object
's and your actual Thread count is not to big-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.jboss.marshalling.MarshallingConfiguration
private final org.jboss.marshalling.MarshallerFactory
private final ThreadLocal<org.jboss.marshalling.Marshaller>
-
Constructor Summary
ConstructorsConstructorDescriptionThreadLocalMarshallerProvider
(org.jboss.marshalling.MarshallerFactory factory, org.jboss.marshalling.MarshallingConfiguration config) Create a new instance of theThreadLocalMarshallerProvider
-
Method Summary
Modifier and TypeMethodDescriptionorg.jboss.marshalling.Marshaller
Get aMarshaller
for the givenChannelHandlerContext
-
Field Details
-
marshallers
-
factory
private final org.jboss.marshalling.MarshallerFactory factory -
config
private final org.jboss.marshalling.MarshallingConfiguration config
-
-
Constructor Details
-
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 Details
-
getMarshaller
Description copied from interface:MarshallerProvider
Get aMarshaller
for the givenChannelHandlerContext
- Specified by:
getMarshaller
in interfaceMarshallerProvider
- Throws:
Exception
-