Class ThreadSafeSimpleDateFormat
- java.lang.Object
-
- com.thoughtworks.xstream.core.util.ThreadSafeSimpleDateFormat
-
public class ThreadSafeSimpleDateFormat extends java.lang.ObjectWrapper around java.text.SimpleDateFormat that can be called by multiple threads concurrently.SimpleDateFormat has a high overhead in creating and is not thread safe. To make best use of resources, the ThreadSafeSimpleDateFormat 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:
- Joe Walnes, Jörg Schaible
-
-
Constructor Summary
Constructors Constructor Description ThreadSafeSimpleDateFormat(java.lang.String format, java.util.TimeZone timeZone, int initialPoolSize, int maxPoolSize, boolean lenient)ThreadSafeSimpleDateFormat(java.lang.String format, java.util.TimeZone timeZone, java.util.Locale locale, int initialPoolSize, int maxPoolSize, boolean lenient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringformat(java.util.Date date)java.util.Dateparse(java.lang.String date)java.lang.StringtoString()
-
-
-
Constructor Detail
-
ThreadSafeSimpleDateFormat
public ThreadSafeSimpleDateFormat(java.lang.String format, java.util.TimeZone timeZone, int initialPoolSize, int maxPoolSize, boolean lenient)
-
ThreadSafeSimpleDateFormat
public ThreadSafeSimpleDateFormat(java.lang.String format, java.util.TimeZone timeZone, java.util.Locale locale, int initialPoolSize, int maxPoolSize, boolean lenient)
-
-