public class ContextCache extends Object
Context
instances mapped by the property stores used to create them.
The purpose of this class is to reuse instances of bean contexts, serializers, and parsers when they're being re-created with previously-used property stores.
Since serializers and parsers are immutable and thread-safe, we reuse them whenever possible.
Modifier and Type | Field and Description |
---|---|
static ContextCache |
INSTANCE
Reusable cache instance.
|
Modifier and Type | Method and Description |
---|---|
<T extends Context> |
create(Class<T> c,
PropertyStore ps)
Creates a new instance of the specified context-based class, or an existing instance if one with the same
property store was already created.
|
public static final ContextCache INSTANCE
public <T extends Context> T create(Class<T> c, PropertyStore ps)
c
- The instance of the class to create.ps
- The property store to use to create the class.Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.