|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.compass.core.converter.basic.format.ThreadSafeFormat
public class ThreadSafeFormat
Wrapper around Formatter
that can be called by multiple
threads concurrently.
Format has a high overhead in creating and is not thread safe. To make best use of resources, the ThreadSafeFormat 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.
Constructor Summary | |
---|---|
ThreadSafeFormat(int initialPoolSize,
int maxPoolSize,
FormatterFactory formatterFactory)
|
Method Summary | |
---|---|
String |
format(Object obj)
Formats the given object to String. |
boolean |
isThreadSafe()
Returns true if this formatter is thread safe, false
otherwise. |
Object |
parse(String str)
Parse the given string to an Object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ThreadSafeFormat(int initialPoolSize, int maxPoolSize, FormatterFactory formatterFactory)
Method Detail |
---|
public boolean isThreadSafe()
Formatter
true
if this formatter is thread safe, false
otherwise.
isThreadSafe
in interface Formatter
public String format(Object obj)
Formatter
format
in interface Formatter
public Object parse(String str) throws ParseException
Formatter
parse
in interface Formatter
ParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |