Module org.mozilla.rhino
Class WeakReferenceFactory
java.lang.Object
org.mozilla.javascript.lc.type.impl.factory.WithCacheFactory
org.mozilla.javascript.lc.type.impl.factory.WeakReferenceFactory
- All Implemented Interfaces:
Serializable,FactoryBase,TypeInfoFactory
TypeInfoFactory implementation with a thread-safe (synchronized), weak-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 weak-reference cache. Resolving a type will not prevent it from getting reclaimed by JVM.
This factory is thread safe. Multiple threads can safely access the same WeakReferenceFactory object at the same time, but it's not guaranteed to be performant.
This factory is serializable, but none of its cached objects will be serialized.
- See Also:
-
Field Summary
Fields inherited from interface org.mozilla.javascript.lc.type.TypeInfoFactory
EMPTY_ARRAY, GLOBAL -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.mozilla.javascript.lc.type.impl.factory.WithCacheFactory
create, create, getConsolidationMappingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.mozilla.javascript.lc.type.impl.factory.FactoryBase
attachParam, computeConsolidationMapping, create, create, create, toArrayMethods inherited from interface org.mozilla.javascript.lc.type.TypeInfoFactory
associate, attachParam, consolidateType, create, createArray, createList
-
Constructor Details
-
WeakReferenceFactory
public WeakReferenceFactory()
-
-
Method Details
-
createTypeCache
- Specified by:
createTypeCachein classWithCacheFactory
-
createConsolidationMappingCache
- Specified by:
createConsolidationMappingCachein classWithCacheFactory
-