Class ThreadLocalUnmarshallerProvider
java.lang.Object
org.jboss.netty.handler.codec.marshalling.ThreadLocalUnmarshallerProvider
- All Implemented Interfaces:
UnmarshallerProvider
UnmarshallerProvider
implementation which use a ThreadLocal
to store references
to Unmarshaller
instances. This may give you some performance boost if you need to unmarshall
many small Object
's.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.jboss.marshalling.MarshallingConfiguration
private final org.jboss.marshalling.MarshallerFactory
private final ThreadLocal
<org.jboss.marshalling.Unmarshaller> -
Constructor Summary
ConstructorsConstructorDescriptionThreadLocalUnmarshallerProvider
(org.jboss.marshalling.MarshallerFactory factory, org.jboss.marshalling.MarshallingConfiguration config) Create a new instance of theThreadLocalUnmarshallerProvider
-
Method Summary
Modifier and TypeMethodDescriptionorg.jboss.marshalling.Unmarshaller
Get theUnmarshaller
for the givenChannelHandlerContext
-
Field Details
-
unmarshallers
-
factory
private final org.jboss.marshalling.MarshallerFactory factory -
config
private final org.jboss.marshalling.MarshallingConfiguration config
-
-
Constructor Details
-
ThreadLocalUnmarshallerProvider
public ThreadLocalUnmarshallerProvider(org.jboss.marshalling.MarshallerFactory factory, org.jboss.marshalling.MarshallingConfiguration config) Create a new instance of theThreadLocalUnmarshallerProvider
- Parameters:
factory
- theMarshallerFactory
to use to createUnmarshaller
's if neededconfig
- theMarshallingConfiguration
to use
-
-
Method Details
-
getUnmarshaller
public org.jboss.marshalling.Unmarshaller getUnmarshaller(ChannelHandlerContext ctx) throws Exception Description copied from interface:UnmarshallerProvider
Get theUnmarshaller
for the givenChannelHandlerContext
- Specified by:
getUnmarshaller
in interfaceUnmarshallerProvider
- Throws:
Exception
-