Class ThreadSafePropertyEditor


  • public class ThreadSafePropertyEditor
    extends java.lang.Object
    Wrapper around PropertyEditor that can be called by multiple threads concurrently.

    A PropertyEditor is not thread safe. To make best use of resources, the PropertyEditor provides a dynamically sizing pool of instances, each of which will only be called by a single thread at a time.

    The pool has a maximum capacity, to limit overhead. If all instances in the pool are in use and another is required, it shall block until one becomes available.

    Since:
    1.3
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Class editorType  
      private Pool pool  
    • Constructor Summary

      Constructors 
      Constructor Description
      ThreadSafePropertyEditor​(java.lang.Class type, int initialPoolSize, int maxPoolSize)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.beans.PropertyEditor fetchFromPool()  
      java.lang.String getAsText​(java.lang.Object object)  
      java.lang.Object setAsText​(java.lang.String str)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • editorType

        private final java.lang.Class editorType
      • pool

        private final Pool pool
    • Constructor Detail

      • ThreadSafePropertyEditor

        public ThreadSafePropertyEditor​(java.lang.Class type,
                                        int initialPoolSize,
                                        int maxPoolSize)
    • Method Detail

      • getAsText

        public java.lang.String getAsText​(java.lang.Object object)
      • setAsText

        public java.lang.Object setAsText​(java.lang.String str)
      • fetchFromPool

        private java.beans.PropertyEditor fetchFromPool()