Top Description Fields Constructors Methods
com.thoughtworks.xstream.core.util

public Class ThreadSafePropertyEditor

extends Object
Class Inheritance
Imports
com.thoughtworks.xstream.converters.ConversionException, .ErrorWritingException, com.thoughtworks.xstream.converters.reflection.ObjectAccessException, java.beans.PropertyEditor

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.

Author
Jörg Schaible
Since
1.3

Field Summary

Modifier and TypeField and Description
private final Class<T>
private final Pool

Constructor Summary

AccessConstructor and Description
public
ThreadSafePropertyEditor(Class<T> type, int initialPoolSize, int maxPoolSize)

Method Summary

Modifier and TypeMethod and Description
private PropertyEditor
public String
getAsText(Object object)

public Object
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

editorTypeback to summary
private final Class<T> editorType
poolback to summary
private final Pool pool

Constructor Detail

ThreadSafePropertyEditorback to summary
public ThreadSafePropertyEditor(Class<T> type, int initialPoolSize, int maxPoolSize)

Method Detail

fetchFromPoolback to summary
private PropertyEditor fetchFromPool()
getAsTextback to summary
public String getAsText(Object object)
setAsTextback to summary
public Object setAsText(String str)