public class ThreadLocalMarshallerProvider extends java.lang.Object implements 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| Modifier and Type | Field and Description |
|---|---|
private org.jboss.marshalling.MarshallingConfiguration |
config |
private org.jboss.marshalling.MarshallerFactory |
factory |
private FastThreadLocal<org.jboss.marshalling.Marshaller> |
marshallers |
| Constructor and Description |
|---|
ThreadLocalMarshallerProvider(org.jboss.marshalling.MarshallerFactory factory,
org.jboss.marshalling.MarshallingConfiguration config)
Create a new instance of the
ThreadLocalMarshallerProvider |
| Modifier and Type | Method and Description |
|---|---|
org.jboss.marshalling.Marshaller |
getMarshaller(ChannelHandlerContext ctx)
Get a
Marshaller for the given ChannelHandlerContext |
private final FastThreadLocal<org.jboss.marshalling.Marshaller> marshallers
private final org.jboss.marshalling.MarshallerFactory factory
private final org.jboss.marshalling.MarshallingConfiguration config
public ThreadLocalMarshallerProvider(org.jboss.marshalling.MarshallerFactory factory,
org.jboss.marshalling.MarshallingConfiguration config)
ThreadLocalMarshallerProviderfactory - the MarshallerFactory to use to create Marshaller's if neededconfig - the MarshallingConfiguration to usepublic org.jboss.marshalling.Marshaller getMarshaller(ChannelHandlerContext ctx) throws java.lang.Exception
MarshallerProviderMarshaller for the given ChannelHandlerContextgetMarshaller in interface MarshallerProviderjava.lang.Exception