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.MarshallingConfigurationprivate final org.jboss.marshalling.MarshallerFactoryprivate 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.UnmarshallerGet theUnmarshallerfor 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- theMarshallerFactoryto use to createUnmarshaller's if neededconfig- theMarshallingConfigurationto use
-
-
Method Details
-
getUnmarshaller
public org.jboss.marshalling.Unmarshaller getUnmarshaller(ChannelHandlerContext ctx) throws Exception Description copied from interface:UnmarshallerProviderGet theUnmarshallerfor the givenChannelHandlerContext- Specified by:
getUnmarshallerin interfaceUnmarshallerProvider- Throws:
Exception
-