Class ConcurrentFactory

java.lang.Object
org.mozilla.javascript.lc.type.impl.factory.WithCacheFactory
org.mozilla.javascript.lc.type.impl.factory.ConcurrentFactory
All Implemented Interfaces:
Serializable, FactoryBase, TypeInfoFactory

public class ConcurrentFactory extends WithCacheFactory
TypeInfoFactory implementation with a thread-safe (synchronized), strong-reference cache.

This factory will cache TypeInfo for simple types. Passing simple type (TypeInfoFactory.class for example) to this factory multiple times will return the exactly same TypeInfo object.

This factory uses a strong-reference cache. Resolving a type might cause this factory to hold a strong reference to the type.

This factory is thread safe. Multiple threads can safely access the same ConcurrentFactory object at the same time. It's more performant than WeakReferenceFactory

This factory is serializable, but none of its cached objects will be serialized.

See Also: