Class ThreadLocalMarshallerProvider

  • All Implemented Interfaces:
    MarshallerProvider

    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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.jboss.marshalling.MarshallingConfiguration config  
      private org.jboss.marshalling.MarshallerFactory factory  
      private java.lang.ThreadLocal<org.jboss.marshalling.Marshaller> marshallers  
    • Field Detail

      • marshallers

        private final java.lang.ThreadLocal<org.jboss.marshalling.Marshaller> marshallers
      • factory

        private final org.jboss.marshalling.MarshallerFactory factory
      • config

        private final org.jboss.marshalling.MarshallingConfiguration config
    • Constructor Detail

      • ThreadLocalMarshallerProvider

        public ThreadLocalMarshallerProvider​(org.jboss.marshalling.MarshallerFactory factory,
                                             org.jboss.marshalling.MarshallingConfiguration config)
        Create a new instance of the ThreadLocalMarshallerProvider
        Parameters:
        factory - the MarshallerFactory to use to create Marshaller's if needed
        config - the MarshallingConfiguration to use