You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2021/02/22 22:01:21 UTC
[juneau] branch master updated: Rename BeanFactory to BeanStore.
This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new 97c7acb Rename BeanFactory to BeanStore.
97c7acb is described below
commit 97c7acb97c2a9e362ced7cb792d541b222f8e506
Author: JamesBognar <ja...@salesforce.com>
AuthorDate: Mon Feb 22 17:01:06 2021 -0500
Rename BeanFactory to BeanStore.
---
.../main/ConfigurablePropertyCodeGenerator.java | 2 +-
.../java/org/apache/juneau/ContextProperties.java | 34 +-
.../org/apache/juneau/assertions/Assertion.java | 2 +-
.../apache/juneau/cp/BeanCreateMethodFinder.java | 18 +-
.../juneau/cp/{BeanFactory.java => BeanStore.java} | 49 +-
...anFactoryBuilder.java => BeanStoreBuilder.java} | 34 +-
.../main/java/org/apache/juneau/cp/FileFinder.java | 4 +-
.../org/apache/juneau/cp/FileFinderBuilder.java | 10 +-
.../juneau/mstat/MethodExecStatsBuilder.java | 10 +-
.../org/apache/juneau/mstat/MethodExecStore.java | 8 +-
.../juneau/mstat/MethodExecStoreBuilder.java | 10 +-
.../apache/juneau/mstat/ThrownStatsBuilder.java | 10 +-
.../java/org/apache/juneau/mstat/ThrownStore.java | 6 +-
.../apache/juneau/mstat/ThrownStoreBuilder.java | 10 +-
.../java/org/apache/juneau/svl/VarResolver.java | 14 +-
.../org/apache/juneau/svl/VarResolverBuilder.java | 16 +-
.../org/apache/juneau/svl/VarResolverContext.java | 10 +-
.../org/apache/juneau/svl/VarResolverSession.java | 20 +-
.../org/apache/juneau/utils/MethodInvoker.java | 10 +-
.../org/apache/juneau/rest/client/RestClient.java | 8 +-
...SpringBeanFactory.java => SpringBeanStore.java} | 10 +-
.../juneau/rest/springboot/SpringRestServlet.java | 4 +-
.../apache/juneau/rest/BasicSwaggerProvider.java | 6 +-
.../apache/juneau/rest/DebugEnablementBuilder.java | 10 +-
.../main/java/org/apache/juneau/rest/RestCall.java | 30 +-
.../java/org/apache/juneau/rest/RestChild.java | 2 +-
.../apache/juneau/rest/RestChildrenBuilder.java | 16 +-
.../java/org/apache/juneau/rest/RestContext.java | 826 ++++++++++-----------
.../org/apache/juneau/rest/RestContextBuilder.java | 78 +-
.../apache/juneau/rest/RestOperationContext.java | 260 +++----
.../juneau/rest/RestOperationContextBuilder.java | 18 +-
.../apache/juneau/rest/RestOperationsBuilder.java | 16 +-
.../java/org/apache/juneau/rest/RestRequest.java | 2 +-
.../java/org/apache/juneau/rest/RestServlet.java | 10 +-
.../org/apache/juneau/rest/StaticFilesBuilder.java | 4 +-
.../apache/juneau/rest/SwaggerProviderBuilder.java | 10 +-
.../org/apache/juneau/rest/annotation/Rest.java | 6 +-
.../juneau/rest/annotation/RestAnnotation.java | 18 +-
.../org/apache/juneau/rest/args/DefaultArg.java | 8 +-
.../juneau/rest/logging/RestLoggerBuilder.java | 10 +-
.../java/org/apache/juneau/rest/vars/FileVar.java | 2 +-
.../apache/juneau/rest/vars/LocalizationVar.java | 2 +-
.../juneau/rest/vars/RequestAttributeVar.java | 2 +-
.../juneau/rest/vars/RequestFormDataVar.java | 2 +-
.../apache/juneau/rest/vars/RequestHeaderVar.java | 2 +-
.../apache/juneau/rest/vars/RequestPathVar.java | 2 +-
.../apache/juneau/rest/vars/RequestQueryVar.java | 2 +-
.../apache/juneau/rest/vars/RequestSwaggerVar.java | 2 +-
.../org/apache/juneau/rest/vars/RequestVar.java | 2 +-
.../juneau/rest/vars/SerializedRequestAttrVar.java | 2 +-
.../juneau/rest/vars/ServletInitParamVar.java | 2 +-
.../org/apache/juneau/rest/vars/SwaggerVar.java | 2 +-
.../java/org/apache/juneau/rest/vars/UrlVar.java | 2 +-
.../org/apache/juneau/cp/BeanFactory_Test.java | 238 +++---
.../apache/juneau/mstat/MethodExecStore_Test.java | 28 +-
.../org/apache/juneau/mstat/ThrownStore_Test.java | 24 +-
.../rest/annotation/RestAnnotation_Test.java | 10 +-
57 files changed, 979 insertions(+), 976 deletions(-)
diff --git a/juneau-all/src/java/main/ConfigurablePropertyCodeGenerator.java b/juneau-all/src/java/main/ConfigurablePropertyCodeGenerator.java
index 35dd419..f1ec8a6 100644
--- a/juneau-all/src/java/main/ConfigurablePropertyCodeGenerator.java
+++ b/juneau-all/src/java/main/ConfigurablePropertyCodeGenerator.java
@@ -67,7 +67,7 @@ public class ConfigurablePropertyCodeGenerator {
BasicRuntimeException.class,
BeanAssertion.class,
BeanContextBuilder.class,
- BeanFactoryBuilder.class,
+ BeanStoreBuilder.class,
BeanSessionArgs.class,
BeanTraverseBuilder.class,
BooleanAssertion.class,
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ContextProperties.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ContextProperties.java
index 28090e9..5a1cea2 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ContextProperties.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ContextProperties.java
@@ -475,12 +475,12 @@ public final class ContextProperties {
*
* @param key The property name.
* @param type The class type of the property.
- * @param beanFactory The bean factory to use for instantiating the bean.
+ * @param beanStore The bean store to use for instantiating the bean.
* @return A new property instance.
*/
- public <T> Optional<T> getInstance(String key, Class<T> type, BeanFactory beanFactory) {
+ public <T> Optional<T> getInstance(String key, Class<T> type, BeanStore beanStore) {
Property p = findProperty(key);
- return Optional.ofNullable(p == null ? null : p.asInstance(type, beanFactory));
+ return Optional.ofNullable(p == null ? null : p.asInstance(type, beanStore));
}
/**
@@ -499,12 +499,12 @@ public final class ContextProperties {
*
* @param key The property name.
* @param type The class type of the property.
- * @param beanFactory The bean factory to use for instantiating the bean.
+ * @param beanStore The bean store to use for instantiating the bean.
* @return A new property instance array.
*/
- public <T> Optional<T[]> getInstanceArray(String key, Class<T> type, BeanFactory beanFactory) {
+ public <T> Optional<T[]> getInstanceArray(String key, Class<T> type, BeanStore beanStore) {
Property p = findProperty(key);
- return Optional.ofNullable(p == null ? null : p.asInstanceArray(type, beanFactory));
+ return Optional.ofNullable(p == null ? null : p.asInstanceArray(type, beanStore));
}
/**
@@ -841,18 +841,18 @@ public final class ContextProperties {
* Converts this property to the specified instance type.
*
* @param iType The type to instantiate.
- * @param beanFactory The bean factory to use for instantiating beans.
+ * @param beanStore The bean store to use for instantiating beans.
* @param <T> The type to instantiate.
* @return The instantiated object.
* @throws ConfigException If value could not be instantiated.
*/
- public <T> T asInstance(Class<T> iType, BeanFactory beanFactory) {
+ public <T> T asInstance(Class<T> iType, BeanStore beanStore) {
if (value == null)
return null;
if (type == STRING)
return fromString(iType, value.toString());
else if (type == OBJECT || type == CLASS) {
- T t = instantiate(beanFactory, iType, value);
+ T t = instantiate(beanStore, iType, value);
if (t != null)
return t;
}
@@ -863,12 +863,12 @@ public final class ContextProperties {
* Converts this property to an array of specified instance type.
*
* @param eType The entry type to instantiate.
- * @param beanFactory The bean factory to use to instantiate beans.
+ * @param beanStore The bean store to use to instantiate beans.
* @param <T> The type to instantiate.
* @return The instantiated object.
* @throws ConfigException If value could not be instantiated.
*/
- public <T> T[] asInstanceArray(Class<T> eType, BeanFactory beanFactory) {
+ public <T> T[] asInstanceArray(Class<T> eType, BeanStore beanStore) {
if (value instanceof Collection) {
Collection<?> l = (Collection<?>)value;
Object t = Array.newInstance(eType, l.size());
@@ -880,7 +880,7 @@ public final class ContextProperties {
else if (type == SET_STRING || type == LIST_STRING)
o2 = fromString(eType, o.toString());
else if (type == SET_CLASS || type == LIST_CLASS || type == LIST_OBJECT)
- o2 = instantiate(beanFactory, eType, o);
+ o2 = instantiate(beanStore, eType, o);
if (o2 == null)
throw new ConfigException("Invalid property conversion ''{0}'' to ''{1}[]'' on property ''{2}''. Entry type: ''{3}''", type, eType, name, o == null ? null : o.getClass().getName());
Array.set(t, i++, o2);
@@ -914,16 +914,16 @@ public final class ContextProperties {
// Utility methods
//-------------------------------------------------------------------------------------------------------------------
- static BeanFactory DEFAULT_BEAN_FACTORY = BeanFactory.create().build();
+ static BeanStore DEFAULT_BEAN_STORE = BeanStore.create().build();
- static <T> T instantiate(BeanFactory beanFactory, Class<T> c, Object value) {
+ static <T> T instantiate(BeanStore beanStore, Class<T> c, Object value) {
if (ClassInfo.of(c).isParentOf(value.getClass()))
return (T)value;
try {
if (ClassInfo.of(value.getClass()).isChildOf(Class.class)) {
- if (beanFactory == null)
- beanFactory = DEFAULT_BEAN_FACTORY;
- return beanFactory.createBean((Class<T>)value);
+ if (beanStore == null)
+ beanStore = DEFAULT_BEAN_STORE;
+ return beanStore.createBean((Class<T>)value);
}
} catch (ExecutableException e) {
throw new ConfigException(e, "Could not create bean of type ''{0}''.", value);
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/assertions/Assertion.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/assertions/Assertion.java
index b93bd7e..ae19473 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/assertions/Assertion.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/assertions/Assertion.java
@@ -123,7 +123,7 @@ public class Assertion {
System.err.println(msg); // NOT DEBUG
if (throwable != null) {
try {
- throw BeanFactory.create().build().addBean(Throwable.class, cause).addBean(String.class, msg).addBean(Object[].class, new Object[0]).createBean(throwable);
+ throw BeanStore.create().build().addBean(Throwable.class, cause).addBean(String.class, msg).addBean(Object[].class, new Object[0]).createBean(throwable);
} catch (ExecutableException e) {
throw new RuntimeException(e);
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BeanCreateMethodFinder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BeanCreateMethodFinder.java
index d0fc615..138b52b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BeanCreateMethodFinder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BeanCreateMethodFinder.java
@@ -25,7 +25,7 @@ import org.apache.juneau.reflect.*;
/**
* Used for finding methods on an object that take in arbitrary parameters and returns bean instances.
*
- * See {@link BeanFactory#beanCreateMethodFinder(Class, Object)} for usage.
+ * See {@link BeanStore#beanCreateMethodFinder(Class, Object)} for usage.
*
* @param <T> The bean type being created.
*/
@@ -33,17 +33,17 @@ public class BeanCreateMethodFinder<T> {
private Class<T> beanType;
private final Object resource;
- private final BeanFactory beanFactory;
+ private final BeanStore beanStore;
private MethodInfo method;
private Object[] args;
private Supplier<T> def = ()->null;
- BeanCreateMethodFinder(Class<T> beanType, Object resource, BeanFactory beanFactory) {
+ BeanCreateMethodFinder(Class<T> beanType, Object resource, BeanStore beanStore) {
this.beanType = beanType;
this.resource = resource;
- this.beanFactory = beanFactory;
+ this.beanStore = beanStore;
}
/**
@@ -57,15 +57,15 @@ public class BeanCreateMethodFinder<T> {
* <li>The method name must match exactly.
* <li>The method must not be deprecated or annotated with {@link BeanIgnore}.
* <li>The method must have all parameter types specified in <c>requiredParams</c>.
- * <li>The bean factory must contain beans for all parameter types.
- * <li>The bean factory may contain beans for all {@link Optional} parameter types.
+ * <li>The bean store must contain beans for all parameter types.
+ * <li>The bean store may contain beans for all {@link Optional} parameter types.
* </ul>
*
* <p>
* This method can be called multiple times with different method names or required parameters until a match is found.
* <br>Once a method is found, subsequent calls to this method will be no-ops.
*
- * See {@link BeanFactory#beanCreateMethodFinder(Class, Object)} for usage.
+ * See {@link BeanStore#beanCreateMethodFinder(Class, Object)} for usage.
*
* @param methodName The method name.
* @param requiredParams Optional required parameters.
@@ -76,10 +76,10 @@ public class BeanCreateMethodFinder<T> {
ClassInfo ci = ClassInfo.of(resource);
for (MethodInfo m : ci.getPublicMethods()) {
if (m.isAll(NOT_DEPRECATED) && m.hasReturnType(beanType) && m.getSimpleName().equals(methodName) && (!m.hasAnnotation(BeanIgnore.class))) {
- List<ClassInfo> missing = beanFactory.getMissingParamTypes(m.getParamTypes());
+ List<ClassInfo> missing = beanStore.getMissingParamTypes(m.getParamTypes());
if (missing.isEmpty() && m.hasAllArgs(requiredParams)) {
this.method = m;
- this.args = beanFactory.getParams(m.getParamTypes());
+ this.args = beanStore.getParams(m.getParamTypes());
}
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BeanFactory.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BeanStore.java
similarity index 90%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BeanFactory.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BeanStore.java
index 54b5da1..16e2af5 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BeanFactory.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BeanStore.java
@@ -27,53 +27,56 @@ import org.apache.juneau.internal.*;
import org.apache.juneau.reflect.*;
/**
- * Factory for creating beans.
+ * Java bean store.
+ *
+ * <p>
+ * Used for bean injection.
*/
-public class BeanFactory {
+public class BeanStore {
/**
- * Non-existent bean factory.
+ * Non-existent bean store.
*/
- public static final class Null extends BeanFactory {}
+ public static final class Null extends BeanStore {}
private final Map<Class<?>,Supplier<?>> beanMap = new ConcurrentHashMap<>();
- private final Optional<BeanFactory> parent;
+ private final Optional<BeanStore> parent;
private final Optional<Object> outer;
/**
* Static creator.
*
- * @return A new {@link BeanFactoryBuilder} object.
+ * @return A new {@link BeanStoreBuilder} object.
*/
- public static BeanFactoryBuilder create() {
- return new BeanFactoryBuilder();
+ public static BeanStoreBuilder create() {
+ return new BeanStoreBuilder();
}
/**
* Static creator.
*
- * @param parent Parent bean factory. Can be <jk>null</jk> if this is the root resource.
- * @return A new {@link BeanFactory} object.
+ * @param parent Parent bean store. Can be <jk>null</jk> if this is the root resource.
+ * @return A new {@link BeanStore} object.
*/
- public static BeanFactory of(BeanFactory parent) {
+ public static BeanStore of(BeanStore parent) {
return create().parent(parent).build();
}
/**
* Static creator.
*
- * @param parent Parent bean factory. Can be <jk>null</jk> if this is the root resource.
+ * @param parent Parent bean store. Can be <jk>null</jk> if this is the root resource.
* @param outer The outer bean used when instantiating inner classes. Can be <jk>null</jk>.
- * @return A new {@link BeanFactory} object.
+ * @return A new {@link BeanStore} object.
*/
- public static BeanFactory of(BeanFactory parent, Object outer) {
+ public static BeanStore of(BeanStore parent, Object outer) {
return create().parent(parent).outer(outer).build();
}
/**
* Default constructor.
*/
- public BeanFactory() {
+ public BeanStore() {
this.parent = Optional.empty();
this.outer = Optional.empty();
}
@@ -83,7 +86,7 @@ public class BeanFactory {
*
* @param builder The builder containing the settings for this bean.
*/
- public BeanFactory(BeanFactoryBuilder builder) {
+ public BeanStore(BeanStoreBuilder builder) {
this.parent = Optional.ofNullable(builder.parent);
this.outer = Optional.ofNullable(builder.outer);
}
@@ -122,7 +125,7 @@ public class BeanFactory {
* @param t The bean.
* @return This object (for method chaining).
*/
- public <T> BeanFactory addBean(Class<T> c, T t) {
+ public <T> BeanStore addBean(Class<T> c, T t) {
if (t == null)
beanMap.remove(c);
else
@@ -139,7 +142,7 @@ public class BeanFactory {
* @return This object (for method chaining).
*/
@SuppressWarnings("unchecked")
- public <T> BeanFactory addBeans(Class<T> c, T t) {
+ public <T> BeanStore addBeans(Class<T> c, T t) {
if (t == null)
beanMap.remove(c);
else {
@@ -161,7 +164,7 @@ public class BeanFactory {
* @param t The bean supplier.
* @return This object (for method chaining).
*/
- public <T> BeanFactory addBeanSupplier(Class<T> c, Supplier<T> t) {
+ public <T> BeanStore addBeanSupplier(Class<T> c, Supplier<T> t) {
if (t == null)
beanMap.remove(c);
else
@@ -288,7 +291,7 @@ public class BeanFactory {
* <jk>public class</jk> B {
*
* <jc>// Creator method.</jc>
- * <jc>// Bean factory must have a C bean and optionally a D bean.</jc>
+ * <jc>// Bean store must have a C bean and optionally a D bean.</jc>
* <jk>public</jk> A createA(C <mv>c</mv>, Optional<D> <mv>d</mv>) {
* <jk>return new</jk> A(<mv>c</mv>, <mv>d</mv>.orElse(<jk>null</jk>));
* }
@@ -297,11 +300,11 @@ public class BeanFactory {
* <jc>// Instantiate the bean with the creator method.</jc>
* B <mv>b</mv> = <jk>new</jk> B();
*
- * <jc>// Create a bean factory with some mapped beans.</jc>
- * BeanFactory <mv>beanFactory</mv> = BeanFactory.<jsm>create</jsm>().addBean(C.<jk>class</jk>, <jk>new</jk> C());
+ * <jc>// Create a bean store with some mapped beans.</jc>
+ * BeanStore <mv>beanStore</mv> = BeanStore.<jsm>create</jsm>().addBean(C.<jk>class</jk>, <jk>new</jk> C());
*
* <jc>// Instantiate the bean using the creator method.</jc>
- * A <mv>a</mv> = <mv>beanFactory</mv>
+ * A <mv>a</mv> = <mv>beanStore</mv>
* .beanCreateMethodFinder(A.<jk>class</jk>, <mv>b</mv>) <jc>// Looking for creator for A on b object.</jc>
* .find(<js>"createA"</js>) <jc>// Look for method called "createA".</jc>
* .thenFind(<js>"createA2"</js>) <jc>// Then look for method called "createA2".</jc>
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BeanFactoryBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BeanStoreBuilder.java
similarity index 75%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BeanFactoryBuilder.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BeanStoreBuilder.java
index 77da6ae..2ce8a2f 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BeanFactoryBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/BeanStoreBuilder.java
@@ -18,24 +18,24 @@ import org.apache.juneau.*;
import org.apache.juneau.internal.*;
/**
- * Builder for {@link BeanFactory} objects.
+ * Builder for {@link BeanStore} objects.
*/
@FluentSetters
-public class BeanFactoryBuilder {
+public class BeanStoreBuilder {
- private Class<? extends BeanFactory> implClass;
+ private Class<? extends BeanStore> implClass;
Object outer;
- BeanFactory parent;
+ BeanStore parent;
/**
- * Create a new {@link BeanFactory} using this builder.
+ * Create a new {@link BeanStore} using this builder.
*
- * @return A new {@link BeanFactory}
+ * @return A new {@link BeanStore}
*/
- public BeanFactory build() {
+ public BeanStore build() {
try {
- Class<? extends BeanFactory> ic = isConcrete(implClass) ? implClass : getDefaultImplClass();
- return new BeanFactory().addBeans(BeanFactoryBuilder.class, this).createBean(ic);
+ Class<? extends BeanStore> ic = isConcrete(implClass) ? implClass : getDefaultImplClass();
+ return new BeanStore().addBeans(BeanStoreBuilder.class, this).createBean(ic);
} catch (ExecutableException e) {
throw new RuntimeException(e.getCause().getMessage(), e.getCause());
}
@@ -46,24 +46,24 @@ public class BeanFactoryBuilder {
*
* @return The default implementation class if not specified via {@link #implClass(Class)}.
*/
- protected Class<? extends BeanFactory> getDefaultImplClass() {
- return BeanFactory.class;
+ protected Class<? extends BeanStore> getDefaultImplClass() {
+ return BeanStore.class;
}
/**
- * Specifies a subclass of {@link BeanFactory} to create when the {@link #build()} method is called.
+ * Specifies a subclass of {@link BeanStore} to create when the {@link #build()} method is called.
*
* @param value The new value for this setting.
* @return This object (for method chaining).
*/
@FluentSetter
- public BeanFactoryBuilder implClass(Class<? extends BeanFactory> value) {
+ public BeanStoreBuilder implClass(Class<? extends BeanStore> value) {
this.implClass = value;
return this;
}
/**
- * Specifies the parent bean factory.
+ * Specifies the parent bean store.
*
* <p>
* Bean searches are performed recursively up this parent chain.
@@ -72,7 +72,7 @@ public class BeanFactoryBuilder {
* @return This object (for method chaining).
*/
@FluentSetter
- public BeanFactoryBuilder parent(BeanFactory value) {
+ public BeanStoreBuilder parent(BeanStore value) {
this.parent = value;
return this;
}
@@ -81,7 +81,7 @@ public class BeanFactoryBuilder {
* Specifies the outer bean context.
*
* <p>
- * Used when calling {@link BeanFactory#createBean(Class)} on a non-static inner class.
+ * Used when calling {@link BeanStore#createBean(Class)} on a non-static inner class.
* This should be the instance of the outer object such as the servlet object when constructing inner classes
* of the servlet class.
*
@@ -89,7 +89,7 @@ public class BeanFactoryBuilder {
* @return This object (for method chaining).
*/
@FluentSetter
- public BeanFactoryBuilder outer(Object value) {
+ public BeanStoreBuilder outer(Object value) {
this.outer = value;
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/FileFinder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/FileFinder.java
index 7b32d5d..6b87ad5 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/FileFinder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/FileFinder.java
@@ -69,8 +69,8 @@ import java.util.*;
* Subclasses must provide a public constructor that takes in any of the following arguments:
* <ul>
* <li>{@link FileFinderBuilder} - The builder object.
- * <li>Any beans present in the registered {@link FileFinderBuilder#beanFactory(BeanFactory) bean factory}.
- * <li>Any {@link Optional} beans optionally present in the registered {@link FileFinderBuilder#beanFactory(BeanFactory) bean factory}.
+ * <li>Any beans present in the registered {@link FileFinderBuilder#beanStore(BeanStore) bean store}.
+ * <li>Any {@link Optional} beans optionally present in the registered {@link FileFinderBuilder#beanStore(BeanStore) bean store}.
* </ul>
*/
public interface FileFinder {
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/FileFinderBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/FileFinderBuilder.java
index 91ee1eb..8760ce2 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/FileFinderBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/cp/FileFinderBuilder.java
@@ -34,7 +34,7 @@ public class FileFinderBuilder {
long cachingLimit = -1;
List<Pattern> include = AList.of(Pattern.compile(".*")), exclude = AList.create();
private Class<? extends FileFinder> implClass;
- private BeanFactory beanFactory;
+ private BeanStore beanStore;
/**
* Create a new {@link FileFinder} using this builder.
@@ -44,7 +44,7 @@ public class FileFinderBuilder {
public FileFinder build() {
try {
Class<? extends FileFinder> ic = isConcrete(implClass) ? implClass : getDefaultImplClass();
- return BeanFactory.of(beanFactory).addBeans(FileFinderBuilder.class, this).createBean(ic);
+ return BeanStore.of(beanStore).addBeans(FileFinderBuilder.class, this).createBean(ic);
} catch (ExecutableException e) {
throw new RuntimeException(e.getCause().getMessage(), e.getCause());
}
@@ -142,7 +142,7 @@ public class FileFinderBuilder {
}
/**
- * Specifies the bean factory to use for instantiating the {@link FileFinder} object.
+ * Specifies the bean store to use for instantiating the {@link FileFinder} object.
*
* <p>
* Can be used to instantiate {@link FileFinder} implementations with injected constructor argument beans.
@@ -151,8 +151,8 @@ public class FileFinderBuilder {
* @return This object (for method chaining).
*/
@FluentSetter
- public FileFinderBuilder beanFactory(BeanFactory value) {
- this.beanFactory = value;
+ public FileFinderBuilder beanStore(BeanStore value) {
+ this.beanStore = value;
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/MethodExecStatsBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/MethodExecStatsBuilder.java
index ec4ddeb..6b7afa4 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/MethodExecStatsBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/MethodExecStatsBuilder.java
@@ -30,7 +30,7 @@ public class MethodExecStatsBuilder {
ThrownStore thrownStore;
Class<? extends MethodExecStats> implClass;
- BeanFactory beanFactory;
+ BeanStore beanStore;
/**
* Create a new {@link MethodExecStats} using this builder.
@@ -40,7 +40,7 @@ public class MethodExecStatsBuilder {
public MethodExecStats build() {
try {
Class<? extends MethodExecStats> ic = isConcrete(implClass) ? implClass : getDefaultImplClass();
- return BeanFactory.of(beanFactory).addBeans(MethodExecStatsBuilder.class, this).createBean(ic);
+ return BeanStore.of(beanStore).addBeans(MethodExecStatsBuilder.class, this).createBean(ic);
} catch (ExecutableException e) {
throw new RuntimeException(e);
}
@@ -56,7 +56,7 @@ public class MethodExecStatsBuilder {
}
/**
- * Specifies the bean factory to use for instantiating the {@link MethodExecStats} object.
+ * Specifies the bean store to use for instantiating the {@link MethodExecStats} object.
*
* <p>
* Can be used to instantiate {@link MethodExecStats} implementations with injected constructor argument beans.
@@ -65,8 +65,8 @@ public class MethodExecStatsBuilder {
* @return This object (for method chaining).
*/
@FluentSetter
- public MethodExecStatsBuilder beanFactory(BeanFactory value) {
- this.beanFactory = value;
+ public MethodExecStatsBuilder beanStore(BeanStore value) {
+ this.beanStore = value;
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/MethodExecStore.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/MethodExecStore.java
index dde2dc7..e538b08 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/MethodExecStore.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/MethodExecStore.java
@@ -29,7 +29,7 @@ import org.apache.juneau.cp.*;
public class MethodExecStore {
private final ThrownStore thrownStore;
- private final BeanFactory beanFactory;
+ private final BeanStore beanStore;
private final Class<? extends MethodExecStats> statsImplClass;
private final ConcurrentHashMap<Method,MethodExecStats> db = new ConcurrentHashMap<>();
@@ -55,8 +55,8 @@ public class MethodExecStore {
* @param builder The store to use for storing thrown exception statistics.
*/
public MethodExecStore(MethodExecStoreBuilder builder) {
- this.beanFactory = ofNullable(builder.beanFactory).orElseGet(BeanFactory::new);
- this.thrownStore = ofNullable(builder.thrownStore).orElse(beanFactory.getBean(ThrownStore.class).orElseGet(ThrownStore::new));
+ this.beanStore = ofNullable(builder.beanStore).orElseGet(BeanStore::new);
+ this.thrownStore = ofNullable(builder.thrownStore).orElse(beanStore.getBean(ThrownStore.class).orElseGet(ThrownStore::new));
this.statsImplClass = builder.statsImplClass;
}
@@ -74,7 +74,7 @@ public class MethodExecStore {
if (stats == null) {
stats = MethodExecStats
.create()
- .beanFactory(beanFactory)
+ .beanStore(beanStore)
.implClass(statsImplClass)
.method(m)
.thrownStore(ThrownStore.create().parent(thrownStore).build())
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/MethodExecStoreBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/MethodExecStoreBuilder.java
index b6081c1..5309669 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/MethodExecStoreBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/MethodExecStoreBuilder.java
@@ -26,7 +26,7 @@ public class MethodExecStoreBuilder {
ThrownStore thrownStore;
private Class<? extends MethodExecStore> implClass;
- BeanFactory beanFactory;
+ BeanStore beanStore;
Class<? extends MethodExecStats> statsImplClass;
/**
@@ -37,7 +37,7 @@ public class MethodExecStoreBuilder {
public MethodExecStore build() {
try {
Class<? extends MethodExecStore> ic = isConcrete(implClass) ? implClass : getDefaultImplClass();
- return BeanFactory.of(beanFactory).addBeans(MethodExecStoreBuilder.class, this).createBean(ic);
+ return BeanStore.of(beanStore).addBeans(MethodExecStoreBuilder.class, this).createBean(ic);
} catch (ExecutableException e) {
throw new RuntimeException(e);
}
@@ -53,7 +53,7 @@ public class MethodExecStoreBuilder {
}
/**
- * Specifies the bean factory to use for instantiating the {@link MethodExecStore} object.
+ * Specifies the bean store to use for instantiating the {@link MethodExecStore} object.
*
* <p>
* Can be used to instantiate {@link MethodExecStore} implementations with injected constructor argument beans.
@@ -62,8 +62,8 @@ public class MethodExecStoreBuilder {
* @return This object (for method chaining).
*/
@FluentSetter
- public MethodExecStoreBuilder beanFactory(BeanFactory value) {
- this.beanFactory = value;
+ public MethodExecStoreBuilder beanStore(BeanStore value) {
+ this.beanStore = value;
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/ThrownStatsBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/ThrownStatsBuilder.java
index a423aaa..e76b782 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/ThrownStatsBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/ThrownStatsBuilder.java
@@ -32,7 +32,7 @@ public class ThrownStatsBuilder {
ThrownStats causedBy;
Class<? extends ThrownStats> implClass;
- BeanFactory beanFactory;
+ BeanStore beanStore;
/**
* Create a new {@link ThrownStats} using this builder.
@@ -42,7 +42,7 @@ public class ThrownStatsBuilder {
public ThrownStats build() {
try {
Class<? extends ThrownStats> ic = isConcrete(implClass) ? implClass : getDefaultImplClass();
- return BeanFactory.of(beanFactory).addBeans(ThrownStatsBuilder.class, this).createBean(ic);
+ return BeanStore.of(beanStore).addBeans(ThrownStatsBuilder.class, this).createBean(ic);
} catch (ExecutableException e) {
throw new RuntimeException(e);
}
@@ -58,7 +58,7 @@ public class ThrownStatsBuilder {
}
/**
- * Specifies the bean factory to use for instantiating the {@link ThrownStats} object.
+ * Specifies the bean store to use for instantiating the {@link ThrownStats} object.
*
* <p>
* Can be used to instantiate {@link ThrownStats} implementations with injected constructor argument beans.
@@ -67,8 +67,8 @@ public class ThrownStatsBuilder {
* @return This object (for method chaining).
*/
@FluentSetter
- public ThrownStatsBuilder beanFactory(BeanFactory value) {
- this.beanFactory = value;
+ public ThrownStatsBuilder beanStore(BeanStore value) {
+ this.beanStore = value;
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/ThrownStore.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/ThrownStore.java
index a6b581b..0deeb9b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/ThrownStore.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/ThrownStore.java
@@ -36,7 +36,7 @@ public class ThrownStore {
private final ConcurrentHashMap<Long,ThrownStats> db = new ConcurrentHashMap<>();
private final Optional<ThrownStore> parent;
- private final BeanFactory beanFactory;
+ private final BeanStore beanStore;
private final Class<? extends ThrownStats> statsImplClass;
private final Set<String> ignoreClasses;
@@ -63,7 +63,7 @@ public class ThrownStore {
*/
public ThrownStore(ThrownStoreBuilder builder) {
this.parent = ofNullable(builder.parent);
- this.beanFactory = ofNullable(builder.beanFactory).orElseGet(BeanFactory::new);
+ this.beanStore = ofNullable(builder.beanStore).orElseGet(BeanStore::new);
this.statsImplClass = firstNonNull(builder.statsImplClass, parent.isPresent() ? parent.get().statsImplClass : null, null);
@@ -208,7 +208,7 @@ public class ThrownStore {
if (stc == null) {
stc = ThrownStats
.create()
- .beanFactory(beanFactory)
+ .beanStore(beanStore)
.implClass(statsImplClass)
.throwable(t)
.hash(hash)
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/ThrownStoreBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/ThrownStoreBuilder.java
index d2d1c32..bc26d97 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/ThrownStoreBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/mstat/ThrownStoreBuilder.java
@@ -29,7 +29,7 @@ public class ThrownStoreBuilder {
ThrownStore parent;
private Class<? extends ThrownStore> implClass;
- BeanFactory beanFactory;
+ BeanStore beanStore;
Class<? extends ThrownStats> statsImplClass;
Set<Class<?>> ignoreClasses;
@@ -41,7 +41,7 @@ public class ThrownStoreBuilder {
public ThrownStore build() {
try {
Class<? extends ThrownStore> ic = isConcrete(implClass) ? implClass : getDefaultImplClass();
- return BeanFactory.of(beanFactory).addBeans(ThrownStoreBuilder.class, this).createBean(ic);
+ return BeanStore.of(beanStore).addBeans(ThrownStoreBuilder.class, this).createBean(ic);
} catch (ExecutableException e) {
throw new RuntimeException(e);
}
@@ -57,7 +57,7 @@ public class ThrownStoreBuilder {
}
/**
- * Specifies the bean factory to use for instantiating the {@link ThrownStore} object.
+ * Specifies the bean store to use for instantiating the {@link ThrownStore} object.
*
* <p>
* Can be used to instantiate {@link ThrownStore} implementations with injected constructor argument beans.
@@ -66,8 +66,8 @@ public class ThrownStoreBuilder {
* @return This object (for method chaining).
*/
@FluentSetter
- public ThrownStoreBuilder beanFactory(BeanFactory value) {
- this.beanFactory = value;
+ public ThrownStoreBuilder beanStore(BeanStore value) {
+ this.beanStore = value;
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolver.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolver.java
index e43c90a..ca5d917 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolver.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolver.java
@@ -101,8 +101,8 @@ public class VarResolver {
* @param vars The var classes
* @param contextObjects
*/
- VarResolver(Var[] vars, BeanFactory beanFactory) {
- this.ctx = new VarResolverContext(vars, beanFactory);
+ VarResolver(Var[] vars, BeanStore beanStore) {
+ this.ctx = new VarResolverContext(vars, beanStore);
}
/**
@@ -113,7 +113,7 @@ public class VarResolver {
public VarResolverBuilder builder() {
return new VarResolverBuilder()
.vars(ctx.getVars())
- .beanFactory(ctx.beanFactory);
+ .beanStore(ctx.beanStore);
}
/**
@@ -135,13 +135,13 @@ public class VarResolver {
}
/**
- * Same as {@link #createSession()} except allows you to specify a bean factory for resolving beans.
+ * Same as {@link #createSession()} except allows you to specify a bean store for resolving beans.
*
- * @param beanFactory The bean factory to associate with this session.
+ * @param beanStore The bean store to associate with this session.
* @return A new resolver session.
*/
- public VarResolverSession createSession(BeanFactory beanFactory) {
- return new VarResolverSession(ctx, beanFactory);
+ public VarResolverSession createSession(BeanStore beanStore) {
+ return new VarResolverSession(ctx, beanStore);
}
/**
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverBuilder.java
index bdf13fa..82f9511 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverBuilder.java
@@ -30,7 +30,7 @@ import org.apache.juneau.svl.vars.*;
public class VarResolverBuilder {
private final List<Var> vars = AList.create();
- private BeanFactory beanFactory = new BeanFactory();
+ private BeanStore beanStore = new BeanStore();
/**
* Create a new var resolver using the settings in this builder.
@@ -38,7 +38,7 @@ public class VarResolverBuilder {
* @return A new var resolver.
*/
public VarResolver build() {
- return new VarResolver(vars.toArray(new Var[vars.size()]), beanFactory);
+ return new VarResolver(vars.toArray(new Var[vars.size()]), beanStore);
}
/**
@@ -127,18 +127,18 @@ public class VarResolverBuilder {
}
/**
- * Associates a bean factory with this builder.
+ * Associates a bean store with this builder.
*
- * @param value The bean factory to associate with this var resolver.
+ * @param value The bean store to associate with this var resolver.
* @return This object (for method chaining).
*/
- public VarResolverBuilder beanFactory(BeanFactory value) {
- this.beanFactory = BeanFactory.of(value);
+ public VarResolverBuilder beanStore(BeanStore value) {
+ this.beanStore = BeanStore.of(value);
return this;
}
/**
- * Adds a bean to the bean factory in this session.
+ * Adds a bean to the bean store in this session.
*
* @param <T> The bean type.
* @param c The bean type.
@@ -146,7 +146,7 @@ public class VarResolverBuilder {
* @return This object (for method chaining).
*/
public <T> VarResolverBuilder bean(Class<T> c, T value) {
- beanFactory.addBean(c, value);
+ beanStore.addBean(c, value);
return this;
}
}
\ No newline at end of file
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverContext.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverContext.java
index 0645a37..10ee08b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverContext.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverContext.java
@@ -32,15 +32,15 @@ public class VarResolverContext {
private final Var[] vars;
private final Map<String,Var> varMap;
- final BeanFactory beanFactory;
+ final BeanStore beanStore;
/**
* Constructor.
*
* @param vars The Var classes used for resolving string variables.
- * @param beanFactory Used to resolve beans needed by individual vars.
+ * @param beanStore Used to resolve beans needed by individual vars.
*/
- public VarResolverContext(Var[] vars, BeanFactory beanFactory) {
+ public VarResolverContext(Var[] vars, BeanStore beanStore) {
this.vars = vars;
@@ -49,7 +49,7 @@ public class VarResolverContext {
m.put(v.getName(), v);
this.varMap = AMap.unmodifiable(m);
- this.beanFactory = BeanFactory.of(beanFactory);
+ this.beanStore = BeanStore.of(beanStore);
}
/**
@@ -79,7 +79,7 @@ public class VarResolverContext {
* @return This object (for method chaining).
*/
public <T> VarResolverContext addBean(Class<T> c, T value) {
- beanFactory.addBean(c, value);
+ beanStore.addBean(c, value);
return this;
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverSession.java
index eb42f80..31b9206 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverSession.java
@@ -32,7 +32,7 @@ import org.apache.juneau.internal.*;
*
* <p>
* Instances of this class are created through the {@link VarResolver#createSession()} and
- * {@link VarResolver#createSession(BeanFactory)} methods.
+ * {@link VarResolver#createSession(BeanStore)} methods.
*
* <p>
* Instances of this class are NOT guaranteed to be thread safe.
@@ -44,7 +44,7 @@ import org.apache.juneau.internal.*;
public class VarResolverSession {
private final VarResolverContext context;
- private final BeanFactory beanFactory;
+ private final BeanStore beanStore;
/**
* Constructor.
@@ -52,12 +52,12 @@ public class VarResolverSession {
* @param context
* The {@link VarResolver} context object that contains the {@link Var Vars} and context objects associated with
* that resolver.
- * @param beanFactory The bean factory to use for resolving beans needed by vars.
+ * @param beanStore The bean store to use for resolving beans needed by vars.
*
*/
- public VarResolverSession(VarResolverContext context, BeanFactory beanFactory) {
+ public VarResolverSession(VarResolverContext context, BeanStore beanStore) {
this.context = context;
- this.beanFactory = BeanFactory.of(beanFactory);
+ this.beanStore = BeanStore.of(beanStore);
}
/**
@@ -366,7 +366,7 @@ public class VarResolverSession {
;
/**
- * Returns the bean from the registered bean factory.
+ * Returns the bean from the registered bean store.
*
* @param c The bean type.
* @return
@@ -374,9 +374,9 @@ public class VarResolverSession {
* <br>Never <jk>null</jk>.
*/
public <T> Optional<T> getBean(Class<T> c) {
- Optional<T> t = beanFactory.getBean(c);
+ Optional<T> t = beanStore.getBean(c);
if (! t.isPresent())
- t = context.beanFactory.getBean(c);
+ t = context.beanStore.getBean(c);
return t;
}
@@ -413,12 +413,12 @@ public class VarResolverSession {
* @return This object (for method chaining).
*/
public <T> VarResolverSession bean(Class<T> c, T value) {
- beanFactory.addBean(c, value);
+ beanStore.addBean(c, value);
return this;
}
@Override /* Object */
public String toString() {
- return "var=" + this.context.getVarMap().keySet() + ", context.beanFactory=" + this.context.beanFactory + ", session.beanFactory=" + beanFactory;
+ return "var=" + this.context.getVarMap().keySet() + ", context.beanStore=" + this.context.beanStore + ", session.beanStore=" + beanStore;
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/MethodInvoker.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/MethodInvoker.java
index 1a832c1..47d9053 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/MethodInvoker.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/MethodInvoker.java
@@ -73,18 +73,18 @@ public class MethodInvoker {
}
/**
- * Invokes the wrapped method using parameters from the specified bean factory.
+ * Invokes the wrapped method using parameters from the specified bean store.
*
- * @param beanFactory The bean factory to use to resolve parameters.
+ * @param beanStore The bean store to use to resolve parameters.
* @param o The object to invoke the method on.
* @return The result of invoking the method.
* @throws ExecutableException If error occurred trying to invoke the method.
*/
- public Object invokeUsingFactory(BeanFactory beanFactory, Object o) throws ExecutableException {
+ public Object invokeUsingFactory(BeanStore beanStore, Object o) throws ExecutableException {
List<ClassInfo> missing;
- missing = beanFactory.getMissingParamTypes(m.getParamTypes());
+ missing = beanStore.getMissingParamTypes(m.getParamTypes());
if (missing.isEmpty())
- return invoke(o, beanFactory.getParams(m.getParamTypes()));
+ return invoke(o, beanStore.getParams(m.getParamTypes()));
throw new ExecutableException("Could not find prerequisites to invoke method ''{0}'': {1}", getFullName(), missing.stream().map(x->x.getSimpleName()).collect(Collectors.joining(",")));
}
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
index 0ebeeb3..5a3cd8b 100644
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
+++ b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
@@ -2074,13 +2074,13 @@ public class RestClient extends BeanContext implements HttpClient, Closeable, Re
}
this.parsers = pgb.build();
- BeanFactory bf = new BeanFactory()
+ BeanStore bs = new BeanStore()
.addBean(ContextProperties.class, cp)
.addBean(RestClient.class, this);
this.urlEncodingSerializer = new SerializerBuilder(cp).build(UrlEncodingSerializer.class);
- this.partSerializer = cp.getInstance(RESTCLIENT_partSerializer, HttpPartSerializer.class, bf).orElseGet(bf.createBeanSupplier(OpenApiSerializer.class));
- this.partParser = cp.getInstance(RESTCLIENT_partParser, HttpPartParser.class, bf).orElseGet(bf.createBeanSupplier(OpenApiParser.class));
+ this.partSerializer = cp.getInstance(RESTCLIENT_partSerializer, HttpPartSerializer.class, bs).orElseGet(bs.createBeanSupplier(OpenApiSerializer.class));
+ this.partParser = cp.getInstance(RESTCLIENT_partParser, HttpPartParser.class, bs).orElseGet(bs.createBeanSupplier(OpenApiParser.class));
this.executorService = cp.getInstance(RESTCLIENT_executorService, ExecutorService.class).orElse(null);
HttpPartSerializerSession partSerializerSession = partSerializer.createPartSession(null);
@@ -2112,7 +2112,7 @@ public class RestClient extends BeanContext implements HttpClient, Closeable, Re
formData.add(BasicNameValuePair.cast(o));
}
- this.callHandler = cp.getInstance(RESTCLIENT_callHandler, RestCallHandler.class, bf).orElseGet(bf.createBeanSupplier(BasicRestCallHandler.class));
+ this.callHandler = cp.getInstance(RESTCLIENT_callHandler, RestCallHandler.class, bs).orElseGet(bs.createBeanSupplier(BasicRestCallHandler.class));
this.interceptors = cp.getInstanceArray(RESTCLIENT_interceptors, RestCallInterceptor.class).orElse(new RestCallInterceptor[0]);
diff --git a/juneau-rest/juneau-rest-server-springboot/src/main/java/org/apache/juneau/rest/springboot/SpringBeanFactory.java b/juneau-rest/juneau-rest-server-springboot/src/main/java/org/apache/juneau/rest/springboot/SpringBeanStore.java
similarity index 85%
rename from juneau-rest/juneau-rest-server-springboot/src/main/java/org/apache/juneau/rest/springboot/SpringBeanFactory.java
rename to juneau-rest/juneau-rest-server-springboot/src/main/java/org/apache/juneau/rest/springboot/SpringBeanStore.java
index c8c3eea..951f50e 100644
--- a/juneau-rest/juneau-rest-server-springboot/src/main/java/org/apache/juneau/rest/springboot/SpringBeanFactory.java
+++ b/juneau-rest/juneau-rest-server-springboot/src/main/java/org/apache/juneau/rest/springboot/SpringBeanStore.java
@@ -14,13 +14,13 @@ package org.apache.juneau.rest.springboot;
import java.util.*;
-import org.apache.juneau.cp.BeanFactory;
+import org.apache.juneau.cp.BeanStore;
import org.springframework.context.*;
/**
- * A bean factory that uses Spring bean resolution to find beans if they're not already in this factory.
+ * A bean store that uses Spring bean resolution to find beans if they're not already in this store.
*/
-public class SpringBeanFactory extends BeanFactory {
+public class SpringBeanStore extends BeanStore {
private final Optional<ApplicationContext> appContext;
@@ -28,10 +28,10 @@ public class SpringBeanFactory extends BeanFactory {
* Constructor.
*
* @param appContext The Spring application context used to resolve beans.
- * @param parent The parent REST object bean factory. Can be <jk>null</jk>.
+ * @param parent The parent REST object bean store. Can be <jk>null</jk>.
* @param resource The REST object. Can be <jk>null</jk>.
*/
- public SpringBeanFactory(Optional<ApplicationContext> appContext, Optional<BeanFactory> parent, Object resource) {
+ public SpringBeanStore(Optional<ApplicationContext> appContext, Optional<BeanStore> parent, Object resource) {
super(create().parent(parent.orElse(null)).outer(resource));
this.appContext = appContext;
}
diff --git a/juneau-rest/juneau-rest-server-springboot/src/main/java/org/apache/juneau/rest/springboot/SpringRestServlet.java b/juneau-rest/juneau-rest-server-springboot/src/main/java/org/apache/juneau/rest/springboot/SpringRestServlet.java
index 5a4079c..a3c4eb0 100644
--- a/juneau-rest/juneau-rest-server-springboot/src/main/java/org/apache/juneau/rest/springboot/SpringRestServlet.java
+++ b/juneau-rest/juneau-rest-server-springboot/src/main/java/org/apache/juneau/rest/springboot/SpringRestServlet.java
@@ -31,7 +31,7 @@ public abstract class SpringRestServlet extends RestServlet {
private Optional<ApplicationContext> appContext;
@Override /* RestServlet */
- public BeanFactory createBeanFactory(Optional<BeanFactory> parent) {
- return new SpringBeanFactory(appContext, parent, this);
+ public BeanStore createBeanStore(Optional<BeanStore> parent) {
+ return new SpringBeanStore(appContext, parent, this);
}
}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicSwaggerProvider.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicSwaggerProvider.java
index 39bc1c3..5164369 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicSwaggerProvider.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/BasicSwaggerProvider.java
@@ -39,9 +39,9 @@ public class BasicSwaggerProvider implements SwaggerProvider {
* @param builder The builder containing the settings for this Swagger provider.
*/
public BasicSwaggerProvider(SwaggerProviderBuilder builder) {
- BeanFactory bf = builder.beanFactory;
- this.vr = firstNonNull(builder.varResolver, bf.getBean(VarResolver.class).orElse(VarResolver.DEFAULT));
- this.js = firstNonNull(builder.jsonSchemaGenerator, bf.getBean(JsonSchemaGenerator.class).orElse(JsonSchemaGenerator.DEFAULT));
+ BeanStore bs = builder.beanStore;
+ this.vr = firstNonNull(builder.varResolver, bs.getBean(VarResolver.class).orElse(VarResolver.DEFAULT));
+ this.js = firstNonNull(builder.jsonSchemaGenerator, bs.getBean(JsonSchemaGenerator.class).orElse(JsonSchemaGenerator.DEFAULT));
this.messages = builder.messages;
this.fileFinder = builder.fileFinder;
}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/DebugEnablementBuilder.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/DebugEnablementBuilder.java
index a6ca5a7..5b9a54d 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/DebugEnablementBuilder.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/DebugEnablementBuilder.java
@@ -33,7 +33,7 @@ public class DebugEnablementBuilder {
ReflectionMapBuilder<Enablement> mapBuilder = new ReflectionMapBuilder<>();
private Class<? extends DebugEnablement> implClass;
Enablement defaultEnablement = NEVER;
- BeanFactory beanFactory;
+ BeanStore beanStore;
Predicate<HttpServletRequest> conditionalPredicate = x -> "true".equalsIgnoreCase(x.getHeader("Debug"));
/**
@@ -48,7 +48,7 @@ public class DebugEnablementBuilder {
public DebugEnablement build() {
try {
Class<? extends DebugEnablement> ic = isConcrete(implClass) ? implClass : getDefaultImplClass();
- return BeanFactory.of(beanFactory).addBeans(DebugEnablementBuilder.class, this).createBean(ic);
+ return BeanStore.of(beanStore).addBeans(DebugEnablementBuilder.class, this).createBean(ic);
} catch (Exception e) {
throw toHttpException(e, InternalServerError.class);
}
@@ -64,13 +64,13 @@ public class DebugEnablementBuilder {
}
/**
- * Specifies the bean factory to use for instantiating the {@link DebugEnablement} object.
+ * Specifies the bean store to use for instantiating the {@link DebugEnablement} object.
*
* @param value The new value for this setting.
* @return This object (for method chaining).
*/
- public DebugEnablementBuilder beanFactory(BeanFactory value) {
- this.beanFactory = value;
+ public DebugEnablementBuilder beanStore(BeanStore value) {
+ this.beanStore = value;
return this;
}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestCall.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestCall.java
index 270bac7..f3d84ae 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestCall.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestCall.java
@@ -47,7 +47,7 @@ public class RestCall {
private String pathInfoUndecoded;
private long startTime = System.currentTimeMillis();
private RestLogger logger;
- private BeanFactory beanFactory;
+ private BeanStore beanStore;
private Map<String,String[]> queryParams;
private String method;
@@ -64,8 +64,8 @@ public class RestCall {
public RestCall(Object resource, RestContext context, HttpServletRequest req, HttpServletResponse res) {
this.context = context;
this.resource = resource;
- beanFactory = BeanFactory.of(context.getRootBeanFactory(), resource);
- beanFactory.addBean(RestContext.class, context);
+ beanStore = BeanStore.of(context.getRootBeanStore(), resource);
+ beanStore.addBean(RestContext.class, context);
request(req).response(res);
}
@@ -94,7 +94,7 @@ public class RestCall {
req = value;
urlPath = null;
pathInfoUndecoded = null;
- beanFactory.addBean(HttpServletRequest.class, value);
+ beanStore.addBean(HttpServletRequest.class, value);
return this;
}
@@ -106,7 +106,7 @@ public class RestCall {
*/
public RestCall response(HttpServletResponse value) {
res = value;
- beanFactory.addBean(HttpServletResponse.class, value);
+ beanStore.addBean(HttpServletResponse.class, value);
return this;
}
@@ -122,11 +122,11 @@ public class RestCall {
*/
public RestCall restOperationContext(RestOperationContext value) throws Exception {
opContext = value;
- beanFactory.addBean(RestOperationContext.class, value);
+ beanStore.addBean(RestOperationContext.class, value);
rreq = context.createRequest(this);
- beanFactory.addBean(RestRequest.class, rreq);
+ beanStore.addBean(RestRequest.class, rreq);
rres = context.createResponse(this);
- beanFactory.addBean(RestResponse.class, rres);
+ beanStore.addBean(RestResponse.class, rres);
return this;
}
@@ -138,7 +138,7 @@ public class RestCall {
*/
public RestCall logger(RestLogger value) {
logger = value;
- beanFactory.addBean(RestLogger.class, value);
+ beanStore.addBean(RestLogger.class, value);
return this;
}
@@ -199,7 +199,7 @@ public class RestCall {
*/
public RestCall exception(Throwable value) {
req.setAttribute("Exception", value);
- beanFactory.addBean(Throwable.class, value);
+ beanStore.addBean(Throwable.class, value);
return this;
}
@@ -235,7 +235,7 @@ public class RestCall {
*/
public RestCall urlPathMatch(UrlPathMatch value) {
urlPathMatch = value;
- beanFactory.addBean(UrlPathMatch.class, value);
+ beanStore.addBean(UrlPathMatch.class, value);
return this;
}
@@ -291,12 +291,12 @@ public class RestCall {
}
/**
- * Returns the bean factory of this call.
+ * Returns the bean store of this call.
*
- * @return The bean factory of this call.
+ * @return The bean store of this call.
*/
- public BeanFactory getBeanFactory() {
- return beanFactory;
+ public BeanStore getBeanStore() {
+ return beanStore;
}
/**
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestChild.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestChild.java
index e5e57f3..5b903ea 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestChild.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestChild.java
@@ -48,7 +48,7 @@ public class RestChild {
* @param path The child resource path relative to the parent resource URI.
* @param resource
* The child resource.
- * <br>Can either be a Class (which will be instantiated using the registered {@link BeanFactory})
+ * <br>Can either be a Class (which will be instantiated using the registered {@link BeanStore})
* or an already-instantiated object.
*/
public RestChild(/*UrlPathPattern path, */ String path, Object resource) {
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestChildrenBuilder.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestChildrenBuilder.java
index 3c595ba..d0f79de 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestChildrenBuilder.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestChildrenBuilder.java
@@ -28,7 +28,7 @@ public class RestChildrenBuilder {
final List<RestContext> list = AList.create();
- private BeanFactory beanFactory;
+ private BeanStore beanStore;
private Class<? extends RestChildren> implClass;
/**
@@ -39,7 +39,7 @@ public class RestChildrenBuilder {
public RestChildren build() {
try {
Class<? extends RestChildren> ic = firstNonNull(implClass, getDefaultImplClass());
- return BeanFactory.of(beanFactory).addBeans(RestChildrenBuilder.class, this).createBean(ic);
+ return BeanStore.of(beanStore).addBeans(RestChildrenBuilder.class, this).createBean(ic);
} catch (Exception e) {
throw toHttpException(e, InternalServerError.class);
}
@@ -75,8 +75,8 @@ public class RestChildrenBuilder {
* The subclass must have a public constructor that takes in any of the following arguments:
* <ul>
* <li>{@link RestChildrenBuilder} - This object.
- * <li>Any beans found in the specified {@link #beanFactory(BeanFactory) bean factory}.
- * <li>Any {@link Optional} beans that may or may not be found in the specified {@link #beanFactory(BeanFactory) bean factory}.
+ * <li>Any beans found in the specified {@link #beanStore(BeanStore) bean store}.
+ * <li>Any {@link Optional} beans that may or may not be found in the specified {@link #beanStore(BeanStore) bean store}.
* </ul>
*
* @param implClass The implementation class to build.
@@ -88,13 +88,13 @@ public class RestChildrenBuilder {
}
/**
- * Specifies a {@link BeanFactory} to use when resolving constructor arguments.
+ * Specifies a {@link BeanStore} to use when resolving constructor arguments.
*
- * @param beanFactory The bean factory to use for resolving constructor arguments.
+ * @param value The bean store to use for resolving constructor arguments.
* @return This object (for method chaining).
*/
- public RestChildrenBuilder beanFactory(BeanFactory beanFactory) {
- this.beanFactory = beanFactory;
+ public RestChildrenBuilder beanStore(BeanStore value) {
+ this.beanStore = value;
return this;
}
}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
index 2e2ae4a..f1c64dc 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
@@ -318,27 +318,27 @@ public class RestContext extends BeanContext {
public static final String REST_allowedMethodParams = PREFIX + ".allowedMethodParams.s";
/**
- * Configuration property: Bean factory.
+ * Configuration property: Bean store.
*
* <h5 class='section'>Property:</h5>
* <ul class='spaced-list'>
- * <li><b>ID:</b> {@link org.apache.juneau.rest.RestContext#REST_beanFactory REST_beanFactory}
- * <li><b>Name:</b> <js>"RestContext.beanFactory.o"</js>
+ * <li><b>ID:</b> {@link org.apache.juneau.rest.RestContext#REST_beanStore REST_beanStore}
+ * <li><b>Name:</b> <js>"RestContext.beanStore.o"</js>
* <li><b>Data type:</b>
* <ul>
- * <li>{@link org.apache.juneau.cp.BeanFactory}
- * <li><c>Class<{@link org.apache.juneau.cp.BeanFactory}></c>
+ * <li>{@link org.apache.juneau.cp.BeanStore}
+ * <li><c>Class<{@link org.apache.juneau.cp.BeanStore}></c>
* </ul>
- * <li><b>Default:</b> {@link org.apache.juneau.cp.BeanFactory}
+ * <li><b>Default:</b> {@link org.apache.juneau.cp.BeanStore}
* <li><b>Session property:</b> <jk>false</jk>
* <li><b>Annotations:</b>
* <ul>
- * <li class='ja'>{@link org.apache.juneau.rest.annotation.Rest#beanFactory()}
+ * <li class='ja'>{@link org.apache.juneau.rest.annotation.Rest#beanStore()}
* </ul>
* <li><b>Methods:</b>
* <ul>
- * <li class='jm'>{@link org.apache.juneau.rest.RestContextBuilder#beanFactory(Class)}
- * <li class='jm'>{@link org.apache.juneau.rest.RestContextBuilder#beanFactory(BeanFactory)}
+ * <li class='jm'>{@link org.apache.juneau.rest.RestContextBuilder#beanStore(Class)}
+ * <li class='jm'>{@link org.apache.juneau.rest.RestContextBuilder#beanStore(BeanStore)}
* </ul>
* </ul>
*
@@ -353,14 +353,14 @@ public class RestContext extends BeanContext {
* </ul>
*
* <p>
- * Note that the <c>SpringRestServlet</c> classes uses the <c>SpringBeanFactory</c> class to allow for any
+ * Note that the <c>SpringRestServlet</c> classes uses the <c>SpringBeanStore</c> class to allow for any
* Spring beans to be injected into your REST resources.
*
* <ul class='seealso'>
* <li class='link'>{@doc RestInjection}
* </ul>
*/
- public static final String REST_beanFactory = PREFIX + ".beanFactory.o";
+ public static final String REST_beanStore = PREFIX + ".beanStore.o";
/**
* Configuration property: REST call logger.
@@ -579,8 +579,8 @@ public class RestContext extends BeanContext {
*
* <ul class='notes'>
* <li>
- * When defined as classes, instances are resolved using the registered {@link #REST_beanFactory} which
- * by default is {@link BeanFactory} which requires the class have one of the following
+ * When defined as classes, instances are resolved using the registered {@link #REST_beanStore} which
+ * by default is {@link BeanStore} which requires the class have one of the following
* constructors:
* <ul>
* <li><code><jk>public</jk> T(RestContextBuilder)</code>
@@ -762,8 +762,8 @@ public class RestContext extends BeanContext {
* The subclass must have a public constructor that takes in any of the following arguments:
* <ul>
* <li>{@link RestContextBuilder} - The builder for the object.
- * <li>Any beans found in the specified {@link #REST_beanFactory bean factory}.
- * <li>Any {@link Optional} beans that may or may not be found in the specified {@link #REST_beanFactory bean factory}.
+ * <li>Any beans found in the specified {@link #REST_beanStore bean store}.
+ * <li>Any {@link Optional} beans that may or may not be found in the specified {@link #REST_beanStore bean store}.
* </ul>
*
* <h5 class='section'>Example:</h5>
@@ -782,9 +782,9 @@ public class RestContext extends BeanContext {
*
* <jc>// Override the method used to create default request attributes.</jc>
* <ja>@Override</ja>
- * <jk>protected</jk> NamedAttributeList createDefaultRequestAttributes(Object <jv>resource</jv>, BeanFactory <jv>beanFactory</jv>) <jk>throws</jk> Exception {
+ * <jk>protected</jk> NamedAttributeList createDefaultRequestAttributes(Object <jv>resource</jv>, BeanStore <jv>beanStore</jv>) <jk>throws</jk> Exception {
* <jk>return super</jk>
- * .createDefaultRequestAttributes(<jv>resource</jv>, <jv>beanFactory</jv>)
+ * .createDefaultRequestAttributes(<jv>resource</jv>, <jv>beanStore</jv>)
* .append(NamedAttribute.<jsm>of</jsm>(<js>"foo"</js>, ()-><jf>fooSupplier</jf>.get());
* }
* }
@@ -1456,7 +1456,7 @@ public class RestContext extends BeanContext {
* <ul>
* <li class='jm'>{@link org.apache.juneau.rest.RestContextBuilder#fileFinder(Class)}
* <li class='jm'>{@link org.apache.juneau.rest.RestContextBuilder#fileFinder(FileFinder)}
- * <li class='jm'>{@link org.apache.juneau.rest.RestContext#createFileFinder(Object,ContextProperties,BeanFactory)}
+ * <li class='jm'>{@link org.apache.juneau.rest.RestContext#createFileFinder(Object,ContextProperties,BeanStore)}
* </ul>
* </ul>
*
@@ -1475,7 +1475,7 @@ public class RestContext extends BeanContext {
* </ul>
*
* <p>
- * The file finder is instantiated via the {@link RestContext#createFileFinder(Object,ContextProperties,BeanFactory)} method which in turn instantiates
+ * The file finder is instantiated via the {@link RestContext#createFileFinder(Object,ContextProperties,BeanStore)} method which in turn instantiates
* based on the following logic:
* <ul>
* <li>Returns the resource class itself if it's an instance of {@link FileFinder}.
@@ -2390,8 +2390,8 @@ public class RestContext extends BeanContext {
* The subclass must have a public constructor that takes in any of the following arguments:
* <ul>
* <li>{@link RestChildrenBuilder} - The builder for the object.
- * <li>Any beans found in the specified {@link #REST_beanFactory bean factory}.
- * <li>Any {@link Optional} beans that may or may not be found in the specified {@link #REST_beanFactory bean factory}.
+ * <li>Any beans found in the specified {@link #REST_beanStore bean store}.
+ * <li>Any {@link Optional} beans that may or may not be found in the specified {@link #REST_beanStore bean store}.
* </ul>
*
* <h5 class='section'>Example:</h5>
@@ -2460,8 +2460,8 @@ public class RestContext extends BeanContext {
* The subclass must have a public constructor that takes in any of the following arguments:
* <ul>
* <li>{@link RestOperationContextBuilder} - The builder for the object.
- * <li>Any beans found in the specified {@link #REST_beanFactory bean factory}.
- * <li>Any {@link Optional} beans that may or may not be found in the specified {@link #REST_beanFactory bean factory}.
+ * <li>Any beans found in the specified {@link #REST_beanStore bean store}.
+ * <li>Any {@link Optional} beans that may or may not be found in the specified {@link #REST_beanStore bean store}.
* </ul>
*
* <h5 class='section'>Example:</h5>
@@ -2480,9 +2480,9 @@ public class RestContext extends BeanContext {
*
* <jc>// Override the method used to create default request attributes.</jc>
* <ja>@Override</ja>
- * <jk>protected</jk> NamedAttributeList createDefaultRequestAttributes(Object <jv>resource</jv>, BeanFactory <jv>beanFactory</jv>, Method <jv>method</jv>, RestContext <jv>context</jv>) <jk>throws</jk> Exception {
+ * <jk>protected</jk> NamedAttributeList createDefaultRequestAttributes(Object <jv>resource</jv>, BeanStore <jv>beanStore</jv>, Method <jv>method</jv>, RestContext <jv>context</jv>) <jk>throws</jk> Exception {
* <jk>return super</jk>
- * .createDefaultRequestAttributes(<jv>resource</jv>, <jv>beanFactory</jv>, <jv>method</jv>, <jv>context</jv>)
+ * .createDefaultRequestAttributes(<jv>resource</jv>, <jv>beanStore</jv>, <jv>method</jv>, <jv>context</jv>)
* .append(NamedAttribute.<jsm>of</jsm>(<js>"foo"</js>, ()-><jf>fooSupplier</jf>.get());
* }
* }
@@ -2536,8 +2536,8 @@ public class RestContext extends BeanContext {
* The subclass must have a public constructor that takes in any of the following arguments:
* <ul>
* <li>{@link RestOperationsBuilder} - The builder for the object.
- * <li>Any beans found in the specified {@link #REST_beanFactory bean factory}.
- * <li>Any {@link Optional} beans that may or may not be found in the specified {@link #REST_beanFactory bean factory}.
+ * <li>Any beans found in the specified {@link #REST_beanStore bean store}.
+ * <li>Any {@link Optional} beans that may or may not be found in the specified {@link #REST_beanStore bean store}.
* </ul>
*
* <h5 class='section'>Example:</h5>
@@ -2903,7 +2903,7 @@ public class RestContext extends BeanContext {
* <ul>
* <li class='jm'>{@link org.apache.juneau.rest.RestContextBuilder#staticFiles(Class)}
* <li class='jm'>{@link org.apache.juneau.rest.RestContextBuilder#staticFiles(StaticFiles)}
- * <li class='jm'>{@link org.apache.juneau.rest.RestContext#createStaticFiles(Object,ContextProperties,BeanFactory)}
+ * <li class='jm'>{@link org.apache.juneau.rest.RestContext#createStaticFiles(Object,ContextProperties,BeanStore)}
* </ul>
* </ul>
*
@@ -2924,7 +2924,7 @@ public class RestContext extends BeanContext {
* </ul>
*
* <p>
- * The static file finder is instantiated via the {@link RestContext#createStaticFiles(Object,ContextProperties,BeanFactory)} method which in turn instantiates
+ * The static file finder is instantiated via the {@link RestContext#createStaticFiles(Object,ContextProperties,BeanStore)} method which in turn instantiates
* based on the following logic:
* <ul>
* <li>Returns the resource class itself is an instance of {@link StaticFiles}.
@@ -3377,8 +3377,8 @@ public class RestContext extends BeanContext {
private final SwaggerProvider swaggerProvider;
private final HttpException initException;
private final RestContext parentContext;
- private final BeanFactory rootBeanFactory;
- private final BeanFactory beanFactory;
+ private final BeanStore rootBeanStore;
+ private final BeanStore beanStore;
private final UriResolution uriResolution;
private final UriRelativity uriRelativity;
private final MethodExecStore methodExecStore;
@@ -3464,10 +3464,10 @@ public class RestContext extends BeanContext {
RestContext parent = parentContext = builder.parentContext;
- rootBeanFactory = createBeanFactory(r, cp, parent);
+ rootBeanStore = createBeanStore(r, cp, parent);
- BeanFactory bf = beanFactory = BeanFactory.of(rootBeanFactory, r);
- bf.addBean(BeanFactory.class, bf);
+ BeanStore bf = beanStore = BeanStore.of(rootBeanStore, r);
+ bf.addBean(BeanStore.class, bf);
bf.addBean(RestContext.class, this);
bf.addBean(Object.class, r);
@@ -3578,7 +3578,7 @@ public class RestContext extends BeanContext {
}
private MethodInvoker toRestOperationInvoker(Method m) {
- return new RestOperationInvoker(m, findHookMethodArgs(m, getBeanFactory()), getMethodExecStats(m));
+ return new RestOperationInvoker(m, findHookMethodArgs(m, getBeanStore()), getMethodExecStats(m));
}
private Set<String> newCaseInsensitiveSet(String value) {
@@ -3595,48 +3595,48 @@ public class RestContext extends BeanContext {
}
/**
- * Instantiates the bean factory for this REST resource.
+ * Instantiates the bean store for this REST resource.
*
* <p>
- * The bean factory is typically used for passing in injected beans into REST contexts and for storing beans
+ * The bean store is typically used for passing in injected beans into REST contexts and for storing beans
* created by the REST context.
*
* <p>
* Instantiates based on the following logic:
* <ul>
- * <li>Returns the resource class itself if it's an instance of {@link BeanFactory}.
- * <li>Looks for {@link #REST_beanFactory} value set via any of the following:
+ * <li>Returns the resource class itself if it's an instance of {@link BeanStore}.
+ * <li>Looks for {@link #REST_beanStore} value set via any of the following:
* <ul>
- * <li>{@link RestContextBuilder#beanFactory(Class)}/{@link RestContextBuilder#beanFactory(BeanFactory)}
- * <li>{@link Rest#beanFactory()}.
+ * <li>{@link RestContextBuilder#beanStore(Class)}/{@link RestContextBuilder#beanStore(BeanStore)}
+ * <li>{@link Rest#beanStore()}.
* </ul>
- * <li>Instantiates a new {@link BeanFactory}.
- * Uses the parent context's root bean factory as the parent bean factory if this is a child resource.
+ * <li>Instantiates a new {@link BeanStore}.
+ * Uses the parent context's root bean store as the parent bean store if this is a child resource.
* </ul>
*
* <p>
- * Your REST class can also implement a create method called <c>createBeanFactory()</c> to instantiate your own
- * bean factory.
+ * Your REST class can also implement a create method called <c>createBeanStore()</c> to instantiate your own
+ * bean store.
*
* <h5 class='figure'>Example:</h5>
* <p class='bpcode w800'>
* <ja>@Rest</ja>
* <jk>public class</jk> MyRestClass {
*
- * <jk>public</jk> BeanFactory createBeanFactory(Optional<BeanFactory> <jv>parentBeanFactory</jv>) <jk>throws</jk> Exception {
- * <jc>// Create your own bean factory here.</jc>
+ * <jk>public</jk> BeanStore createBeanStore(Optional<BeanStore> <jv>parentBeanStore</jv>) <jk>throws</jk> Exception {
+ * <jc>// Create your own bean store here.</jc>
* }
* }
* </p>
*
* <p>
- * The <c>createBeanFactory()</c> method can be static or non-static can contain any of the following arguments:
+ * The <c>createBeanStore()</c> method can be static or non-static can contain any of the following arguments:
* <ul>
- * <li><c>{@link Optional}<{@link BeanFactory}></c> - The parent root bean factory if this is a child resource.
+ * <li><c>{@link Optional}<{@link BeanStore}></c> - The parent root bean store if this is a child resource.
* </ul>
*
* <ul class='seealso'>
- * <li class='jf'>{@link #REST_beanFactory}
+ * <li class='jf'>{@link #REST_beanStore}
* </ul>
*
* @param resource
@@ -3647,27 +3647,27 @@ public class RestContext extends BeanContext {
* @param parent
* The parent context if the REST bean was registered via {@link Rest#children()}.
* <br>Will be <jk>null</jk> if the bean is a top-level resource.
- * @return The bean factory for this REST resource.
- * @throws Exception If bean factory could not be instantiated.
+ * @return The bean store for this REST resource.
+ * @throws Exception If bean store could not be instantiated.
*/
- protected BeanFactory createBeanFactory(Object resource, ContextProperties properties, RestContext parent) throws Exception {
+ protected BeanStore createBeanStore(Object resource, ContextProperties properties, RestContext parent) throws Exception {
- BeanFactory x = null;
+ BeanStore x = null;
- if (resource instanceof BeanFactory)
- x = (BeanFactory)resource;
+ if (resource instanceof BeanStore)
+ x = (BeanStore)resource;
if (x == null)
- x = properties.getIfType(REST_beanFactory, BeanFactory.class).orElse(null);
+ x = properties.getIfType(REST_beanStore, BeanStore.class).orElse(null);
if (x == null)
- x = createBeanFactoryBuilder(resource, properties, parent).build();
+ x = createBeanStoreBuilder(resource, properties, parent).build();
- x = BeanFactory
+ x = BeanStore
.of(x, resource)
- .addBean(BeanFactory.class, x)
- .beanCreateMethodFinder(BeanFactory.class, resource)
- .find("createBeanFactory")
+ .addBean(BeanStore.class, x)
+ .beanCreateMethodFinder(BeanStore.class, resource)
+ .find("createBeanStore")
.withDefault(x)
.run();
@@ -3675,7 +3675,7 @@ public class RestContext extends BeanContext {
}
/**
- * Instantiates the builder for the {@link BeanFactory} for this context.
+ * Instantiates the builder for the {@link BeanStore} for this context.
*
* @param resource
* The REST servlet or bean that this context defines.
@@ -3685,29 +3685,29 @@ public class RestContext extends BeanContext {
* @param parent
* The parent context if the REST bean was registered via {@link Rest#children()}.
* <br>Will be <jk>null</jk> if the bean is a top-level resource.
- * @return The bean factory builder for this REST resource.
- * @throws Exception If bean factory could not be instantiated.
+ * @return The bean store builder for this REST resource.
+ * @throws Exception If bean store could not be instantiated.
*/
- protected BeanFactoryBuilder createBeanFactoryBuilder(Object resource, ContextProperties properties, RestContext parent) throws Exception {
+ protected BeanStoreBuilder createBeanStoreBuilder(Object resource, ContextProperties properties, RestContext parent) throws Exception {
- Class<? extends BeanFactory> c = properties.getIfClass(REST_beanFactory, BeanFactory.class).orElse(null);
+ Class<? extends BeanStore> c = properties.getIfClass(REST_beanStore, BeanStore.class).orElse(null);
- BeanFactory root = parent == null ? null : parent.rootBeanFactory;
+ BeanStore root = parent == null ? null : parent.rootBeanStore;
- BeanFactoryBuilder x = BeanFactory
+ BeanStoreBuilder x = BeanStore
.create()
.parent(root)
.implClass(c)
.outer(resource);
- x = BeanFactory
+ x = BeanStore
.create()
.parent(root)
.outer(resource)
.build()
- .addBean(BeanFactoryBuilder.class, x)
- .beanCreateMethodFinder(BeanFactoryBuilder.class, resource)
- .find("createBeanFactoryBuilder")
+ .addBean(BeanStoreBuilder.class, x)
+ .beanCreateMethodFinder(BeanStoreBuilder.class, resource)
+ .find("createBeanStoreBuilder")
.withDefault(x)
.run();
@@ -3729,9 +3729,9 @@ public class RestContext extends BeanContext {
* <li>{@link RestContextBuilder#fileFinder(Class)}/{@link RestContextBuilder#fileFinder(FileFinder)}
* <li>{@link Rest#fileFinder()}.
* </ul>
- * <li>Resolves it via the {@link #createBeanFactory(Object,ContextProperties,RestContext) bean factory} registered in this context (including Spring beans if using SpringRestServlet).
+ * <li>Resolves it via the {@link #createBeanStore(Object,ContextProperties,RestContext) bean store} registered in this context (including Spring beans if using SpringRestServlet).
* <li>Looks for value in {@link #REST_fileFinderDefault} setting.
- * <li>Instantiates via {@link #createFileFinderBuilder(Object,ContextProperties,BeanFactory)}.
+ * <li>Instantiates via {@link #createFileFinderBuilder(Object,ContextProperties,BeanStore)}.
* </ul>
*
* <p>
@@ -3753,9 +3753,9 @@ public class RestContext extends BeanContext {
* The <c>createFileFinder()</c> method can be static or non-static can contain any of the following arguments:
* <ul>
* <li>{@link FileFinder} - The file finder that would have been returned by this method.
- * <li>{@link FileFinderBuilder} - The file finder returned by {@link #createFileFinderBuilder(Object,ContextProperties,BeanFactory)}.
+ * <li>{@link FileFinderBuilder} - The file finder returned by {@link #createFileFinderBuilder(Object,ContextProperties,BeanStore)}.
* <li>{@link RestContext} - This REST context.
- * <li>{@link BeanFactory} - The bean factory of this REST context.
+ * <li>{@link BeanStore} - The bean store of this REST context.
* <li>Any {@doc RestInjection injected bean} types. Use {@link Optional} arguments for beans that may not exist.
* </ul>
*
@@ -3768,13 +3768,13 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The file finder for this REST resource.
* @throws Exception If file finder could not be instantiated.
*/
- protected FileFinder createFileFinder(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected FileFinder createFileFinder(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
FileFinder x = null;
@@ -3785,16 +3785,16 @@ public class RestContext extends BeanContext {
x = properties.getIfType(REST_fileFinder, FileFinder.class).orElse(null);
if (x == null)
- x = beanFactory.getBean(FileFinder.class).orElse(null);
+ x = beanStore.getBean(FileFinder.class).orElse(null);
if (x == null)
x = properties.getIfType(REST_fileFinderDefault, FileFinder.class).orElse(null);
if (x == null)
- x = createFileFinderBuilder(resource, properties, beanFactory).build();
+ x = createFileFinderBuilder(resource, properties, beanStore).build();
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(FileFinder.class, x)
.beanCreateMethodFinder(FileFinder.class, resource)
.find("createFileFinder")
@@ -3808,20 +3808,20 @@ public class RestContext extends BeanContext {
* Instantiates the file finder builder for this REST resource.
*
* <p>
- * Allows subclasses to intercept and modify the builder used by the {@link #createFileFinder(Object,ContextProperties,BeanFactory)} method.
+ * Allows subclasses to intercept and modify the builder used by the {@link #createFileFinder(Object,ContextProperties,BeanStore)} method.
*
* @param resource
* The REST servlet or bean that this context defines.
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The file finder builder for this REST resource.
* @throws Exception If file finder builder could not be instantiated.
*/
- protected FileFinderBuilder createFileFinderBuilder(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected FileFinderBuilder createFileFinderBuilder(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
Class<? extends FileFinder> c = properties.getIfClass(REST_fileFinder, FileFinder.class).orElse(null);
@@ -3830,7 +3830,7 @@ public class RestContext extends BeanContext {
FileFinderBuilder x = FileFinder
.create()
- .beanFactory(beanFactory)
+ .beanStore(beanStore)
.implClass(c)
.dir("static")
.dir("htdocs")
@@ -3839,8 +3839,8 @@ public class RestContext extends BeanContext {
.caching(1_000_000)
.exclude("(?i).*\\.(class|properties)");
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(FileFinderBuilder.class, x)
.beanCreateMethodFinder(FileFinderBuilder.class, resource)
.find("createFileFinderBuilder")
@@ -3866,11 +3866,11 @@ public class RestContext extends BeanContext {
* resource class with any of the following arguments:
* <ul>
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>{@link BasicFileFinder}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Looks for value in {@link #REST_staticFilesDefault} setting.
* <li>Instantiates a {@link BasicStaticFiles}.
* </ul>
@@ -3884,13 +3884,13 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The file finder for this REST resource.
* @throws Exception If file finder could not be instantiated.
*/
- protected StaticFiles createStaticFiles(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected StaticFiles createStaticFiles(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
StaticFiles x = null;
@@ -3901,16 +3901,16 @@ public class RestContext extends BeanContext {
x = properties.getIfType(REST_staticFiles, StaticFiles.class).orElse(null);
if (x == null)
- x = beanFactory.getBean(StaticFiles.class).orElse(null);
+ x = beanStore.getBean(StaticFiles.class).orElse(null);
if (x == null)
x = properties.getIfType(REST_staticFilesDefault, StaticFiles.class).orElse(null);
if (x == null)
- x = (StaticFiles)createStaticFilesBuilder(resource, properties, beanFactory).build();
+ x = (StaticFiles)createStaticFilesBuilder(resource, properties, beanStore).build();
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(StaticFiles.class, x)
.beanCreateMethodFinder(StaticFiles.class, resource)
.find("createStaticFiles")
@@ -3924,21 +3924,21 @@ public class RestContext extends BeanContext {
* Instantiates the static files builder for this REST resource.
*
* <p>
- * Allows subclasses to intercept and modify the builder used by the {@link #createStaticFiles(Object,ContextProperties,BeanFactory)} method.
+ * Allows subclasses to intercept and modify the builder used by the {@link #createStaticFiles(Object,ContextProperties,BeanStore)} method.
*
* @param resource
* The REST servlet or bean that this context defines.
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The static files builder for this REST resource.
* @throws Exception If static files builder could not be instantiated.
*/
@SuppressWarnings("unchecked")
- protected StaticFilesBuilder createStaticFilesBuilder(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected StaticFilesBuilder createStaticFilesBuilder(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
Class<? extends StaticFiles> c = properties.getIfClass(REST_staticFiles, StaticFiles.class).orElse(null);
@@ -3947,7 +3947,7 @@ public class RestContext extends BeanContext {
StaticFilesBuilder x = StaticFiles
.create()
- .beanFactory(beanFactory)
+ .beanStore(beanStore)
.implClass((Class<? extends FileFinder>)c)
.dir("static")
.dir("htdocs")
@@ -3957,8 +3957,8 @@ public class RestContext extends BeanContext {
.exclude("(?i).*\\.(class|properties)")
.headers(CacheControl.of("max-age=86400, public"));
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(StaticFilesBuilder.class, x)
.beanCreateMethodFinder(StaticFilesBuilder.class, resource)
.find("createStaticFilesBuilder")
@@ -3984,11 +3984,11 @@ public class RestContext extends BeanContext {
* resource class with any of the following arguments:
* <ul>
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>{@link BasicFileFinder}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Looks for value in {@link #REST_callLoggerDefault} setting.
* <li>Instantiates a {@link BasicFileFinder}.
* </ul>
@@ -4002,19 +4002,19 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @param logger
* The Java logger to use for logging messages.
- * <br>Created by {@link #createLogger(Object,ContextProperties,BeanFactory)}.
+ * <br>Created by {@link #createLogger(Object,ContextProperties,BeanStore)}.
* @param thrownStore
* The thrown exception statistics store.
- * <br>Created by {@link #createThrownStore(Object,ContextProperties,RestContext,BeanFactory)}.
+ * <br>Created by {@link #createThrownStore(Object,ContextProperties,RestContext,BeanStore)}.
* @return The file finder for this REST resource.
* @throws Exception If file finder could not be instantiated.
*/
- protected RestLogger createCallLogger(Object resource, ContextProperties properties, BeanFactory beanFactory, Logger logger, ThrownStore thrownStore) throws Exception {
+ protected RestLogger createCallLogger(Object resource, ContextProperties properties, BeanStore beanStore, Logger logger, ThrownStore thrownStore) throws Exception {
RestLogger x = null;
@@ -4025,16 +4025,16 @@ public class RestContext extends BeanContext {
x = properties.getIfType(REST_callLogger, RestLogger.class).orElse(null);
if (x == null)
- x = beanFactory.getBean(RestLogger.class).orElse(null);
+ x = beanStore.getBean(RestLogger.class).orElse(null);
if (x == null)
x = properties.getIfType(REST_callLoggerDefault, RestLogger.class).orElse(null);
if (x == null)
- x = createCallLoggerBuilder(resource, properties, beanFactory, logger, thrownStore).build();
+ x = createCallLoggerBuilder(resource, properties, beanStore, logger, thrownStore).build();
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(RestLogger.class, x)
.beanCreateMethodFinder(RestLogger.class, resource)
.find("createCallLogger")
@@ -4048,26 +4048,26 @@ public class RestContext extends BeanContext {
* Instantiates the call logger builder for this REST resource.
*
* <p>
- * Allows subclasses to intercept and modify the builder used by the {@link #createCallLogger(Object,ContextProperties,BeanFactory,Logger,ThrownStore)} method.
+ * Allows subclasses to intercept and modify the builder used by the {@link #createCallLogger(Object,ContextProperties,BeanStore,Logger,ThrownStore)} method.
*
* @param resource
* The REST servlet or bean that this context defines.
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @param logger
* The Java logger to use for logging messages.
- * <br>Created by {@link #createLogger(Object,ContextProperties,BeanFactory)}.
+ * <br>Created by {@link #createLogger(Object,ContextProperties,BeanStore)}.
* @param thrownStore
* The thrown exception statistics store.
- * <br>Created by {@link #createThrownStore(Object,ContextProperties,RestContext,BeanFactory)}.
+ * <br>Created by {@link #createThrownStore(Object,ContextProperties,RestContext,BeanStore)}.
* @return The call logger builder for this REST resource.
* @throws Exception If call logger builder could not be instantiated.
*/
- protected RestLoggerBuilder createCallLoggerBuilder(Object resource, ContextProperties properties, BeanFactory beanFactory, Logger logger, ThrownStore thrownStore) throws Exception {
+ protected RestLoggerBuilder createCallLoggerBuilder(Object resource, ContextProperties properties, BeanStore beanStore, Logger logger, ThrownStore thrownStore) throws Exception {
Class<? extends RestLogger> c = properties.getIfClass(REST_callLogger, RestLogger.class).orElse(null);
@@ -4076,7 +4076,7 @@ public class RestContext extends BeanContext {
RestLoggerBuilder x = RestLogger
.create()
- .beanFactory(beanFactory)
+ .beanStore(beanStore)
.implClass(c)
.normalRules( // Rules when debugging is not enabled.
RestLoggerRule.create() // Log 500+ errors with status-line and header information.
@@ -4102,8 +4102,8 @@ public class RestContext extends BeanContext {
.logger(logger)
.thrownStore(thrownStore);
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(RestLoggerBuilder.class, x)
.beanCreateMethodFinder(RestLoggerBuilder.class, resource)
.find("createCallLoggerBuilder")
@@ -4128,10 +4128,10 @@ public class RestContext extends BeanContext {
* resource class with any of the following arguments:
* <ul>
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Instantiates a <c>ResponseHandler[0]</c>.
* </ul>
*
@@ -4144,23 +4144,23 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The response handlers for this REST resource.
* @throws Exception If response handlers could not be instantiated.
*/
- protected ResponseHandlerList createResponseHandlers(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected ResponseHandlerList createResponseHandlers(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
ResponseHandlerList x = ResponseHandlerList.create();
- x.append(properties.getInstanceArray(REST_responseHandlers, ResponseHandler.class, beanFactory).orElse(new ResponseHandler[0]));
+ x.append(properties.getInstanceArray(REST_responseHandlers, ResponseHandler.class, beanStore).orElse(new ResponseHandler[0]));
if (x.isEmpty())
- x.append(beanFactory.getBean(ResponseHandlerList.class).orElse(null));
+ x.append(beanStore.getBean(ResponseHandlerList.class).orElse(null));
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(ResponseHandlerList.class, x)
.beanCreateMethodFinder(ResponseHandlerList.class, resource)
.find("createResponseHandlers")
@@ -4185,10 +4185,10 @@ public class RestContext extends BeanContext {
* resource class with any of the following arguments:
* <ul>
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Instantiates a <c>Serializer[0]</c>.
* </ul>
*
@@ -4198,24 +4198,24 @@ public class RestContext extends BeanContext {
*
* @param resource
* The REST servlet or bean that this context defines.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
* @return The serializers for this REST resource.
* @throws Exception If serializers could not be instantiated.
*/
- protected SerializerGroup createSerializerGroup(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected SerializerGroup createSerializerGroup(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
- SerializerGroup g = beanFactory.getBean(SerializerGroup.class).orElse(null);
+ SerializerGroup g = beanStore.getBean(SerializerGroup.class).orElse(null);
if (g == null)
- g = createSerializerGroupBuilder(resource, properties, beanFactory).build();
+ g = createSerializerGroupBuilder(resource, properties, beanStore).build();
- g = BeanFactory
- .of(beanFactory, resource)
+ g = BeanStore
+ .of(beanStore, resource)
.addBean(SerializerGroup.class, g)
.beanCreateMethodFinder(SerializerGroup.class, resource)
.find("createSerializers")
@@ -4233,18 +4233,18 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The serializers for this REST resource.
* @throws Exception If serializers could not be instantiated.
*/
- protected SerializerGroupBuilder createSerializerGroupBuilder(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected SerializerGroupBuilder createSerializerGroupBuilder(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
Object[] x = properties.getArray(REST_serializers, Object.class).orElse(null);
if (x == null)
- x = beanFactory.getBean(Serializer[].class).orElse(null);
+ x = beanStore.getBean(Serializer[].class).orElse(null);
if (x == null)
x = new Serializer[0];
@@ -4254,8 +4254,8 @@ public class RestContext extends BeanContext {
.append(x)
.apply(properties);
- g = BeanFactory
- .of(beanFactory, resource)
+ g = BeanStore
+ .of(beanStore, resource)
.addBean(SerializerGroupBuilder.class, g)
.beanCreateMethodFinder(SerializerGroupBuilder.class, resource)
.find("createSerializerGroupBuilder")
@@ -4280,10 +4280,10 @@ public class RestContext extends BeanContext {
* resource class with any of the following arguments:
* <ul>
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Instantiates a <c>Parser[0]</c>.
* </ul>
*
@@ -4296,21 +4296,21 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The parsers for this REST resource.
* @throws Exception If parsers could not be instantiated.
*/
- protected ParserGroup createParserGroup(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected ParserGroup createParserGroup(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
- ParserGroup g = beanFactory.getBean(ParserGroup.class).orElse(null);
+ ParserGroup g = beanStore.getBean(ParserGroup.class).orElse(null);
if (g == null)
- g = createParserGroupBuilder(resource, properties, beanFactory).build();
+ g = createParserGroupBuilder(resource, properties, beanStore).build();
- g = BeanFactory
- .of(beanFactory, resource)
+ g = BeanStore
+ .of(beanStore, resource)
.addBean(ParserGroup.class, g)
.beanCreateMethodFinder(ParserGroup.class, resource)
.find("createParserGroup")
@@ -4328,18 +4328,18 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The serializers for this REST resource.
* @throws Exception If serializers could not be instantiated.
*/
- protected ParserGroupBuilder createParserGroupBuilder(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected ParserGroupBuilder createParserGroupBuilder(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
Object[] x = properties.getArray(REST_parsers, Object.class).orElse(null);
if (x == null)
- x = beanFactory.getBean(Parser[].class).orElse(null);
+ x = beanStore.getBean(Parser[].class).orElse(null);
if (x == null)
x = new Parser[0];
@@ -4349,8 +4349,8 @@ public class RestContext extends BeanContext {
.append(x)
.apply(properties);
- g = BeanFactory
- .of(beanFactory, resource)
+ g = BeanStore
+ .of(beanStore, resource)
.addBean(ParserGroupBuilder.class, g)
.beanCreateMethodFinder(ParserGroupBuilder.class, resource)
.find("createParserGroupBuilder")
@@ -4376,10 +4376,10 @@ public class RestContext extends BeanContext {
* resource class with any of the following arguments:
* <ul>
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Instantiates an {@link OpenApiSerializer}.
* </ul>
*
@@ -4392,13 +4392,13 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The HTTP part serializer for this REST resource.
* @throws Exception If serializer could not be instantiated.
*/
- protected HttpPartSerializer createPartSerializer(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected HttpPartSerializer createPartSerializer(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
HttpPartSerializer x = null;
@@ -4406,16 +4406,16 @@ public class RestContext extends BeanContext {
x = (HttpPartSerializer)resource;
if (x == null)
- x = properties.getInstance(REST_partSerializer, HttpPartSerializer.class, beanFactory).orElse(null);
+ x = properties.getInstance(REST_partSerializer, HttpPartSerializer.class, beanStore).orElse(null);
if (x == null)
- x = beanFactory.getBean(HttpPartSerializer.class).orElse(null);
+ x = beanStore.getBean(HttpPartSerializer.class).orElse(null);
if (x == null)
x = new OpenApiSerializer(properties);
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(HttpPartSerializer.class, x)
.beanCreateMethodFinder(HttpPartSerializer.class, resource)
.find("createPartSerializer")
@@ -4441,10 +4441,10 @@ public class RestContext extends BeanContext {
* resource class with any of the following arguments:
* <ul>
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Instantiates an {@link OpenApiSerializer}.
* </ul>
*
@@ -4457,13 +4457,13 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The HTTP part parser for this REST resource.
* @throws Exception If parser could not be instantiated.
*/
- protected HttpPartParser createPartParser(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected HttpPartParser createPartParser(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
HttpPartParser x = null;
@@ -4471,16 +4471,16 @@ public class RestContext extends BeanContext {
x = (HttpPartParser)resource;
if (x == null)
- x = properties.getInstance(REST_partParser, HttpPartParser.class, beanFactory).orElse(null);
+ x = properties.getInstance(REST_partParser, HttpPartParser.class, beanStore).orElse(null);
if (x == null)
- x = beanFactory.getBean(HttpPartParser.class).orElse(null);
+ x = beanStore.getBean(HttpPartParser.class).orElse(null);
if (x == null)
x = new OpenApiParser(properties);
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(HttpPartParser.class, x)
.beanCreateMethodFinder(HttpPartParser.class, resource)
.find("createPartParser")
@@ -4502,7 +4502,7 @@ public class RestContext extends BeanContext {
* <li>{@link Rest#restOperationArgs()}.
* </ul>
* <li>Looks for a static or non-static <c>createRestParams()</> method that returns <c>{@link Class}[]</c>.
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Instantiates a default set of parameters.
* </ul>
*
@@ -4511,14 +4511,14 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The REST method parameter resolvers for this REST resource.
* @throws Exception If parameter resolvers could not be instantiated.
*/
@SuppressWarnings("unchecked")
- protected RestOperationArgList createRestOperationArgs(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected RestOperationArgList createRestOperationArgs(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
RestOperationArgList x = RestOperationArgList.create();
@@ -4569,8 +4569,8 @@ public class RestContext extends BeanContext {
DefaultArg.class
);
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(RestOperationArgList.class, x)
.beanCreateMethodFinder(RestOperationArgList.class, resource)
.find("createRestOperationArgs")
@@ -4588,14 +4588,14 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The REST method parameter resolvers for this REST resource.
* @throws Exception If parameter resolvers could not be instantiated.
*/
@SuppressWarnings("unchecked")
- protected RestOperationArgList createHookMethodArgs(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected RestOperationArgList createHookMethodArgs(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
RestOperationArgList x = RestOperationArgList.create();
@@ -4620,8 +4620,8 @@ public class RestContext extends BeanContext {
DefaultArg.class
);
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(RestOperationArgList.class, x)
.beanCreateMethodFinder(RestOperationArgList.class, resource)
.find("createHookMethodArgs")
@@ -4641,10 +4641,10 @@ public class RestContext extends BeanContext {
* resource class with any of the following arguments:
* <ul>
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Instantiates via <c>Logger.<jsm>getLogger</jsm>(<jv>resource</jv>.getClass().getName())</c>.
* </ul>
*
@@ -4653,21 +4653,21 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The logger for this REST resource.
* @throws Exception If logger could not be instantiated.
*/
- protected Logger createLogger(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected Logger createLogger(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
- Logger x = beanFactory.getBean(Logger.class).orElse(null);
+ Logger x = beanStore.getBean(Logger.class).orElse(null);
if (x == null)
x = Logger.getLogger(resource.getClass().getName());
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(Logger.class, x)
.beanCreateMethodFinder(Logger.class, resource)
.find("createLogger")
@@ -4687,10 +4687,10 @@ public class RestContext extends BeanContext {
* resource class with any of the following arguments:
* <ul>
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Instantiates a new {@link JsonSchemaGenerator} using the property store of this context..
* </ul>
*
@@ -4699,20 +4699,20 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The JSON schema generator for this REST resource.
* @throws Exception If JSON schema generator could not be instantiated.
*/
- protected JsonSchemaGenerator createJsonSchemaGenerator(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
- JsonSchemaGenerator x = beanFactory.getBean(JsonSchemaGenerator.class).orElse(null);
+ protected JsonSchemaGenerator createJsonSchemaGenerator(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
+ JsonSchemaGenerator x = beanStore.getBean(JsonSchemaGenerator.class).orElse(null);
if (x == null)
- x = createJsonSchemaGeneratorBuilder(resource, properties, beanFactory).build();
+ x = createJsonSchemaGeneratorBuilder(resource, properties, beanStore).build();
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(JsonSchemaGenerator.class, x)
.beanCreateMethodFinder(JsonSchemaGenerator.class, resource)
.find("createJsonSchemaGenerator")
@@ -4726,26 +4726,26 @@ public class RestContext extends BeanContext {
* Instantiates the JSON-schema generator builder for this REST resource.
*
* <p>
- * Allows subclasses to intercept and modify the builder used by the {@link #createJsonSchemaGenerator(Object,ContextProperties,BeanFactory)} method.
+ * Allows subclasses to intercept and modify the builder used by the {@link #createJsonSchemaGenerator(Object,ContextProperties,BeanStore)} method.
*
* @param resource
* The REST servlet or bean that this context defines.
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The JSON-schema generator builder for this REST resource.
* @throws Exception If JSON-schema generator builder could not be instantiated.
*/
- protected JsonSchemaGeneratorBuilder createJsonSchemaGeneratorBuilder(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected JsonSchemaGeneratorBuilder createJsonSchemaGeneratorBuilder(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
JsonSchemaGeneratorBuilder x = JsonSchemaGenerator
.create()
.apply(properties);
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(JsonSchemaGeneratorBuilder.class, x)
.beanCreateMethodFinder(JsonSchemaGeneratorBuilder.class, resource)
.find("createJsonSchemaGeneratorBuilder")
@@ -4771,10 +4771,10 @@ public class RestContext extends BeanContext {
* resource class with any of the following arguments:
* <ul>
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Instantiates a default {@link BasicSwaggerProvider}.
* </ul>
*
@@ -4787,16 +4787,16 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
- * @param fileFinder The file finder configured on this bean created by {@link #createFileFinder(Object,ContextProperties,BeanFactory)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
+ * @param fileFinder The file finder configured on this bean created by {@link #createFileFinder(Object,ContextProperties,BeanStore)}.
* @param messages The localized messages configured on this bean created by {@link #createMessages(Object,ContextProperties)}.
- * @param varResolver The variable resolver configured on this bean created by {@link #createVarResolver(Object,ContextProperties,BeanFactory,Messages)}.
+ * @param varResolver The variable resolver configured on this bean created by {@link #createVarResolver(Object,ContextProperties,BeanStore,Messages)}.
* @return The info provider for this REST resource.
* @throws Exception If info provider could not be instantiated.
*/
- protected SwaggerProvider createSwaggerProvider(Object resource, ContextProperties properties, BeanFactory beanFactory, FileFinder fileFinder, Messages messages, VarResolver varResolver) throws Exception {
+ protected SwaggerProvider createSwaggerProvider(Object resource, ContextProperties properties, BeanStore beanStore, FileFinder fileFinder, Messages messages, VarResolver varResolver) throws Exception {
SwaggerProvider x = null;
@@ -4804,16 +4804,16 @@ public class RestContext extends BeanContext {
x = (SwaggerProvider)resource;
if (x == null)
- x = beanFactory.getBean(SwaggerProvider.class).orElse(null);
+ x = beanStore.getBean(SwaggerProvider.class).orElse(null);
if (x == null)
x = properties.getIfType(REST_swaggerProvider, SwaggerProvider.class).orElse(null);
if (x == null)
- x = createSwaggerProviderBuilder(resource, properties, beanFactory, fileFinder, messages, varResolver).build();
+ x = createSwaggerProviderBuilder(resource, properties, beanStore, fileFinder, messages, varResolver).build();
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(SwaggerProvider.class, x)
.beanCreateMethodFinder(SwaggerProvider.class, resource)
.find("createSwaggerProvider")
@@ -4827,37 +4827,37 @@ public class RestContext extends BeanContext {
* Instantiates the REST API builder for this REST resource.
*
* <p>
- * Allows subclasses to intercept and modify the builder used by the {@link #createSwaggerProvider(Object,ContextProperties,BeanFactory,FileFinder,Messages,VarResolver)} method.
+ * Allows subclasses to intercept and modify the builder used by the {@link #createSwaggerProvider(Object,ContextProperties,BeanStore,FileFinder,Messages,VarResolver)} method.
*
* @param resource
* The REST servlet or bean that this context defines.
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
- * @param fileFinder The file finder configured on this bean created by {@link #createFileFinder(Object,ContextProperties,BeanFactory)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
+ * @param fileFinder The file finder configured on this bean created by {@link #createFileFinder(Object,ContextProperties,BeanStore)}.
* @param messages The localized messages configured on this bean created by {@link #createMessages(Object,ContextProperties)}.
- * @param varResolver The variable resolver configured on this bean created by {@link #createVarResolver(Object,ContextProperties,BeanFactory,Messages)}.
+ * @param varResolver The variable resolver configured on this bean created by {@link #createVarResolver(Object,ContextProperties,BeanStore,Messages)}.
* @return The REST API builder for this REST resource.
* @throws Exception If REST API builder could not be instantiated.
*/
- protected SwaggerProviderBuilder createSwaggerProviderBuilder(Object resource, ContextProperties properties, BeanFactory beanFactory, FileFinder fileFinder, Messages messages, VarResolver varResolver) throws Exception {
+ protected SwaggerProviderBuilder createSwaggerProviderBuilder(Object resource, ContextProperties properties, BeanStore beanStore, FileFinder fileFinder, Messages messages, VarResolver varResolver) throws Exception {
Class<? extends SwaggerProvider> c = properties.getIfClass(REST_swaggerProvider, SwaggerProvider.class).orElse(null);
SwaggerProviderBuilder x = SwaggerProvider
.create()
- .beanFactory(beanFactory)
+ .beanStore(beanStore)
.fileFinder(fileFinder)
.messages(messages)
.varResolver(varResolver)
- .jsonSchemaGenerator(createJsonSchemaGenerator(resource, properties, beanFactory))
+ .jsonSchemaGenerator(createJsonSchemaGenerator(resource, properties, beanStore))
.implClass(c);
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(SwaggerProviderBuilder.class, x)
.beanCreateMethodFinder(SwaggerProviderBuilder.class, resource)
.find("createSwaggerProviderBuilder")
@@ -4878,11 +4878,11 @@ public class RestContext extends BeanContext {
* resource class with any of the following arguments:
* <ul>
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
- * <li>Instantiates a new {@link VarResolver} using the variables returned by {@link #createVars(Object,ContextProperties,BeanFactory)}.
+ * <li>Resolves it via the bean store registered in this context.
+ * <li>Instantiates a new {@link VarResolver} using the variables returned by {@link #createVars(Object,ContextProperties,BeanStore)}.
* </ul>
*
* @param resource
@@ -4890,25 +4890,25 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @param messages The localized messages of this bean.
* @return The variable resolver for this REST resource.
* @throws Exception If variable resolver could not be instantiated.
*/
- protected VarResolver createVarResolver(Object resource, ContextProperties properties, BeanFactory beanFactory, Messages messages) throws Exception {
+ protected VarResolver createVarResolver(Object resource, ContextProperties properties, BeanStore beanStore, Messages messages) throws Exception {
- VarResolver x = beanFactory.getBean(VarResolver.class).orElse(null);
+ VarResolver x = beanStore.getBean(VarResolver.class).orElse(null);
if (x == null)
x = builder.varResolverBuilder
- .vars(createVars(resource, properties, beanFactory))
+ .vars(createVars(resource, properties, beanStore))
.bean(Messages.class, messages)
.build();
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(VarResolver.class, x)
.beanCreateMethodFinder(VarResolver.class, resource)
.find("createVarResolver")
@@ -4928,10 +4928,10 @@ public class RestContext extends BeanContext {
* resource class with any of the following arguments:
* <ul>
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Instantiates a new {@link VarList} using default variables.
* </ul>
*
@@ -4940,16 +4940,16 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The variable resolver variables for this REST resource.
* @throws Exception If variable resolver variables could not be instantiated.
*/
@SuppressWarnings("unchecked")
- protected VarList createVars(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected VarList createVars(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
- VarList x = beanFactory.getBean(VarList.class).orElse(null);
+ VarList x = beanStore.getBean(VarList.class).orElse(null);
if (x == null)
x = VarList.of(
@@ -4970,8 +4970,8 @@ public class RestContext extends BeanContext {
HtmlWidgetVar.class
);
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(VarList.class, x)
.beanCreateMethodFinder(VarList.class, resource)
.find("createVars")
@@ -4991,10 +4991,10 @@ public class RestContext extends BeanContext {
* resource class with any of the following arguments:
* <ul>
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Returns {@link ThrownStore#GLOBAL}.
* </ul>
*
@@ -5006,21 +5006,21 @@ public class RestContext extends BeanContext {
* @param parent
* The parent context if the REST bean was registered via {@link Rest#children()}.
* <br>Will be <jk>null</jk> if the bean is a top-level resource.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The stack trace store for this REST resource.
* @throws Exception If stack trace store could not be instantiated.
*/
- protected ThrownStore createThrownStore(Object resource, ContextProperties properties, RestContext parent, BeanFactory beanFactory) throws Exception {
+ protected ThrownStore createThrownStore(Object resource, ContextProperties properties, RestContext parent, BeanStore beanStore) throws Exception {
- ThrownStore x = beanFactory.getBean(ThrownStore.class).orElse(null);
+ ThrownStore x = beanStore.getBean(ThrownStore.class).orElse(null);
if (x == null)
- x = createThrownStoreBuilder(resource, properties, parent, beanFactory).build();
+ x = createThrownStoreBuilder(resource, properties, parent, beanStore).build();
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(ThrownStore.class, x)
.beanCreateMethodFinder(ThrownStore.class, resource)
.find("createThrownStore")
@@ -5041,23 +5041,23 @@ public class RestContext extends BeanContext {
* @param parent
* The parent context if the REST bean was registered via {@link Rest#children()}.
* <br>Will be <jk>null</jk> if the bean is a top-level resource.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The stack trace store for this REST resource.
* @throws Exception If stack trace store could not be instantiated.
*/
- protected ThrownStoreBuilder createThrownStoreBuilder(Object resource, ContextProperties properties, RestContext parent, BeanFactory beanFactory) throws Exception {
+ protected ThrownStoreBuilder createThrownStoreBuilder(Object resource, ContextProperties properties, RestContext parent, BeanStore beanStore) throws Exception {
ThrownStore p = parent == null ? null : parent.thrownStore;
ThrownStoreBuilder x = ThrownStore
.create()
.parent(p)
- .beanFactory(beanFactory);
+ .beanStore(beanStore);
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(ThrownStoreBuilder.class, x)
.beanCreateMethodFinder(ThrownStoreBuilder.class, resource)
.find("createThrownStoreBuilder")
@@ -5075,24 +5075,24 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @param thrownStore
* The thrown exception statistics store.
- * <br>Created by {@link #createThrownStore(Object,ContextProperties,RestContext,BeanFactory)}.
+ * <br>Created by {@link #createThrownStore(Object,ContextProperties,RestContext,BeanStore)}.
* @return The stack trace store for this REST resource.
* @throws Exception If stack trace store could not be instantiated.
*/
- protected MethodExecStore createMethodExecStore(Object resource, ContextProperties properties, BeanFactory beanFactory, ThrownStore thrownStore) throws Exception {
+ protected MethodExecStore createMethodExecStore(Object resource, ContextProperties properties, BeanStore beanStore, ThrownStore thrownStore) throws Exception {
- MethodExecStore x = beanFactory.getBean(MethodExecStore.class).orElse(null);
+ MethodExecStore x = beanStore.getBean(MethodExecStore.class).orElse(null);
if (x == null)
- x = createMethodExecStoreBuilder(resource, properties, beanFactory, thrownStore).build();
+ x = createMethodExecStoreBuilder(resource, properties, beanStore, thrownStore).build();
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(MethodExecStore.class, x)
.beanCreateMethodFinder(MethodExecStore.class, resource)
.find("cxreateMethodExecStore")
@@ -5110,24 +5110,24 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @param thrownStore
* The thrown exception statistics store.
- * <br>Created by {@link #createThrownStore(Object,ContextProperties,RestContext,BeanFactory)}.
+ * <br>Created by {@link #createThrownStore(Object,ContextProperties,RestContext,BeanStore)}.
* @return The stack trace store for this REST resource.
* @throws Exception If stack trace store could not be instantiated.
*/
- protected MethodExecStoreBuilder createMethodExecStoreBuilder(Object resource, ContextProperties properties, BeanFactory beanFactory, ThrownStore thrownStore) throws Exception {
+ protected MethodExecStoreBuilder createMethodExecStoreBuilder(Object resource, ContextProperties properties, BeanStore beanStore, ThrownStore thrownStore) throws Exception {
MethodExecStoreBuilder x = MethodExecStore
.create()
.thrownStore(thrownStore)
- .beanFactory(beanFactory);
+ .beanStore(beanStore);
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(MethodExecStoreBuilder.class, x)
.beanCreateMethodFinder(MethodExecStoreBuilder.class, resource)
.find("createMethodExecStoreBuilder")
@@ -5145,20 +5145,20 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The default request headers for this REST object.
* @throws Exception If stack trace store could not be instantiated.
*/
- protected HeaderList createDefaultRequestHeaders(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected HeaderList createDefaultRequestHeaders(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
HeaderList x = HeaderList.create();
- x.appendUnique(properties.getInstanceArray(REST_defaultRequestHeaders, org.apache.http.Header.class, beanFactory).orElse(new org.apache.http.Header[0]));
+ x.appendUnique(properties.getInstanceArray(REST_defaultRequestHeaders, org.apache.http.Header.class, beanStore).orElse(new org.apache.http.Header[0]));
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(HeaderList.class, x)
.beanCreateMethodFinder(HeaderList.class, resource)
.find("createDefaultRequestHeaders")
@@ -5176,20 +5176,20 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The default response headers for this REST object.
* @throws Exception If stack trace store could not be instantiated.
*/
- protected HeaderList createDefaultResponseHeaders(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected HeaderList createDefaultResponseHeaders(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
HeaderList x = HeaderList.create();
- x.appendUnique(properties.getInstanceArray(REST_defaultResponseHeaders, org.apache.http.Header.class, beanFactory).orElse(new org.apache.http.Header[0]));
+ x.appendUnique(properties.getInstanceArray(REST_defaultResponseHeaders, org.apache.http.Header.class, beanStore).orElse(new org.apache.http.Header[0]));
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(HeaderList.class, x)
.beanCreateMethodFinder(HeaderList.class, resource)
.find("createDefaultResponseHeaders")
@@ -5207,20 +5207,20 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The default response headers for this REST object.
* @throws Exception If stack trace store could not be instantiated.
*/
- protected NamedAttributeList createDefaultRequestAttributes(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected NamedAttributeList createDefaultRequestAttributes(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
NamedAttributeList x = NamedAttributeList.create();
- x.appendUnique(properties.getInstanceArray(REST_defaultRequestAttributes, NamedAttribute.class, beanFactory).orElse(new NamedAttribute[0]));
+ x.appendUnique(properties.getInstanceArray(REST_defaultRequestAttributes, NamedAttribute.class, beanStore).orElse(new NamedAttribute[0]));
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(NamedAttributeList.class, x)
.beanCreateMethodFinder(NamedAttributeList.class, resource)
.find("createDefaultRequestAttributes")
@@ -5238,13 +5238,13 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The debug enablement bean for this REST object.
* @throws Exception If bean could not be created.
*/
- protected DebugEnablement createDebugEnablement(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected DebugEnablement createDebugEnablement(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
DebugEnablement x = null;
if (resource instanceof DebugEnablement)
@@ -5254,13 +5254,13 @@ public class RestContext extends BeanContext {
x = properties.getIfType(REST_debugEnablement, DebugEnablement.class).orElse(null);
if (x == null)
- x = beanFactory.getBean(DebugEnablement.class).orElse(null);
+ x = beanStore.getBean(DebugEnablement.class).orElse(null);
if (x == null)
- x = createDebugEnablementBuilder(resource, properties, beanFactory).build();
+ x = createDebugEnablementBuilder(resource, properties, beanStore).build();
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(DebugEnablement.class, x)
.beanCreateMethodFinder(DebugEnablement.class, resource)
.find("createDebugEnablement")
@@ -5278,23 +5278,23 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The debug enablement bean builder for this REST object.
* @throws Exception If bean builder could not be created.
*/
- protected DebugEnablementBuilder createDebugEnablementBuilder(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected DebugEnablementBuilder createDebugEnablementBuilder(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
Class<? extends DebugEnablement> c = properties.getIfClass(REST_debugEnablement, DebugEnablement.class).orElse(null);
DebugEnablementBuilder x = DebugEnablement
.create()
- .beanFactory(beanFactory)
+ .beanStore(beanStore)
.implClass(c);
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(DebugEnablementBuilder.class, x)
.beanCreateMethodFinder(DebugEnablementBuilder.class, resource)
.find("createDebugEnablementBuilder")
@@ -5343,8 +5343,8 @@ public class RestContext extends BeanContext {
Messages x = createMessagesBuilder(resource, properties).build();
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(Messages.class, x)
.beanCreateMethodFinder(Messages.class, resource)
.find("createMessages")
@@ -5387,8 +5387,8 @@ public class RestContext extends BeanContext {
if (x == null)
x = Messages.create(resource.getClass());
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(MessagesBuilder.class, x)
.beanCreateMethodFinder(MessagesBuilder.class, resource)
.find("createMessagesBuilder")
@@ -5412,18 +5412,18 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The builder for the {@link RestOperations} object.
* @throws Exception An error occurred.
*/
- protected RestOperations createRestOperations(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected RestOperations createRestOperations(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
- RestOperations x = createRestOperationsBuilder(resource, properties, beanFactory).build();
+ RestOperations x = createRestOperationsBuilder(resource, properties, beanStore).build();
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(RestOperations.class, x)
.beanCreateMethodFinder(RestOperations.class, resource)
.find("createRestOperations")
@@ -5437,24 +5437,24 @@ public class RestContext extends BeanContext {
* Instantiates the REST methods builder for this REST resource.
*
* <p>
- * Allows subclasses to intercept and modify the builder used by the {@link #createRestOperations(Object,ContextProperties,BeanFactory)} method.
+ * Allows subclasses to intercept and modify the builder used by the {@link #createRestOperations(Object,ContextProperties,BeanStore)} method.
*
* @param resource
* The REST servlet or bean that this context defines.
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The REST methods builder for this REST resource.
* @throws Exception If REST methods builder could not be instantiated.
*/
- protected RestOperationsBuilder createRestOperationsBuilder(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected RestOperationsBuilder createRestOperationsBuilder(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
RestOperationsBuilder x = RestOperations
.create()
- .beanFactory(beanFactory)
+ .beanStore(beanStore)
.implClass(properties.getClass(REST_restOperationsClass, RestOperations.class).orElse(null));
ClassInfo rci = ClassInfo.of(resource);
@@ -5478,7 +5478,7 @@ public class RestContext extends BeanContext {
RestOperationContext roc = RestOperationContext
.create(mi.inner(), this)
- .beanFactory(beanFactory)
+ .beanStore(beanStore)
.implClass(properties.getClass(REST_restOperationContextClass, RestOperationContext.class).orElse(null))
.build();
@@ -5492,7 +5492,7 @@ public class RestContext extends BeanContext {
RestOperationContext roc2 = RestOperationContext
.create(mi.inner(), this)
.dotAll()
- .beanFactory(rootBeanFactory)
+ .beanStore(rootBeanStore)
.implClass(RrpcRestOperationContext.class)
.build();
x
@@ -5508,8 +5508,8 @@ public class RestContext extends BeanContext {
}
}
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(RestOperationsBuilder.class, x)
.beanCreateMethodFinder(RestOperationsBuilder.class, resource)
.find("createRestOperationsBuilder")
@@ -5527,20 +5527,20 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @param servletConfig
* The servlet config passed into the servlet by the servlet container.
* @return The builder for the {@link RestChildren} object.
* @throws Exception An error occurred.
*/
- protected RestChildren createRestChildren(Object resource, ContextProperties properties, BeanFactory beanFactory, ServletConfig servletConfig) throws Exception {
+ protected RestChildren createRestChildren(Object resource, ContextProperties properties, BeanStore beanStore, ServletConfig servletConfig) throws Exception {
- RestChildren x = createRestChildrenBuilder(resource, properties, beanFactory, servletConfig).build();
+ RestChildren x = createRestChildrenBuilder(resource, properties, beanStore, servletConfig).build();
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(RestChildren.class, x)
.beanCreateMethodFinder(RestChildren.class, resource)
.find("createRestChildren")
@@ -5554,26 +5554,26 @@ public class RestContext extends BeanContext {
* Instantiates the REST children builder for this REST resource.
*
* <p>
- * Allows subclasses to intercept and modify the builder used by the {@link #createRestChildren(Object,ContextProperties,BeanFactory,ServletConfig)} method.
+ * Allows subclasses to intercept and modify the builder used by the {@link #createRestChildren(Object,ContextProperties,BeanStore,ServletConfig)} method.
*
* @param resource
* The REST servlet or bean that this context defines.
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @param servletConfig
* The servlet config passed into the servlet by the servlet container.
* @return The REST children builder for this REST resource.
* @throws Exception If REST children builder could not be instantiated.
*/
- protected RestChildrenBuilder createRestChildrenBuilder(Object resource, ContextProperties properties, BeanFactory beanFactory, ServletConfig servletConfig) throws Exception {
+ protected RestChildrenBuilder createRestChildrenBuilder(Object resource, ContextProperties properties, BeanStore beanStore, ServletConfig servletConfig) throws Exception {
RestChildrenBuilder x = RestChildren
.create()
- .beanFactory(beanFactory)
+ .beanStore(beanStore)
.implClass(properties.getClass(REST_restChildrenClass, RestChildren.class).orElse(null));
// Initialize our child resources.
@@ -5594,7 +5594,7 @@ public class RestContext extends BeanContext {
if (oc == builder.resourceClass)
continue;
cb = RestContext.create(this, servletConfig, oc, null);
- BeanFactory bf = BeanFactory.of(beanFactory, resource).addBean(RestContextBuilder.class, cb);
+ BeanStore bf = BeanStore.of(beanStore, resource).addBean(RestContextBuilder.class, cb);
if (bf.getBean(oc).isPresent()) {
o = (Supplier<?>)()->bf.getBean(oc).get(); // If we resolved via injection, always get it this way.
} else {
@@ -5616,8 +5616,8 @@ public class RestContext extends BeanContext {
x.add(cc);
}
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(RestChildrenBuilder.class, x)
.beanCreateMethodFinder(RestChildrenBuilder.class, resource)
.find("createRestChildrenBuilder")
@@ -5635,13 +5635,13 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The default response headers for this REST object.
* @throws Exception If list could not be instantiated.
*/
- protected MethodList createStartCallMethods(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected MethodList createStartCallMethods(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
Map<String,Method> x = AMap.create();
for (MethodInfo m : ClassInfo.ofProxy(resource).getAllMethodsParentFirst())
@@ -5651,8 +5651,8 @@ public class RestContext extends BeanContext {
MethodList x2 = MethodList.of(x.values());
- x2 = BeanFactory
- .of(beanFactory, resource)
+ x2 = BeanStore
+ .of(beanStore, resource)
.addBean(MethodList.class, x2)
.beanCreateMethodFinder(MethodList.class, resource)
.find("createStartCallMethods")
@@ -5670,13 +5670,13 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The default response headers for this REST object.
* @throws Exception If list could not be instantiated.
*/
- protected MethodList createEndCallMethods(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected MethodList createEndCallMethods(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
Map<String,Method> x = AMap.create();
for (MethodInfo m : ClassInfo.ofProxy(resource).getAllMethodsParentFirst())
@@ -5686,8 +5686,8 @@ public class RestContext extends BeanContext {
MethodList x2 = MethodList.of(x.values());
- x2 = BeanFactory
- .of(beanFactory, resource)
+ x2 = BeanStore
+ .of(beanStore, resource)
.addBean(MethodList.class, x2)
.beanCreateMethodFinder(MethodList.class, resource)
.find("createEndCallMethods")
@@ -5705,13 +5705,13 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The default response headers for this REST object.
* @throws Exception If list could not be instantiated.
*/
- protected MethodList createPostInitMethods(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected MethodList createPostInitMethods(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
Map<String,Method> x = AMap.create();
for (MethodInfo m : ClassInfo.ofProxy(resource).getAllMethodsParentFirst())
@@ -5721,8 +5721,8 @@ public class RestContext extends BeanContext {
MethodList x2 = MethodList.of(x.values());
- x2 = BeanFactory
- .of(beanFactory, resource)
+ x2 = BeanStore
+ .of(beanStore, resource)
.addBean(MethodList.class, x2)
.beanCreateMethodFinder(MethodList.class, resource)
.find("createPostInitMethods")
@@ -5740,13 +5740,13 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The default response headers for this REST object.
* @throws Exception If list could not be instantiated.
*/
- protected MethodList createPostInitChildFirstMethods(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected MethodList createPostInitChildFirstMethods(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
Map<String,Method> x = AMap.create();
for (MethodInfo m : ClassInfo.ofProxy(resource).getAllMethodsParentFirst())
@@ -5756,8 +5756,8 @@ public class RestContext extends BeanContext {
MethodList x2 = MethodList.of(x.values());
- x2 = BeanFactory
- .of(beanFactory, resource)
+ x2 = BeanStore
+ .of(beanStore, resource)
.addBean(MethodList.class, x2)
.beanCreateMethodFinder(MethodList.class, resource)
.find("createPostInitChildFirstMethods")
@@ -5775,13 +5775,13 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The default response headers for this REST object.
* @throws Exception If list could not be instantiated.
*/
- protected MethodList createDestroyMethods(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected MethodList createDestroyMethods(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
Map<String,Method> x = AMap.create();
for (MethodInfo m : ClassInfo.ofProxy(resource).getAllMethodsParentFirst())
@@ -5791,8 +5791,8 @@ public class RestContext extends BeanContext {
MethodList x2 = MethodList.of(x.values());
- x2 = BeanFactory
- .of(beanFactory, resource)
+ x2 = BeanStore
+ .of(beanStore, resource)
.addBean(MethodList.class, x2)
.beanCreateMethodFinder(MethodList.class, resource)
.find("createDestroyMethods")
@@ -5810,13 +5810,13 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The default response headers for this REST object.
* @throws Exception If list could not be instantiated.
*/
- protected MethodList createPreCallMethods(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected MethodList createPreCallMethods(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
Map<String,Method> x = AMap.create();
for (MethodInfo m : ClassInfo.ofProxy(resource).getAllMethodsParentFirst())
@@ -5826,8 +5826,8 @@ public class RestContext extends BeanContext {
MethodList x2 = MethodList.of(x.values());
- x2 = BeanFactory
- .of(beanFactory, resource)
+ x2 = BeanStore
+ .of(beanStore, resource)
.addBean(MethodList.class, x2)
.beanCreateMethodFinder(MethodList.class, resource)
.find("createPreCallMethods")
@@ -5845,13 +5845,13 @@ public class RestContext extends BeanContext {
* @param properties
* The properties of this bean.
* <br>Consists of all properties gathered through the builder and annotations on this class and all parent classes.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The default response headers for this REST object.
* @throws Exception If list could not be instantiated.
*/
- protected MethodList createPostCallMethods(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected MethodList createPostCallMethods(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
Map<String,Method> x = AMap.create();
for (MethodInfo m : ClassInfo.ofProxy(resource).getAllMethodsParentFirst())
@@ -5861,8 +5861,8 @@ public class RestContext extends BeanContext {
MethodList x2 = MethodList.of(x.values());
- x2 = BeanFactory
- .of(beanFactory, resource)
+ x2 = BeanStore
+ .of(beanStore, resource)
.addBean(MethodList.class, x2)
.beanCreateMethodFinder(MethodList.class, resource)
.find("createPostCallMethods")
@@ -5873,19 +5873,19 @@ public class RestContext extends BeanContext {
}
/**
- * Returns the bean factory associated with this context.
+ * Returns the bean store associated with this context.
*
* <p>
- * The bean factory is used for instantiating child resource classes.
+ * The bean store is used for instantiating child resource classes.
*
* <ul class='seealso'>
- * <li class='jf'>{@link #REST_beanFactory}
+ * <li class='jf'>{@link #REST_beanStore}
* </ul>
*
* @return The resource resolver associated with this context.
*/
- protected BeanFactory getBeanFactory() {
- return beanFactory;
+ protected BeanStore getBeanStore() {
+ return beanStore;
}
/**
@@ -6487,12 +6487,12 @@ public class RestContext extends BeanContext {
}
/**
- * Returns the root bean factory for this context.
+ * Returns the root bean store for this context.
*
- * @return The root bean factory for this context.
+ * @return The root bean store for this context.
*/
- public BeanFactory getRootBeanFactory() {
- return rootBeanFactory;
+ public BeanStore getRootBeanStore() {
+ return rootBeanStore;
}
/**
@@ -6535,25 +6535,25 @@ public class RestContext extends BeanContext {
* Finds the {@link RestOperationArg} instances to handle resolving objects on the calls to the specified Java method.
*
* @param m The Java method being called.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The array of resolvers.
*/
- protected RestOperationArg[] findRestOperationArgs(Method m, BeanFactory beanFactory) {
+ protected RestOperationArg[] findRestOperationArgs(Method m, BeanStore beanStore) {
MethodInfo mi = MethodInfo.of(m);
List<ClassInfo> pt = mi.getParamTypes();
RestOperationArg[] ra = new RestOperationArg[pt.size()];
- beanFactory = BeanFactory.of(beanFactory, getResource());
+ beanStore = BeanStore.of(beanStore, getResource());
for (int i = 0; i < pt.size(); i++) {
ParamInfo pi = mi.getParam(i);
- beanFactory.addBean(ParamInfo.class, pi);
+ beanStore.addBean(ParamInfo.class, pi);
for (Class<? extends RestOperationArg> c : opArgs) {
try {
- ra[i] = beanFactory.createBean(c);
+ ra[i] = beanStore.createBean(c);
if (ra[i] != null)
break;
} catch (ExecutableException e) {
@@ -6571,24 +6571,24 @@ public class RestContext extends BeanContext {
* Finds the {@link RestOperationArg} instances to handle resolving objects on pre-call and post-call Java methods.
*
* @param m The Java method being called.
- * @param beanFactory
+ * @param beanStore
* The factory used for creating beans and retrieving injected beans.
- * <br>Created by {@link #createBeanFactory(Object,ContextProperties,RestContext)}.
+ * <br>Created by {@link #createBeanStore(Object,ContextProperties,RestContext)}.
* @return The array of resolvers.
*/
- protected RestOperationArg[] findHookMethodArgs(Method m, BeanFactory beanFactory) {
+ protected RestOperationArg[] findHookMethodArgs(Method m, BeanStore beanStore) {
MethodInfo mi = MethodInfo.of(m);
List<ClassInfo> pt = mi.getParamTypes();
RestOperationArg[] ra = new RestOperationArg[pt.size()];
- beanFactory = BeanFactory.of(beanFactory, getResource());
+ beanStore = BeanStore.of(beanStore, getResource());
for (int i = 0; i < pt.size(); i++) {
ParamInfo pi = mi.getParam(i);
- beanFactory.addBean(ParamInfo.class, pi);
+ beanStore.addBean(ParamInfo.class, pi);
for (Class<? extends RestOperationArg> c : hookMethodArgs) {
try {
- ra[i] = beanFactory.createBean(c);
+ ra[i] = beanStore.createBean(c);
if (ra[i] != null)
break;
} catch (ExecutableException e) {
@@ -6936,7 +6936,7 @@ public class RestContext extends BeanContext {
protected void startCall(RestCall call) throws HttpException {
for (MethodInvoker x : startCallMethods) {
try {
- x.invokeUsingFactory(call.getBeanFactory(), call.getContext().getResource());
+ x.invokeUsingFactory(call.getBeanStore(), call.getContext().getResource());
} catch (ExecutableException e) {
throw toHttpException(e.unwrap(), InternalServerError.class);
}
@@ -6976,7 +6976,7 @@ public class RestContext extends BeanContext {
protected void finishCall(RestCall call) {
for (MethodInvoker x : endCallMethods) {
try {
- x.invokeUsingFactory(call.getBeanFactory(), call.getResource());
+ x.invokeUsingFactory(call.getBeanStore(), call.getResource());
} catch (ExecutableException e) {
logger.log(Level.WARNING, e.unwrap(), ()->format("Error occurred invoking finish-call method ''{0}''.", x.getFullName()));
}
@@ -7003,7 +7003,7 @@ public class RestContext extends BeanContext {
}
for (MethodInvoker x : postInitMethods) {
try {
- x.invokeUsingFactory(beanFactory, getResource());
+ x.invokeUsingFactory(beanStore, getResource());
} catch (ExecutableException e) {
throw new ServletException(e.unwrap());
}
@@ -7024,7 +7024,7 @@ public class RestContext extends BeanContext {
restChildren.postInitChildFirst();
for (MethodInvoker x : postInitChildFirstMethods) {
try {
- x.invokeUsingFactory(beanFactory, getResource());
+ x.invokeUsingFactory(beanStore, getResource());
} catch (ExecutableException e) {
throw new ServletException(e.unwrap());
}
@@ -7039,7 +7039,7 @@ public class RestContext extends BeanContext {
protected void destroy() {
for (MethodInvoker x : destroyMethods) {
try {
- x.invokeUsingFactory(beanFactory, getResource());
+ x.invokeUsingFactory(beanStore, getResource());
} catch (ExecutableException e) {
getLogger().log(Level.WARNING, e.unwrap(), ()->format("Error occurred invoking servlet-destroy method ''{0}''.", x.getFullName()));
}
@@ -7128,7 +7128,7 @@ public class RestContext extends BeanContext {
.a("allowedMethodHeader", allowedMethodHeaders)
.a("allowedMethodParams", allowedMethodParams)
.a("allowedHeaderParams", allowedHeaderParams)
- .a("beanFactory", beanFactory)
+ .a("beanStore", beanStore)
.a("clientVersionHeader", clientVersionHeader)
.a("consumes", consumes)
.a("defaultRequestHeaders", defaultRequestHeaders)
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
index ce84879..b439667 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
@@ -98,7 +98,7 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon
final ServletConfig inner;
final Class<?> resourceClass;
final RestContext parentContext;
- final BeanFactory beanFactory;
+ final BeanStore beanStore;
//-----------------------------------------------------------------------------------------------------------------
// The following fields are meant to be modifiable.
@@ -141,10 +141,10 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon
set(REST_fileFinderDefault, pcp.get(REST_fileFinderDefault).orElse(null));
}
- beanFactory = createBeanFactory(parentContext, resource);
- beanFactory.addBean(RestContextBuilder.class, this);
- beanFactory.addBean(ServletConfig.class, servletConfig.orElse(this));
- beanFactory.addBean(ServletContext.class, servletConfig.orElse(this).getServletContext());
+ beanStore = createBeanStore(parentContext, resource);
+ beanStore.addBean(RestContextBuilder.class, this);
+ beanStore.addBean(ServletConfig.class, servletConfig.orElse(this));
+ beanStore.addBean(ServletContext.class, servletConfig.orElse(this).getServletContext());
varResolverBuilder = new VarResolverBuilder()
.defaultVars()
@@ -153,16 +153,16 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon
.bean(FileFinder.class, FileFinder.create().cp(resourceClass,null,true).build());
VarResolver vr = varResolverBuilder.build();
- beanFactory.addBean(VarResolver.class, vr);
+ beanStore.addBean(VarResolver.class, vr);
// Find our config file. It's the last non-empty @RestResource(config).
- config = createConfig(resourceClass, beanFactory);
- beanFactory.addBean(Config.class, config);
+ config = createConfig(resourceClass, beanStore);
+ beanStore.addBean(Config.class, config);
// Add our config file to the variable resolver.
varResolverBuilder.bean(Config.class, config);
vr = varResolverBuilder.build();
- beanFactory.addBean(VarResolver.class, vr);
+ beanStore.addBean(VarResolver.class, vr);
// Add the servlet init parameters to our properties.
if (servletConfig.isPresent()) {
@@ -185,7 +185,7 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon
public RestContext build() {
try {
Class<? extends RestContext> c = getContextProperties().getClass(REST_contextClass, RestContext.class).orElse(getDefaultImplClass());
- return BeanFactory.of(beanFactory, resource.get()).addBeans(RestContextBuilder.class, this).createBean(c);
+ return BeanStore.of(beanStore, resource.get()).addBeans(RestContextBuilder.class, this).createBean(c);
} catch (Exception e) {
throw toHttpException(e, InternalServerError.class);
}
@@ -201,52 +201,52 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon
}
/**
- * Creates the bean factory for this builder.
+ * Creates the bean store for this builder.
*
* @param parentContext The parent context if there is one.
* @param resource The resource object if it's instantiated at this time.
- * @return A new bean factory.
- * @throws Exception If bean factory could not be instantiated.
+ * @return A new bean store.
+ * @throws Exception If bean store could not be instantiated.
*/
- protected BeanFactory createBeanFactory(Optional<RestContext> parentContext, Optional<Object> resource) throws Exception {
- BeanFactory x = null;
+ protected BeanStore createBeanStore(Optional<RestContext> parentContext, Optional<Object> resource) throws Exception {
+ BeanStore x = null;
if (resource.isPresent()) {
Object r = resource.get();
- x = BeanFactory
- .of(parentContext.isPresent() ? parentContext.get().getRootBeanFactory() : null, r)
- .beanCreateMethodFinder(BeanFactory.class, resource)
- .find("createBeanFactory")
+ x = BeanStore
+ .of(parentContext.isPresent() ? parentContext.get().getRootBeanStore() : null, r)
+ .beanCreateMethodFinder(BeanStore.class, resource)
+ .find("createBeanStore")
.run();
}
if (x == null && parentContext.isPresent()) {
- x = parentContext.get().getRootBeanFactory();
+ x = parentContext.get().getRootBeanStore();
}
- return BeanFactory.of(x, resource.orElse(null));
+ return BeanStore.of(x, resource.orElse(null));
}
/**
* Creates the config for this builder.
*
* @param resourceClass The resource class.
- * @param beanFactory The bean factory to use for creating the config.
- * @return A new bean factory.
- * @throws Exception If bean factory could not be instantiated.
+ * @param beanStore The bean store to use for creating the config.
+ * @return A new bean store.
+ * @throws Exception If bean store could not be instantiated.
*/
- protected Config createConfig(Class<?> resourceClass, BeanFactory beanFactory) throws Exception {
+ protected Config createConfig(Class<?> resourceClass, BeanStore beanStore) throws Exception {
ClassInfo rci = ClassInfo.of(resourceClass);
Config x = null;
Object o = resource == null ? null : resource.get();
if (o instanceof Config)
x = (Config)o;
if (x == null)
- x = beanFactory.getBean(Config.class).orElse(null);
+ x = beanStore.getBean(Config.class).orElse(null);
// Find our config file. It's the last non-empty @RestResource(config).
String configPath = "";
for (AnnotationInfo<Rest> r : rci.getAnnotationInfos(Rest.class))
if (! r.getAnnotation().config().isEmpty())
configPath = r.getAnnotation().config();
- VarResolver vr = beanFactory.getBean(VarResolver.class).orElseThrow(()->new RuntimeException("VarResolver not found."));
+ VarResolver vr = beanStore.getBean(VarResolver.class).orElseThrow(()->new RuntimeException("VarResolver not found."));
String cf = vr.resolve(configPath);
if ("SYSTEM_DEFAULT".equals(cf))
@@ -281,12 +281,12 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon
for (MethodInfo m : map.values()) {
List<ClassInfo> paramTypes = m.getParamTypes();
- List<ClassInfo> missing = beanFactory.getMissingParamTypes(paramTypes);
+ List<ClassInfo> missing = beanStore.getMissingParamTypes(paramTypes);
if (!missing.isEmpty())
throw new RestServletException("Could not call @RestHook(INIT) method {0}.{1}. Could not find prerequisites: {2}.", m.getDeclaringClass().getSimpleName(), m.getSignature(), missing.stream().map(x->x.getSimpleName()).collect(Collectors.joining(",")));
try {
- m.invoke(resource, beanFactory.getParams(paramTypes));
+ m.invoke(resource, beanStore.getParams(paramTypes));
} catch (Exception e) {
throw new RestServletException(e, "Exception thrown from @RestHook(INIT) method {0}.{1}.", m.getDeclaringClass().getSimpleName(), m.getSignature());
}
@@ -506,7 +506,7 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon
}
/**
- * <i><l>RestContext</l> configuration property: </i> Bean factory.
+ * <i><l>RestContext</l> configuration property: </i> Bean store.
*
* <p>
* The resolver used for resolving instances of child resources and various other beans including:
@@ -518,11 +518,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon
* </ul>
*
* <p>
- * Note that the <c>SpringRestServlet</c> classes uses the <c>SpringBeanFactory</c> class to allow for any
+ * Note that the <c>SpringRestServlet</c> classes uses the <c>SpringBeanStore</c> class to allow for any
* Spring beans to be injected into your REST resources.
*
* <ul class='seealso'>
- * <li class='jf'>{@link RestContext#REST_beanFactory}
+ * <li class='jf'>{@link RestContext#REST_beanStore}
* <li class='link'>{@doc RestInjection}
* </ul>
*
@@ -532,12 +532,12 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon
* @return This object (for method chaining).
*/
@FluentSetter
- public RestContextBuilder beanFactory(Class<? extends BeanFactory> value) {
- return set(REST_beanFactory, value);
+ public RestContextBuilder beanStore(Class<? extends BeanStore> value) {
+ return set(REST_beanStore, value);
}
/**
- * <i><l>RestContext</l> configuration property: </i> Bean factory.
+ * <i><l>RestContext</l> configuration property: </i> Bean store.
*
* <p>
* The resolver used for resolving instances of child resources and various other beans including:
@@ -549,11 +549,11 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon
* </ul>
*
* <p>
- * Note that the <c>Spr÷ingRestServlet</c> classes uses the <c>SpringBeanFactory</c> class to allow for any
+ * Note that the <c>Spr÷ingRestServlet</c> classes uses the <c>SpringBeanStore</c> class to allow for any
* Spring beans to be injected into your REST resources.
*
* <ul class='seealso'>
- * <li class='jf'>{@link RestContext#REST_beanFactory}
+ * <li class='jf'>{@link RestContext#REST_beanStore}
* <li class='link'>{@doc RestInjection}
* </ul>
*
@@ -563,8 +563,8 @@ public class RestContextBuilder extends BeanContextBuilder implements ServletCon
* @return This object (for method chaining).
*/
@FluentSetter
- public RestContextBuilder beanFactory(BeanFactory value) {
- return set(REST_beanFactory, value);
+ public RestContextBuilder beanStore(BeanStore value) {
+ return set(REST_beanStore, value);
}
/**
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContext.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContext.java
index f91bca9..034e5cd 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContext.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContext.java
@@ -193,8 +193,8 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
* The subclass must have a public constructor that takes in any of the following arguments:
* <ul>
* <li>{@link RestOperationContextBuilder} - The builder for the object.
- * <li>Any beans found in the specified {@link #REST_beanFactory bean factory}.
- * <li>Any {@link Optional} beans that may or may not be found in the specified {@link #REST_beanFactory bean factory}.
+ * <li>Any beans found in the specified {@link #REST_beanStore bean store}.
+ * <li>Any {@link Optional} beans that may or may not be found in the specified {@link #REST_beanStore bean store}.
* </ul>
*
* <h5 class='section'>Example:</h5>
@@ -213,9 +213,9 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
*
* <jc>// Override the method used to create default request attributes.</jc>
* <ja>@Override</ja>
- * <jk>protected</jk> NamedAttributeList createDefaultRequestAttributes(Object <jv>resource</jv>, BeanFactory <jv>beanFactory</jv>, Method <jv>method</jv>, RestContext <jv>context</jv>) <jk>throws</jk> Exception {
+ * <jk>protected</jk> NamedAttributeList createDefaultRequestAttributes(Object <jv>resource</jv>, BeanStore <jv>beanStore</jv>, Method <jv>method</jv>, RestContext <jv>context</jv>) <jk>throws</jk> Exception {
* <jk>return super</jk>
- * .createDefaultRequestAttributes(<jv>resource</jv>, <jv>beanFactory</jv>, <jv>method</jv>, <jv>context</jv>)
+ * .createDefaultRequestAttributes(<jv>resource</jv>, <jv>beanStore</jv>, <jv>method</jv>, <jv>context</jv>)
* .append(NamedAttribute.<jsm>of</jsm>(<js>"foo"</js>, ()-><jf>fooSupplier</jf>.get());
* }
* }
@@ -702,52 +702,52 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
mi = MethodInfo.of(method).accessible();
Object r = context.getResource();
- BeanFactory bf = BeanFactory.of(context.getRootBeanFactory(), r)
+ BeanStore bs = BeanStore.of(context.getRootBeanStore(), r)
.addBean(RestOperationContext.class, this)
.addBean(Method.class, method)
.addBean(ContextProperties.class, cp);
- bf.addBean(BeanFactory.class, bf);
+ bs.addBean(BeanStore.class, bs);
- serializers = createSerializers(r, cp, bf);
- bf.addBean(SerializerGroup.class, serializers);
+ serializers = createSerializers(r, cp, bs);
+ bs.addBean(SerializerGroup.class, serializers);
- parsers = createParsers(r, cp, bf);
- bf.addBean(ParserGroup.class, parsers);
+ parsers = createParsers(r, cp, bs);
+ bs.addBean(ParserGroup.class, parsers);
- partSerializer = createPartSerializer(r, cp, bf);
- bf.addBean(HttpPartSerializer.class, partSerializer);
+ partSerializer = createPartSerializer(r, cp, bs);
+ bs.addBean(HttpPartSerializer.class, partSerializer);
- partParser = createPartParser(r, cp, bf);
- bf.addBean(HttpPartParser.class, partParser);
+ partParser = createPartParser(r, cp, bs);
+ bs.addBean(HttpPartParser.class, partParser);
- converters = createConverters(r, cp, bf).asArray();
- bf.addBean(RestConverter[].class, converters);
+ converters = createConverters(r, cp, bs).asArray();
+ bs.addBean(RestConverter[].class, converters);
- guards = createGuards(r, cp, bf).asArray();
- bf.addBean(RestGuard[].class, guards);
+ guards = createGuards(r, cp, bs).asArray();
+ bs.addBean(RestGuard[].class, guards);
- RestMatcherList matchers = createMatchers(r, cp, bf);
+ RestMatcherList matchers = createMatchers(r, cp, bs);
requiredMatchers = matchers.stream().filter(x -> x.required()).toArray(RestMatcher[]::new);
optionalMatchers = matchers.stream().filter(x -> ! x.required()).toArray(RestMatcher[]::new);
- pathMatchers = createPathMatchers(r, cp, bf).asArray();
- bf.addBean(UrlPathMatcher[].class, pathMatchers);
- bf.addBean(UrlPathMatcher.class, pathMatchers.length > 0 ? pathMatchers[0] : null);
+ pathMatchers = createPathMatchers(r, cp, bs).asArray();
+ bs.addBean(UrlPathMatcher[].class, pathMatchers);
+ bs.addBean(UrlPathMatcher.class, pathMatchers.length > 0 ? pathMatchers[0] : null);
- encoders = createEncoders(r, cp, bf);
- bf.addBean(EncoderGroup.class, encoders);
+ encoders = createEncoders(r, cp, bs);
+ bs.addBean(EncoderGroup.class, encoders);
- jsonSchemaGenerator = createJsonSchemaGenerator(r, cp, bf);
- bf.addBean(JsonSchemaGenerator.class, jsonSchemaGenerator);
+ jsonSchemaGenerator = createJsonSchemaGenerator(r, cp, bs);
+ bs.addBean(JsonSchemaGenerator.class, jsonSchemaGenerator);
supportedAcceptTypes = unmodifiableList(cp.getList(REST_produces, MediaType.class).orElse(serializers.getSupportedMediaTypes()));
supportedContentTypes = unmodifiableList(cp.getList(REST_consumes, MediaType.class).orElse(parsers.getSupportedMediaTypes()));
- defaultRequestHeaders = unmodifiableList(createDefaultRequestHeaders(r, cp, bf, method, context));
- defaultResponseHeaders = unmodifiableList(createDefaultResponseHeaders(r, cp, bf, method, context));
- defaultRequestQuery = unmodifiableList(createDefaultRequestQuery(r, cp, bf, method));
- defaultRequestFormData = unmodifiableList(createDefaultRequestFormData(r, cp, bf, method));
- defaultRequestAttributes = unmodifiableList(createDefaultRequestAttributes(r, cp, bf, method, context));
+ defaultRequestHeaders = unmodifiableList(createDefaultRequestHeaders(r, cp, bs, method, context));
+ defaultResponseHeaders = unmodifiableList(createDefaultResponseHeaders(r, cp, bs, method, context));
+ defaultRequestQuery = unmodifiableList(createDefaultRequestQuery(r, cp, bs, method));
+ defaultRequestFormData = unmodifiableList(createDefaultRequestFormData(r, cp, bs, method));
+ defaultRequestAttributes = unmodifiableList(createDefaultRequestAttributes(r, cp, bs, method, context));
int _hierarchyDepth = 0;
Class<?> sc = method.getDeclaringClass().getSuperclass();
@@ -770,7 +770,7 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
responseMeta = ResponseBeanMeta.create(mi, cp);
- opArgs = context.findRestOperationArgs(mi.inner(), bf);
+ opArgs = context.findRestOperationArgs(mi.inner(), bs);
this.callLogger = context.getCallLogger();
} catch (ServletException e) {
@@ -797,31 +797,31 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
* <ul>
* <li>{@link Method} - The Java method this context belongs to.
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Instantiates a <c>RestConverter[0]</c>.
* </ul>
*
* @param resource The REST resource object.
* @param properties xxx
- * @param beanFactory The bean factory to use for retrieving and creating beans.
+ * @param beanStore The bean store to use for retrieving and creating beans.
* @return The result converters for this REST resource method.
* @throws Exception If result converters could not be instantiated.
* @seealso #REST_converters
*/
- protected RestConverterList createConverters(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected RestConverterList createConverters(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
RestConverterList x = RestConverterList.create();
- x.append(properties.getInstanceArray(REST_converters, RestConverter.class, beanFactory).orElse(new RestConverter[0]));
+ x.append(properties.getInstanceArray(REST_converters, RestConverter.class, beanStore).orElse(new RestConverter[0]));
if (x.isEmpty())
- x = beanFactory.getBean(RestConverterList.class).orElse(x);
+ x = beanStore.getBean(RestConverterList.class).orElse(x);
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(RestConverterList.class, x)
.beanCreateMethodFinder(RestConverterList.class, resource)
.find("createConverters", Method.class)
@@ -849,28 +849,28 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
* <ul>
* <li>{@link Method} - The Java method this context belongs to.
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Instantiates a <c>RestGuard[0]</c>.
* </ul>
*
* @param resource The REST resource object.
* @param properties xxx
- * @param beanFactory The bean factory to use for retrieving and creating beans.
+ * @param beanStore The bean store to use for retrieving and creating beans.
* @return The guards for this REST resource method.
* @throws Exception If guards could not be instantiated.
* @seealso #REST_guards
*/
- protected RestGuardList createGuards(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected RestGuardList createGuards(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
RestGuardList x = RestGuardList.create();
- x.append(properties.getInstanceArray(REST_guards, RestGuard.class, beanFactory).orElse(new RestGuard[0]));
+ x.append(properties.getInstanceArray(REST_guards, RestGuard.class, beanStore).orElse(new RestGuard[0]));
if (x.isEmpty())
- x = beanFactory.getBean(RestGuardList.class).orElse(x);
+ x = beanStore.getBean(RestGuardList.class).orElse(x);
Set<String> rolesDeclared = properties.getSet(REST_rolesDeclared, String.class).orElse(null);
Set<String> roleGuard = properties.getSet(REST_roleGuard, String.class).orElse(Collections.emptySet());
@@ -883,8 +883,8 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
}
}
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(RestGuardList.class, x)
.beanCreateMethodFinder(RestGuardList.class, resource)
.find("createGuards", Method.class)
@@ -910,35 +910,35 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
* <ul>
* <li>{@link java.lang.reflect.Method} - The Java method this context belongs to.
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Instantiates a <c>RestMatcher[0]</c>.
* </ul>
*
* @param resource The REST resource object.
* @param properties xxx
- * @param beanFactory The bean factory to use for retrieving and creating beans.
+ * @param beanStore The bean store to use for retrieving and creating beans.
* @return The method matchers for this REST resource method.
* @throws Exception If method matchers could not be instantiated.
* @seealso #RESTMETHOD_matchers
*/
- protected RestMatcherList createMatchers(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected RestMatcherList createMatchers(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
RestMatcherList x = RestMatcherList.create();
- x.append(properties.getInstanceArray(RESTOP_matchers, RestMatcher.class, beanFactory).orElse(new RestMatcher[0]));
+ x.append(properties.getInstanceArray(RESTOP_matchers, RestMatcher.class, beanStore).orElse(new RestMatcher[0]));
if (x.isEmpty())
- x = beanFactory.getBean(RestMatcherList.class).orElse(x);
+ x = beanStore.getBean(RestMatcherList.class).orElse(x);
String clientVersion = properties.get(RESTOP_clientVersion, String.class).orElse(null);
if (clientVersion != null)
x.add(new ClientVersionMatcher(context.getClientVersionHeader(), mi));
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(RestMatcherList.class, x)
.beanCreateMethodFinder(RestMatcherList.class, resource)
.find("createMatchers", Method.class)
@@ -965,26 +965,26 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
* <ul>
* <li>{@link Method} - The Java method this context belongs to.
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Instantiates a <c>Encoder[0]</c>.
* </ul>
*
* @param resource The REST resource object.
* @param properties xxx
- * @param beanFactory The bean factory to use for retrieving and creating beans.
+ * @param beanStore The bean store to use for retrieving and creating beans.
* @return The encoders for this REST resource method.
* @throws Exception If encoders could not be instantiated.
* @seealso #REST_encoders
*/
- protected EncoderGroup createEncoders(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected EncoderGroup createEncoders(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
- Encoder[] x = properties.getInstanceArray(REST_encoders, Encoder.class, beanFactory).orElse(null);
+ Encoder[] x = properties.getInstanceArray(REST_encoders, Encoder.class, beanStore).orElse(null);
if (x == null)
- x = beanFactory.getBean(Encoder[].class).orElse(null);
+ x = beanStore.getBean(Encoder[].class).orElse(null);
if (x == null)
x = new Encoder[0];
@@ -995,8 +995,8 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
.append(x)
.build();
- g = BeanFactory
- .of(beanFactory, resource)
+ g = BeanStore
+ .of(beanStore, resource)
.addBean(EncoderGroup.class, g)
.beanCreateMethodFinder(EncoderGroup.class, resource)
.find("createEncoders", Method.class)
@@ -1022,29 +1022,29 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
* resource class with any of the following arguments:
* <ul>
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Instantiates a <c>Serializer[0]</c>.
* </ul>
*
* @param resource The REST resource object.
* @param properties The property store of this method.
- * @param beanFactory The bean factory to use for retrieving and creating beans.
+ * @param beanStore The bean store to use for retrieving and creating beans.
* @return The serializers for this REST resource.
* @throws Exception If serializers could not be instantiated.
* @seealso #REST_serializers
*/
- protected SerializerGroup createSerializers(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected SerializerGroup createSerializers(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
- SerializerGroup g = beanFactory.getBean(SerializerGroup.class).orElse(null);
+ SerializerGroup g = beanStore.getBean(SerializerGroup.class).orElse(null);
if (g == null) {
Object[] x = properties.getArray(REST_serializers, Object.class).orElse(null);
if (x == null)
- x = beanFactory.getBean(Serializer[].class).orElse(null);
+ x = beanStore.getBean(Serializer[].class).orElse(null);
if (x == null)
x = new Serializer[0];
@@ -1056,8 +1056,8 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
.build();
}
- g = BeanFactory
- .of(beanFactory, resource)
+ g = BeanStore
+ .of(beanStore, resource)
.addBean(SerializerGroup.class, g)
.beanCreateMethodFinder(SerializerGroup.class, resource)
.find("createSerializers", Method.class)
@@ -1083,29 +1083,29 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
* resource class with any of the following arguments:
* <ul>
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Instantiates a <c>Parser[0]</c>.
* </ul>
*
* @param resource The REST resource object.
* @param properties The property store of this method.
- * @param beanFactory The bean factory to use for retrieving and creating beans.
+ * @param beanStore The bean store to use for retrieving and creating beans.
* @return The parsers for this REST resource.
* @throws Exception If parsers could not be instantiated.
* @seealso #REST_parsers
*/
- protected ParserGroup createParsers(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected ParserGroup createParsers(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
- ParserGroup g = beanFactory.getBean(ParserGroup.class).orElse(null);
+ ParserGroup g = beanStore.getBean(ParserGroup.class).orElse(null);
if (g == null) {
Object[] x = properties.getArray(REST_parsers, Object.class).orElse(null);
if (x == null)
- x = beanFactory.getBean(Parser[].class).orElse(null);
+ x = beanStore.getBean(Parser[].class).orElse(null);
if (x == null)
x = new Parser[0];
@@ -1117,8 +1117,8 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
.build();
}
- g = BeanFactory
- .of(beanFactory, resource)
+ g = BeanStore
+ .of(beanStore, resource)
.addBean(ParserGroup.class, g)
.beanCreateMethodFinder(ParserGroup.class, resource)
.find("createParsers", Method.class)
@@ -1145,21 +1145,21 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
* resource class with any of the following arguments:
* <ul>
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Instantiates an {@link OpenApiSerializer}.
* </ul>
*
* @param resource The REST resource object.
* @param properties The property store of this method.
- * @param beanFactory The bean factory to use for retrieving and creating beans.
+ * @param beanStore The bean store to use for retrieving and creating beans.
* @return The HTTP part serializer for this REST resource.
* @throws Exception If serializer could not be instantiated.
* @seealso #REST_partSerializer
*/
- protected HttpPartSerializer createPartSerializer(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected HttpPartSerializer createPartSerializer(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
HttpPartSerializer x = null;
@@ -1167,16 +1167,16 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
x = (HttpPartSerializer)resource;
if (x == null)
- x = properties.getInstance(REST_partSerializer, HttpPartSerializer.class, beanFactory).orElse(null);
+ x = properties.getInstance(REST_partSerializer, HttpPartSerializer.class, beanStore).orElse(null);
if (x == null)
- x = beanFactory.getBean(HttpPartSerializer.class).orElse(null);
+ x = beanStore.getBean(HttpPartSerializer.class).orElse(null);
if (x == null)
x = new OpenApiSerializer(properties);
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(HttpPartSerializer.class, x)
.beanCreateMethodFinder(HttpPartSerializer.class, resource)
.find("createPartSerializer", Method.class)
@@ -1203,21 +1203,21 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
* resource class with any of the following arguments:
* <ul>
* <li>{@link RestContext}
- * <li>{@link BeanFactory}
+ * <li>{@link BeanStore}
* <li>Any {@doc RestInjection injected beans}.
* </ul>
- * <li>Resolves it via the bean factory registered in this context.
+ * <li>Resolves it via the bean store registered in this context.
* <li>Instantiates an {@link OpenApiSerializer}.
* </ul>
*
* @param resource The REST resource object.
* @param properties The property store of this method.
- * @param beanFactory The bean factory to use for retrieving and creating beans.
+ * @param beanStore The bean store to use for retrieving and creating beans.
* @return The HTTP part parser for this REST resource.
* @throws Exception If parser could not be instantiated.
* @seealso #REST_partParser
*/
- protected HttpPartParser createPartParser(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected HttpPartParser createPartParser(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
HttpPartParser x = null;
@@ -1225,16 +1225,16 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
x = (HttpPartParser)resource;
if (x == null)
- x = properties.getInstance(REST_partParser, HttpPartParser.class, beanFactory).orElse(null);
+ x = properties.getInstance(REST_partParser, HttpPartParser.class, beanStore).orElse(null);
if (x == null)
- x = beanFactory.getBean(HttpPartParser.class).orElse(null);
+ x = beanStore.getBean(HttpPartParser.class).orElse(null);
if (x == null)
x = new OpenApiParser(properties);
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(HttpPartParser.class, x)
.beanCreateMethodFinder(HttpPartParser.class, resource)
.find("createPartParser", Method.class)
@@ -1250,12 +1250,12 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
*
* @param resource The REST resource object.
* @param properties xxx
- * @param beanFactory The bean factory to use for retrieving and creating beans.
+ * @param beanStore The bean store to use for retrieving and creating beans.
* @return The HTTP part parser for this REST resource.
* @throws Exception If parser could not be instantiated.
* @seealso #RESTMETHOD_paths
*/
- protected UrlPathMatcherList createPathMatchers(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected UrlPathMatcherList createPathMatchers(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
UrlPathMatcherList x = UrlPathMatcherList.create();
boolean dotAll = properties.getBoolean("RestOperationContext.dotAll.b").orElse(false);
@@ -1289,8 +1289,8 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
x.add(UrlPathMatcher.of(p));
}
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(UrlPathMatcherList.class, x)
.beanCreateMethodFinder(UrlPathMatcherList.class, resource)
.find("createPathMatchers", Method.class)
@@ -1305,11 +1305,11 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
*
* @param resource The REST resource object.
* @param properties The property store of this method.
- * @param beanFactory The bean factory to use for retrieving and creating beans.
+ * @param beanStore The bean store to use for retrieving and creating beans.
* @return The JSON-schema generator for this method.
* @throws Exception If schema generator could not be instantiated.
*/
- protected JsonSchemaGenerator createJsonSchemaGenerator(Object resource, ContextProperties properties, BeanFactory beanFactory) throws Exception {
+ protected JsonSchemaGenerator createJsonSchemaGenerator(Object resource, ContextProperties properties, BeanStore beanStore) throws Exception {
JsonSchemaGenerator x = null;
@@ -1317,13 +1317,13 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
x = (JsonSchemaGenerator)resource;
if (x == null)
- x = beanFactory.getBean(JsonSchemaGenerator.class).orElse(null);
+ x = beanStore.getBean(JsonSchemaGenerator.class).orElse(null);
if (x == null)
x = JsonSchemaGenerator.create().apply(properties).build();
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(JsonSchemaGenerator.class, x)
.beanCreateMethodFinder(JsonSchemaGenerator.class, resource)
.find("createJsonSchemaGenerator", Method.class)
@@ -1339,19 +1339,19 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
*
* @param resource The REST resource object.
* @param properties xxx
- * @param beanFactory The bean factory to use for retrieving and creating beans.
+ * @param beanStore The bean store to use for retrieving and creating beans.
* @param method This Java method.
* @param context The REST class context.
* @return The default request headers for this method.
* @throws Exception If default request headers could not be instantiated.
*/
- protected HeaderList createDefaultRequestHeaders(Object resource, ContextProperties properties, BeanFactory beanFactory, Method method, RestContext context) throws Exception {
+ protected HeaderList createDefaultRequestHeaders(Object resource, ContextProperties properties, BeanStore beanStore, Method method, RestContext context) throws Exception {
HeaderList x = HeaderList.create();
x.appendUnique(context.getDefaultRequestHeaders());
- x.appendUnique(properties.getInstanceArray(RESTOP_defaultRequestHeaders, org.apache.http.Header.class, beanFactory).orElse(new org.apache.http.Header[0]));
+ x.appendUnique(properties.getInstanceArray(RESTOP_defaultRequestHeaders, org.apache.http.Header.class, beanStore).orElse(new org.apache.http.Header[0]));
for (Annotation[] aa : method.getParameterAnnotations()) {
for (Annotation a : aa) {
@@ -1369,8 +1369,8 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
}
}
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(HeaderList.class, x)
.beanCreateMethodFinder(HeaderList.class, resource)
.find("createDefaultRequestHeaders", Method.class)
@@ -1385,22 +1385,22 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
*
* @param resource The REST resource object.
* @param properties xxx
- * @param beanFactory The bean factory to use for retrieving and creating beans.
+ * @param beanStore The bean store to use for retrieving and creating beans.
* @param method This Java method.
* @param context The REST class context.
* @return The default request headers for this method.
* @throws Exception If default request headers could not be instantiated.
*/
- protected HeaderList createDefaultResponseHeaders(Object resource, ContextProperties properties, BeanFactory beanFactory, Method method, RestContext context) throws Exception {
+ protected HeaderList createDefaultResponseHeaders(Object resource, ContextProperties properties, BeanStore beanStore, Method method, RestContext context) throws Exception {
HeaderList x = HeaderList.create();
x.appendUnique(context.getDefaultResponseHeaders());
- x.appendUnique(properties.getInstanceArray(RESTOP_defaultResponseHeaders, org.apache.http.Header.class, beanFactory).orElse(new org.apache.http.Header[0]));
+ x.appendUnique(properties.getInstanceArray(RESTOP_defaultResponseHeaders, org.apache.http.Header.class, beanStore).orElse(new org.apache.http.Header[0]));
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(HeaderList.class, x)
.beanCreateMethodFinder(HeaderList.class, resource)
.find("createDefaultResponseHeaders", Method.class)
@@ -1415,21 +1415,21 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
*
* @param resource The REST resource object.
* @param properties xxx
- * @param beanFactory The bean factory to use for retrieving and creating beans.
+ * @param beanStore The bean store to use for retrieving and creating beans.
* @param method This Java method.
* @param context The REST class context.
* @return The default request attributes for this method.
* @throws Exception If default request headers could not be instantiated.
*/
- protected NamedAttributeList createDefaultRequestAttributes(Object resource, ContextProperties properties, BeanFactory beanFactory, Method method, RestContext context) throws Exception {
+ protected NamedAttributeList createDefaultRequestAttributes(Object resource, ContextProperties properties, BeanStore beanStore, Method method, RestContext context) throws Exception {
NamedAttributeList x = NamedAttributeList.create();
x.appendUnique(context.getDefaultRequestAttributes());
- x.appendUnique(properties.getInstanceArray(RESTOP_defaultRequestAttributes, NamedAttribute.class, beanFactory).orElse(new NamedAttribute[0]));
+ x.appendUnique(properties.getInstanceArray(RESTOP_defaultRequestAttributes, NamedAttribute.class, beanStore).orElse(new NamedAttribute[0]));
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(NamedAttributeList.class, x)
.beanCreateMethodFinder(NamedAttributeList.class, resource)
.find("createDefaultRequestAttributes", Method.class)
@@ -1444,16 +1444,16 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
*
* @param resource The REST resource object.
* @param properties xxx
- * @param beanFactory The bean factory to use for retrieving and creating beans.
+ * @param beanStore The bean store to use for retrieving and creating beans.
* @param method This Java method.
* @return The default request query parameters for this method.
* @throws Exception If default request query parameters could not be instantiated.
*/
- protected NameValuePairList createDefaultRequestQuery(Object resource, ContextProperties properties, BeanFactory beanFactory, Method method) throws Exception {
+ protected NameValuePairList createDefaultRequestQuery(Object resource, ContextProperties properties, BeanStore beanStore, Method method) throws Exception {
NameValuePairList x = NameValuePairList.create();
- x.appendUnique(properties.getInstanceArray(RESTOP_defaultQuery, NameValuePair.class, beanFactory).orElse(new NameValuePair[0]));
+ x.appendUnique(properties.getInstanceArray(RESTOP_defaultQuery, NameValuePair.class, beanStore).orElse(new NameValuePair[0]));
for (Annotation[] aa : method.getParameterAnnotations()) {
for (Annotation a : aa) {
@@ -1471,8 +1471,8 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
}
}
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(NameValuePairList.class, x)
.beanCreateMethodFinder(NameValuePairList.class, resource)
.find("createDefaultRequestQuery", Method.class)
@@ -1488,16 +1488,16 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
*
* @param resource The REST resource object.
* @param properties xxx
- * @param beanFactory The bean factory to use for retrieving and creating beans.
+ * @param beanStore The bean store to use for retrieving and creating beans.
* @param method This Java method.
* @return The default request form-data parameters for this method.
* @throws Exception If default request form-data parameters could not be instantiated.
*/
- protected NameValuePairList createDefaultRequestFormData(Object resource, ContextProperties properties, BeanFactory beanFactory, Method method) throws Exception {
+ protected NameValuePairList createDefaultRequestFormData(Object resource, ContextProperties properties, BeanStore beanStore, Method method) throws Exception {
NameValuePairList x = NameValuePairList.create();
- x.appendUnique(properties.getInstanceArray(RESTOP_defaultFormData, NameValuePair.class, beanFactory).orElse(new NameValuePair[0]));
+ x.appendUnique(properties.getInstanceArray(RESTOP_defaultFormData, NameValuePair.class, beanStore).orElse(new NameValuePair[0]));
for (Annotation[] aa : method.getParameterAnnotations()) {
for (Annotation a : aa) {
@@ -1515,8 +1515,8 @@ public class RestOperationContext extends BeanContext implements Comparable<Rest
}
}
- x = BeanFactory
- .of(beanFactory, resource)
+ x = BeanStore
+ .of(beanStore, resource)
.addBean(NameValuePairList.class, x)
.beanCreateMethodFinder(NameValuePairList.class, resource)
.find("createDefaultRequestFormData", Method.class)
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContextBuilder.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContextBuilder.java
index ea86f74..35e25c3 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContextBuilder.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationContextBuilder.java
@@ -39,7 +39,7 @@ public class RestOperationContextBuilder extends BeanContextBuilder {
RestContext restContext;
Method restMethod;
- private BeanFactory beanFactory;
+ private BeanStore beanStore;
private Class<? extends RestOperationContext> implClass;
@Override /* BeanContextBuilder */
@@ -51,7 +51,7 @@ public class RestOperationContextBuilder extends BeanContextBuilder {
if (ic == null)
ic = cp.getClass(RESTOP_contextClass, RestOperationContext.class).orElse(getDefaultImplClass());
- return BeanFactory.of(beanFactory).addBean(RestOperationContextBuilder.class, this).createBean(ic);
+ return BeanStore.of(beanStore).addBean(RestOperationContextBuilder.class, this).createBean(ic);
} catch (Exception e) {
throw toHttpException(e, InternalServerError.class);
}
@@ -70,7 +70,7 @@ public class RestOperationContextBuilder extends BeanContextBuilder {
this.restContext = context;
this.restMethod = method;
- this.beanFactory = context.getRootBeanFactory();
+ this.beanStore = context.getRootBeanStore();
MethodInfo mi = MethodInfo.of(context.getResourceClass(), method);
@@ -107,8 +107,8 @@ public class RestOperationContextBuilder extends BeanContextBuilder {
* The subclass must have a public constructor that takes in any of the following arguments:
* <ul>
* <li>{@link RestOperationContextBuilder} - This object.
- * <li>Any beans found in the specified {@link #beanFactory(BeanFactory) bean factory}.
- * <li>Any {@link Optional} beans that may or may not be found in the specified {@link #beanFactory(BeanFactory) bean factory}.
+ * <li>Any beans found in the specified {@link #beanStore(BeanStore) bean store}.
+ * <li>Any {@link Optional} beans that may or may not be found in the specified {@link #beanStore(BeanStore) bean store}.
* </ul>
*
* @param implClass The implementation class to build.
@@ -120,13 +120,13 @@ public class RestOperationContextBuilder extends BeanContextBuilder {
}
/**
- * Specifies a {@link BeanFactory} to use when resolving constructor arguments.
+ * Specifies a {@link BeanStore} to use when resolving constructor arguments.
*
- * @param beanFactory The bean factory to use for resolving constructor arguments.
+ * @param beanStore The bean store to use for resolving constructor arguments.
* @return This object (for method chaining).
*/
- public RestOperationContextBuilder beanFactory(BeanFactory beanFactory) {
- this.beanFactory = beanFactory;
+ public RestOperationContextBuilder beanStore(BeanStore beanStore) {
+ this.beanStore = beanStore;
return this;
}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationsBuilder.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationsBuilder.java
index 8f5c6a3..be10b68 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationsBuilder.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestOperationsBuilder.java
@@ -29,7 +29,7 @@ public class RestOperationsBuilder {
TreeMap<String,TreeSet<RestOperationContext>> map = new TreeMap<>();
Set<RestOperationContext> set = ASet.of();
- private BeanFactory beanFactory;
+ private BeanStore beanStore;
private Class<? extends RestOperations> implClass;
/**
@@ -40,7 +40,7 @@ public class RestOperationsBuilder {
public RestOperations build() {
try {
Class<? extends RestOperations> ic = firstNonNull(implClass, getDefaultImplClass());
- return BeanFactory.of(beanFactory).addBeans(RestOperationsBuilder.class, this).createBean(ic);
+ return BeanStore.of(beanStore).addBeans(RestOperationsBuilder.class, this).createBean(ic);
} catch (Exception e) {
throw toHttpException(e, InternalServerError.class);
}
@@ -91,8 +91,8 @@ public class RestOperationsBuilder {
* The subclass must have a public constructor that takes in any of the following arguments:
* <ul>
* <li>{@link RestOperationsBuilder} - This object.
- * <li>Any beans found in the specified {@link #beanFactory(BeanFactory) bean factory}.
- * <li>Any {@link Optional} beans that may or may not be found in the specified {@link #beanFactory(BeanFactory) bean factory}.
+ * <li>Any beans found in the specified {@link #beanStore(BeanStore) bean store}.
+ * <li>Any {@link Optional} beans that may or may not be found in the specified {@link #beanStore(BeanStore) bean store}.
* </ul>
*
* @param implClass The implementation class to build.
@@ -104,13 +104,13 @@ public class RestOperationsBuilder {
}
/**
- * Specifies a {@link BeanFactory} to use when resolving constructor arguments.
+ * Specifies a {@link BeanStore} to use when resolving constructor arguments.
*
- * @param beanFactory The bean factory to use for resolving constructor arguments.
+ * @param beanStore The bean store to use for resolving constructor arguments.
* @return This object (for method chaining).
*/
- public RestOperationsBuilder beanFactory(BeanFactory beanFactory) {
- this.beanFactory = beanFactory;
+ public RestOperationsBuilder beanStore(BeanStore beanStore) {
+ this.beanStore = beanStore;
return this;
}
}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestRequest.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestRequest.java
index aa558c9..5045dbc 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestRequest.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestRequest.java
@@ -1791,7 +1791,7 @@ public final class RestRequest {
if (varSession == null)
varSession = context
.getVarResolver()
- .createSession(call.getBeanFactory())
+ .createSession(call.getBeanStore())
.bean(RestRequest.class, this)
.bean(RestCall.class, call);
return varSession;
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestServlet.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestServlet.java
index c3771a5..72a328e 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestServlet.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestServlet.java
@@ -68,13 +68,13 @@ public abstract class RestServlet extends HttpServlet {
}
/**
- * Instantiates the bean factory to use for creating beans for this servlet.
+ * Instantiates the bean store to use for creating beans for this servlet.
*
- * @param parent The parent bean factory.
- * @return A new bean factory.
+ * @param parent The parent bean store.
+ * @return A new bean store.
*/
- public BeanFactory createBeanFactory(Optional<BeanFactory> parent) {
- return BeanFactory.of(parent.orElse(null), this);
+ public BeanStore createBeanStore(Optional<BeanStore> parent) {
+ return BeanStore.of(parent.orElse(null), this);
}
/**
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/StaticFilesBuilder.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/StaticFilesBuilder.java
index 88dcf31..8503776 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/StaticFilesBuilder.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/StaticFilesBuilder.java
@@ -79,8 +79,8 @@ public class StaticFilesBuilder extends FileFinderBuilder {
// <FluentSetters>
@Override /* GENERATED - FileFinderBuilder */
- public StaticFilesBuilder beanFactory(BeanFactory value) {
- super.beanFactory(value);
+ public StaticFilesBuilder beanStore(BeanStore value) {
+ super.beanStore(value);
return this;
}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/SwaggerProviderBuilder.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/SwaggerProviderBuilder.java
index 76c801c..e786f14 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/SwaggerProviderBuilder.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/SwaggerProviderBuilder.java
@@ -27,7 +27,7 @@ public class SwaggerProviderBuilder {
private Class<? extends SwaggerProvider> implClass;
- BeanFactory beanFactory;
+ BeanStore beanStore;
Class<?> resourceClass;
VarResolver varResolver;
JsonSchemaGenerator jsonSchemaGenerator;
@@ -46,7 +46,7 @@ public class SwaggerProviderBuilder {
public SwaggerProvider build() {
try {
Class<? extends SwaggerProvider> ic = isConcrete(implClass) ? implClass : getDefaultImplClass();
- return BeanFactory.of(beanFactory).addBeans(SwaggerProviderBuilder.class, this).createBean(ic);
+ return BeanStore.of(beanStore).addBeans(SwaggerProviderBuilder.class, this).createBean(ic);
} catch (Exception e) {
throw toHttpException(e, InternalServerError.class);
}
@@ -62,13 +62,13 @@ public class SwaggerProviderBuilder {
}
/**
- * Specifies the bean factory to use for instantiating the {@link SwaggerProvider} object.
+ * Specifies the bean store to use for instantiating the {@link SwaggerProvider} object.
*
* @param value The new value for this setting.
* @return This object (for method chaining).
*/
- public SwaggerProviderBuilder beanFactory(BeanFactory value) {
- this.beanFactory = value;
+ public SwaggerProviderBuilder beanStore(BeanStore value) {
+ this.beanStore = value;
return this;
}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Rest.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Rest.java
index 257a80b..e49a54a 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Rest.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/Rest.java
@@ -190,15 +190,15 @@ public @interface Rest {
* </ul>
*
* <p>
- * Note that the <c>SpringRestServlet</c> classes uses the <c>SpringBeanFactory</c> class to allow for any
+ * Note that the <c>SpringRestServlet</c> classes uses the <c>SpringBeanStore</c> class to allow for any
* Spring beans to be injected into your REST resources.
*
* <ul class='seealso'>
- * <li class='jf'>{@link RestContext#REST_beanFactory}
+ * <li class='jf'>{@link RestContext#REST_beanStore}
* <li class='link'>{@doc RestInjection}
* </ul>
*/
- Class<? extends BeanFactory> beanFactory() default BeanFactory.Null.class;
+ Class<? extends BeanStore> beanStore() default BeanStore.Null.class;
/**
* REST children.
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestAnnotation.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestAnnotation.java
index 2405c97..10a59fc 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestAnnotation.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestAnnotation.java
@@ -93,7 +93,7 @@ public class RestAnnotation {
Class<? extends RestGuard>[] guards = new Class[0];
Class<? extends SwaggerProvider> swaggerProvider = SwaggerProvider.Null.class;
Class<? extends RestOperationArg>[] restOperationArgs = new Class[0];
- Class<? extends BeanFactory> beanFactory = BeanFactory.Null.class;
+ Class<? extends BeanStore> beanStore = BeanStore.Null.class;
Class<? extends RestOperationContext> restOperationContextClass = RestOperationContext.Null.class;
Class<? extends RestChildren> restChildrenClass = RestChildren.Null.class;
Class<? extends RestOperations> restOperationsClass = RestOperations.Null.class;
@@ -164,13 +164,13 @@ public class RestAnnotation {
}
/**
- * Sets the {@link Rest#beanFactory()} property on this annotation.
+ * Sets the {@link Rest#beanStore()} property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public Builder beanFactory(Class<? extends BeanFactory> value) {
- this.beanFactory = value;
+ public Builder beanStore(Class<? extends BeanStore> value) {
+ this.beanStore = value;
return this;
}
@@ -706,7 +706,7 @@ public class RestAnnotation {
private final Class<? extends RestGuard>[] guards;
private final Class<? extends SwaggerProvider> swaggerProvider;
private final Class<? extends RestOperationArg>[] restOperationArgs;
- private final Class<? extends BeanFactory> beanFactory;
+ private final Class<? extends BeanStore> beanStore;
private final Class<? extends RestOperationContext> restOperationContextClass;
private final Class<? extends RestChildren> restChildrenClass;
private final Class<? extends RestOperations> restOperationsClass;
@@ -722,7 +722,7 @@ public class RestAnnotation {
this.allowedHeaderParams = b.allowedHeaderParams;
this.allowedMethodHeaders = b.allowedMethodHeaders;
this.allowedMethodParams = b.allowedMethodParams;
- this.beanFactory = b.beanFactory;
+ this.beanStore = b.beanStore;
this.callLogger = b.callLogger;
this.children = copyOf(b.children);
this.clientVersionHeader = b.clientVersionHeader;
@@ -792,8 +792,8 @@ public class RestAnnotation {
}
@Override /* Rest */
- public Class<? extends BeanFactory> beanFactory() {
- return beanFactory;
+ public Class<? extends BeanStore> beanStore() {
+ return beanStore;
}
@Override /* Rest */
@@ -1069,7 +1069,7 @@ public class RestAnnotation {
cpb.setIf(a.staticFiles() != StaticFiles.Null.class, REST_staticFiles, a.staticFiles());
cpb.setIfNotEmpty(REST_path, trimLeadingSlash(string(a.path())));
cpb.setIfNotEmpty(REST_clientVersionHeader, string(a.clientVersionHeader()));
- cpb.setIf(a.beanFactory() != BeanFactory.Null.class, REST_beanFactory, a.beanFactory());
+ cpb.setIf(a.beanStore() != BeanStore.Null.class, REST_beanStore, a.beanStore());
cpb.setIf(a.callLogger() != RestLogger.Null.class, REST_callLogger, a.callLogger());
cpb.setIf(a.swaggerProvider() != SwaggerProvider.Null.class, REST_swaggerProvider, a.swaggerProvider());
cpb.setIf(a.restOperationContextClass() != RestOperationContext.Null.class, REST_restOperationContextClass, a.restOperationContextClass());
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/DefaultArg.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/DefaultArg.java
index b5beffc..9815af8 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/DefaultArg.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/args/DefaultArg.java
@@ -18,11 +18,11 @@ import org.apache.juneau.rest.*;
import org.apache.juneau.rest.annotation.*;
/**
- * Resolves method parameters on {@link RestOp}-annotated Java methods by retrieving them by type from the REST object bean factory.
+ * Resolves method parameters on {@link RestOp}-annotated Java methods by retrieving them by type from the REST object bean store.
*
* <p>
- * The parameter value is resolved using <c><jv>call</jv>.{@link RestCall#getBeanFactory() getBeanFactory}().{@link BeanFactory#getBean(Class) getBean}(<jv>type</jv>)</c>
- * which resolves the object from the registered bean factory (e.g. Spring-injected beans available in the application).
+ * The parameter value is resolved using <c><jv>call</jv>.{@link RestCall#getBeanStore() getBeanStore}().{@link BeanStore#getBean(Class) getBean}(<jv>type</jv>)</c>
+ * which resolves the object from the registered bean store (e.g. Spring-injected beans available in the application).
*
* <p>
* This is the default parameter resolver if no other applicable parameter resolvers could be found.
@@ -54,6 +54,6 @@ public class DefaultArg implements RestOperationArg {
@Override /* RestOperationArg */
public Object resolve(RestCall call) throws Exception {
- return call.getBeanFactory().getBean(type).orElseThrow(()->new ArgException(paramInfo, "Could not resolve bean type {0}", type.getName()));
+ return call.getBeanStore().getBean(type).orElseThrow(()->new ArgException(paramInfo, "Could not resolve bean type {0}", type.getName()));
}
}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/logging/RestLoggerBuilder.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/logging/RestLoggerBuilder.java
index a384404..6e8d8a8 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/logging/RestLoggerBuilder.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/logging/RestLoggerBuilder.java
@@ -40,7 +40,7 @@ public class RestLoggerBuilder {
Predicate<HttpServletRequest> enabledTest;
RestLoggingDetail requestDetail, responseDetail;
Level level;
- BeanFactory beanFactory;
+ BeanStore beanStore;
Class<? extends RestLogger> implClass;
/**
@@ -55,7 +55,7 @@ public class RestLoggerBuilder {
public RestLogger build() {
try {
Class<? extends RestLogger> ic = isConcrete(implClass) ? implClass : getDefaultImplClass();
- return BeanFactory.of(beanFactory).addBeans(RestLoggerBuilder.class, this).createBean(ic);
+ return BeanStore.of(beanStore).addBeans(RestLoggerBuilder.class, this).createBean(ic);
} catch (Exception e) {
throw toHttpException(e, InternalServerError.class);
}
@@ -71,13 +71,13 @@ public class RestLoggerBuilder {
}
/**
- * Specifies the bean factory to use for instantiating the {@link RestLogger} object.
+ * Specifies the bean store to use for instantiating the {@link RestLogger} object.
*
* @param value The new value for this setting.
* @return This object (for method chaining).
*/
- public RestLoggerBuilder beanFactory(BeanFactory value) {
- this.beanFactory = value;
+ public RestLoggerBuilder beanStore(BeanStore value) {
+ this.beanStore = value;
return this;
}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/FileVar.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/FileVar.java
index 2f0c4d6..9418f38 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/FileVar.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/FileVar.java
@@ -49,7 +49,7 @@ import org.apache.juneau.svl.*;
* This allows you to place license headers in files without them being serialized to the output.
*
* <p>
- * This variable resolver requires that a {@link RestRequest} bean be available in the session bean factory.
+ * This variable resolver requires that a {@link RestRequest} bean be available in the session bean store.
*
* <ul class='seealso'>
* <li class='link'>{@doc SvlVariables}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/LocalizationVar.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/LocalizationVar.java
index 8341477..c620d8f 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/LocalizationVar.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/LocalizationVar.java
@@ -26,7 +26,7 @@ import org.apache.juneau.svl.*;
* The format for this var is <js>"$L{key[,args...]}"</js>.
*
* <p>
- * This variable resolver requires that a {@link RestRequest} bean be available in the session bean factory.
+ * This variable resolver requires that a {@link RestRequest} bean be available in the session bean store.
*
* <p>
* Values are pulled from the {@link RestRequest#getMessage(String,Object[])} method.
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestAttributeVar.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestAttributeVar.java
index 923eb65..e1bd6b7 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestAttributeVar.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestAttributeVar.java
@@ -36,7 +36,7 @@ import org.apache.juneau.svl.*;
*
* <ul class='notes'>
* <li>
- * This variable resolver requires that a {@link RestRequest} bean be available in the session bean factory.
+ * This variable resolver requires that a {@link RestRequest} bean be available in the session bean store.
* <li>
* For security reasons, nested and recursive variables are not resolved.
* </ul>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestFormDataVar.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestFormDataVar.java
index 3a3f702..e9175ca 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestFormDataVar.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestFormDataVar.java
@@ -35,7 +35,7 @@ import org.apache.juneau.svl.*;
*
* <ul class='notes'>
* <li>
- * This variable resolver requires that a {@link RestRequest} bean be available in the session bean factory.
+ * This variable resolver requires that a {@link RestRequest} bean be available in the session bean store.
* <li>
* For security reasons, nested and recursive variables are not resolved.
* </ul>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestHeaderVar.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestHeaderVar.java
index 0a34d85..b048322 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestHeaderVar.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestHeaderVar.java
@@ -34,7 +34,7 @@ import org.apache.juneau.svl.*;
*
* <ul class='notes'>
* <li>
- * This variable resolver requires that a {@link RestRequest} bean be available in the session bean factory.
+ * This variable resolver requires that a {@link RestRequest} bean be available in the session bean store.
* <li>
* For security reasons, nested and recursive variables are not resolved.
* </ul>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestPathVar.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestPathVar.java
index ff2b4f2..42a4604 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestPathVar.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestPathVar.java
@@ -35,7 +35,7 @@ import org.apache.juneau.svl.*;
*
* <ul class='notes'>
* <li>
- * This variable resolver requires that a {@link RestRequest} bean be available in the session bean factory.
+ * This variable resolver requires that a {@link RestRequest} bean be available in the session bean store.
* <li>
* For security reasons, nested and recursive variables are not resolved.
* </ul>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestQueryVar.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestQueryVar.java
index 5276971..2a18f01 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestQueryVar.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestQueryVar.java
@@ -35,7 +35,7 @@ import org.apache.juneau.svl.*;
*
* <ul class='notes'>
* <li>
- * This variable resolver requires that a {@link RestRequest} bean be available in the session bean factory.
+ * This variable resolver requires that a {@link RestRequest} bean be available in the session bean store.
* <li>
* For security reasons, nested and recursive variables are not resolved.
* </ul>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestSwaggerVar.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestSwaggerVar.java
index bcb6a44..7ed5388 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestSwaggerVar.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestSwaggerVar.java
@@ -58,7 +58,7 @@ import org.apache.juneau.svl.*;
*
* <ul class='notes'>
* <li>
- * This variable resolver requires that a {@link RestRequest} bean be available in the session bean factory.
+ * This variable resolver requires that a {@link RestRequest} bean be available in the session bean store.
* <li>
* For security reasons, nested and recursive variables are not resolved.
* </ul>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestVar.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestVar.java
index 5bf8339..df056c2 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestVar.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/RequestVar.java
@@ -47,7 +47,7 @@ import org.apache.juneau.svl.*;
*
* <ul class='notes'>
* <li>
- * This variable resolver requires that a {@link RestRequest} bean be available in the session bean factory.
+ * This variable resolver requires that a {@link RestRequest} bean be available in the session bean store.
* <li>
* For security reasons, nested and recursive variables are not resolved.
* </ul>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/SerializedRequestAttrVar.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/SerializedRequestAttrVar.java
index 1227311..db4275b 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/SerializedRequestAttrVar.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/SerializedRequestAttrVar.java
@@ -28,7 +28,7 @@ import org.apache.juneau.svl.*;
* The format for this var is <js>"$SA{contentType,key[,defaultValue]}"</js>.
*
* <p>
- * This variable resolver requires that a {@link RestRequest} bean be available in the session bean factory.
+ * This variable resolver requires that a {@link RestRequest} bean be available in the session bean store.
*
* <p>
* Since this is a {@link SimpleVar}, any variables contained in the result will be recursively resolved.
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/ServletInitParamVar.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/ServletInitParamVar.java
index 93ad803..22c783c 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/ServletInitParamVar.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/ServletInitParamVar.java
@@ -23,7 +23,7 @@ import org.apache.juneau.svl.*;
* The format for this var is <js>"$I{key[,defaultValue]}"</js>.
*
* <p>
- * This variable resolver requires that a {@link RestRequest} bean be available in the session bean factory.
+ * This variable resolver requires that a {@link RestRequest} bean be available in the session bean store.
*
* <p>
* Values are pulled from the {@link RestServlet#getInitParameter(String)} method.
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/SwaggerVar.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/SwaggerVar.java
index 4740cde..3e9e13e 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/SwaggerVar.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/SwaggerVar.java
@@ -34,7 +34,7 @@ import org.apache.juneau.utils.*;
*
* <ul class='notes'>
* <li>
- * This variable resolver requires that a {@link RestRequest} bean be available in the session bean factory.
+ * This variable resolver requires that a {@link RestRequest} bean be available in the session bean store.
* <li>
* For security reasons, nested and recursive variables are not resolved.
* </ul>
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/UrlVar.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/UrlVar.java
index 7d38be1..2129bc1 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/UrlVar.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/UrlVar.java
@@ -31,7 +31,7 @@ import org.apache.juneau.svl.*;
* See {@link UriResolver} for the kinds of URIs that can be resolved.
*
* <p>
- * This variable resolver requires that a {@link RestRequest} bean be available in the session bean factory.
+ * This variable resolver requires that a {@link RestRequest} bean be available in the session bean store.
*
* <p>
* Uses the URI resolver returned by {@link RestRequest#getUriResolver()}.
diff --git a/juneau-utest/src/test/java/org/apache/juneau/cp/BeanFactory_Test.java b/juneau-utest/src/test/java/org/apache/juneau/cp/BeanFactory_Test.java
index 663c08a..748d762 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/cp/BeanFactory_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/cp/BeanFactory_Test.java
@@ -33,15 +33,15 @@ public class BeanFactory_Test {
@Test
public void a01_addBean() {
- BeanFactory bf = new BeanFactory();
- assertBoolean(bf.hasBean(A.class)).isFalse();
- assertObject(bf.getBean(A.class)).doesNotExist();
- bf.addBean(A.class, new A());
- assertBoolean(bf.hasBean(A.class)).isTrue();
- assertObject(bf.getBean(A.class)).exists();
- bf = BeanFactory.of(bf);
- assertBoolean(bf.hasBean(A.class)).isTrue();
- assertObject(bf.getBean(A.class)).exists();
+ BeanStore bs = new BeanStore();
+ assertBoolean(bs.hasBean(A.class)).isFalse();
+ assertObject(bs.getBean(A.class)).doesNotExist();
+ bs.addBean(A.class, new A());
+ assertBoolean(bs.hasBean(A.class)).isTrue();
+ assertObject(bs.getBean(A.class)).exists();
+ bs = BeanStore.of(bs);
+ assertBoolean(bs.hasBean(A.class)).isTrue();
+ assertObject(bs.getBean(A.class)).exists();
}
//-----------------------------------------------------------------------------------------------------------------
@@ -57,8 +57,8 @@ public class BeanFactory_Test {
@Test
public void b01_createBean_create() throws Exception {
- BeanFactory bf = new BeanFactory();
- assertObject(bf.createBean(B1.class)).isType(B1.class);
+ BeanStore bs = new BeanStore();
+ assertObject(bs.createBean(B1.class)).isType(B1.class);
}
public static class B2 {
@@ -70,8 +70,8 @@ public class BeanFactory_Test {
@Test
public void b02_createBean_getInstance() throws Exception {
- BeanFactory bf = new BeanFactory();
- assertObject(bf.createBean(B2.class)).isType(B2.class);
+ BeanStore bs = new BeanStore();
+ assertObject(bs.createBean(B2.class)).isType(B2.class);
}
public static class B3a {
@@ -83,8 +83,8 @@ public class BeanFactory_Test {
@Test
public void b03a_createBean_create_notVisible() throws Exception {
- BeanFactory bf = new BeanFactory();
- assertThrown(()->bf.createBean(B3a.class)).is("Could not instantiate class "+CNAME+"$B3a: Public constructor or creator not found.");
+ BeanStore bs = new BeanStore();
+ assertThrown(()->bs.createBean(B3a.class)).is("Could not instantiate class "+CNAME+"$B3a: Public constructor or creator not found.");
}
public static class B3b {
@@ -96,8 +96,8 @@ public class BeanFactory_Test {
@Test
public void b03b_createBean_create_wrongName() throws Exception {
- BeanFactory bf = new BeanFactory();
- assertThrown(()->bf.createBean(B3b.class)).is("Could not instantiate class "+CNAME+"$B3b: Public constructor or creator not found.");
+ BeanStore bs = new BeanStore();
+ assertThrown(()->bs.createBean(B3b.class)).is("Could not instantiate class "+CNAME+"$B3b: Public constructor or creator not found.");
}
public static class B3c {
@@ -109,8 +109,8 @@ public class BeanFactory_Test {
@Test
public void b03c_createBean_create_wrongReturnType() throws Exception {
- BeanFactory bf = new BeanFactory();
- assertThrown(()->bf.createBean(B3c.class)).is("Could not instantiate class "+CNAME+"$B3c: Public constructor or creator not found.");
+ BeanStore bs = new BeanStore();
+ assertThrown(()->bs.createBean(B3c.class)).is("Could not instantiate class "+CNAME+"$B3c: Public constructor or creator not found.");
}
public static class B3d {
@@ -123,8 +123,8 @@ public class BeanFactory_Test {
@Test
public void b03d_createBean_create_deprecated() throws Exception {
- BeanFactory bf = new BeanFactory();
- assertThrown(()->bf.createBean(B3d.class)).is("Could not instantiate class "+CNAME+"$B3d: Public constructor or creator not found.");
+ BeanStore bs = new BeanStore();
+ assertThrown(()->bs.createBean(B3d.class)).is("Could not instantiate class "+CNAME+"$B3d: Public constructor or creator not found.");
}
public static class B3e {
@@ -137,8 +137,8 @@ public class BeanFactory_Test {
@Test
public void b03e_createBean_create_beanIgnore() throws Exception {
- BeanFactory bf = new BeanFactory();
- assertThrown(()->bf.createBean(B3e.class)).is("Could not instantiate class "+CNAME+"$B3e: Public constructor or creator not found.");
+ BeanStore bs = new BeanStore();
+ assertThrown(()->bs.createBean(B3e.class)).is("Could not instantiate class "+CNAME+"$B3e: Public constructor or creator not found.");
}
public abstract static class B4a {
@@ -150,8 +150,8 @@ public class BeanFactory_Test {
@Test
public void b04a_createBean_create_abstract() throws Exception {
- BeanFactory bf = new BeanFactory();
- assertObject(bf.createBean(B4a.class)).exists();
+ BeanStore bs = new BeanStore();
+ assertObject(bs.createBean(B4a.class)).exists();
}
public static interface B4b {
@@ -162,8 +162,8 @@ public class BeanFactory_Test {
@Test
public void b04b_createBean_create_interface() throws Exception {
- BeanFactory bf = new BeanFactory();
- assertObject(bf.createBean(B4b.class)).exists();
+ BeanStore bs = new BeanStore();
+ assertObject(bs.createBean(B4b.class)).exists();
}
//-----------------------------------------------------------------------------------------------------------------
@@ -182,11 +182,11 @@ public class BeanFactory_Test {
@Test
public void c01_createBean_create_withArgs() throws Exception {
- BeanFactory bf = new BeanFactory();
- assertThrown(()->bf.createBean(C1a.class)).stderr().is("Could not instantiate class "+CNAME+"$C1a: Static creator found but could not find prerequisites: A.");
- bf.addBean(A.class, new A());
- assertObject(bf.createBean(C1a.class)).exists();
- assertObject(bf.createBean(C1a.class)).exists();
+ BeanStore bs = new BeanStore();
+ assertThrown(()->bs.createBean(C1a.class)).stderr().is("Could not instantiate class "+CNAME+"$C1a: Static creator found but could not find prerequisites: A.");
+ bs.addBean(A.class, new A());
+ assertObject(bs.createBean(C1a.class)).exists();
+ assertObject(bs.createBean(C1a.class)).exists();
}
public interface C2a {
@@ -197,11 +197,11 @@ public class BeanFactory_Test {
@Test
public void c02a_createBean_create_withArgs_interface() throws Exception {
- BeanFactory bf = new BeanFactory();
- assertThrown(()->bf.createBean(C2a.class)).stderr().is("Could not instantiate class "+CNAME+"$C2a: Static creator found but could not find prerequisites: A.");
- bf.addBean(A.class, new A());
- assertObject(bf.createBean(C2a.class)).exists();
- assertObject(bf.createBean(C2a.class)).exists();
+ BeanStore bs = new BeanStore();
+ assertThrown(()->bs.createBean(C2a.class)).stderr().is("Could not instantiate class "+CNAME+"$C2a: Static creator found but could not find prerequisites: A.");
+ bs.addBean(A.class, new A());
+ assertObject(bs.createBean(C2a.class)).exists();
+ assertObject(bs.createBean(C2a.class)).exists();
}
public static abstract class C2b {
@@ -212,31 +212,31 @@ public class BeanFactory_Test {
@Test
public void c02b_createBean_create_withArgs_abstractClass() throws Exception {
- BeanFactory bf = new BeanFactory();
- assertThrown(()->bf.createBean(C2b.class)).stderr().is("Could not instantiate class "+CNAME+"$C2b: Static creator found but could not find prerequisites: A.");
- bf.addBean(A.class, new A());
- assertObject(bf.createBean(C2b.class)).exists();
- assertObject(bf.createBean(C2b.class)).exists();
+ BeanStore bs = new BeanStore();
+ assertThrown(()->bs.createBean(C2b.class)).stderr().is("Could not instantiate class "+CNAME+"$C2b: Static creator found but could not find prerequisites: A.");
+ bs.addBean(A.class, new A());
+ assertObject(bs.createBean(C2b.class)).exists();
+ assertObject(bs.createBean(C2b.class)).exists();
}
public static interface C2c {}
@Test
public void c02c_createBean_create_withArgs_interface() throws Exception {
- BeanFactory bf = new BeanFactory();
- assertThrown(()->bf.createBean(C2c.class)).stderr().is("Could not instantiate class "+CNAME+"$C2c: Class is an interface.");
- bf.addBean(A.class, new A());
- assertThrown(()->bf.createBean(C2c.class)).stderr().is("Could not instantiate class "+CNAME+"$C2c: Class is an interface.");
+ BeanStore bs = new BeanStore();
+ assertThrown(()->bs.createBean(C2c.class)).stderr().is("Could not instantiate class "+CNAME+"$C2c: Class is an interface.");
+ bs.addBean(A.class, new A());
+ assertThrown(()->bs.createBean(C2c.class)).stderr().is("Could not instantiate class "+CNAME+"$C2c: Class is an interface.");
}
public static abstract class C2d {}
@Test
public void c02d_createBean_create_withArgs_abstractClass() throws Exception {
- BeanFactory bf = new BeanFactory();
- assertThrown(()->bf.createBean(C2d.class)).stderr().is("Could not instantiate class "+CNAME+"$C2d: Class is abstract.");
- bf.addBean(A.class, new A());
- assertThrown(()->bf.createBean(C2d.class)).stderr().is("Could not instantiate class "+CNAME+"$C2d: Class is abstract.");
+ BeanStore bs = new BeanStore();
+ assertThrown(()->bs.createBean(C2d.class)).stderr().is("Could not instantiate class "+CNAME+"$C2d: Class is abstract.");
+ bs.addBean(A.class, new A());
+ assertThrown(()->bs.createBean(C2d.class)).stderr().is("Could not instantiate class "+CNAME+"$C2d: Class is abstract.");
}
//-----------------------------------------------------------------------------------------------------------------
@@ -252,11 +252,11 @@ public class BeanFactory_Test {
@Test
public void d01a_createBean_construct_withArgs() throws Exception {
- BeanFactory bf = new BeanFactory();
- assertThrown(()->bf.createBean(D1a.class)).stderr().is("Could not instantiate class "+CNAME+"$D1a: Public constructor found but could not find prerequisites: A.");
- bf.addBean(A.class, new A());
- assertObject(bf.createBean(D1a.class)).exists();
- assertObject(bf.createBean(D1a.class)).exists();
+ BeanStore bs = new BeanStore();
+ assertThrown(()->bs.createBean(D1a.class)).stderr().is("Could not instantiate class "+CNAME+"$D1a: Public constructor found but could not find prerequisites: A.");
+ bs.addBean(A.class, new A());
+ assertObject(bs.createBean(D1a.class)).exists();
+ assertObject(bs.createBean(D1a.class)).exists();
}
public class D1b {
@@ -268,13 +268,13 @@ public class BeanFactory_Test {
@Test
public void d01b_createBean_construct_withArgs_inner() throws Exception {
- BeanFactory bf = new BeanFactory();
- assertThrown(()->bf.createBean(D1b.class)).stderr().is("Could not instantiate class "+CNAME+"$D1b: Public constructor found but could not find prerequisites: BeanFactory_Test,A.");
- BeanFactory bf2 = BeanFactory.of(null,this);
- assertThrown(()->bf2.createBean(D1b.class)).stderr().is("Could not instantiate class "+CNAME+"$D1b: Public constructor found but could not find prerequisites: A.");
- bf2.addBean(A.class, new A());
- assertObject(bf2.createBean(D1b.class)).exists();
- assertObject(bf2.createBean(D1b.class)).exists();
+ BeanStore bs = new BeanStore();
+ assertThrown(()->bs.createBean(D1b.class)).stderr().is("Could not instantiate class "+CNAME+"$D1b: Public constructor found but could not find prerequisites: BeanFactory_Test,A.");
+ BeanStore bs2 = BeanStore.of(null,this);
+ assertThrown(()->bs2.createBean(D1b.class)).stderr().is("Could not instantiate class "+CNAME+"$D1b: Public constructor found but could not find prerequisites: A.");
+ bs2.addBean(A.class, new A());
+ assertObject(bs2.createBean(D1b.class)).exists();
+ assertObject(bs2.createBean(D1b.class)).exists();
}
//-----------------------------------------------------------------------------------------------------------------
@@ -352,64 +352,64 @@ public class BeanFactory_Test {
@Test
public void e01_beanCreateMethodFinder() throws Exception {
- BeanFactory bf = BeanFactory.create().build();
+ BeanStore bs = BeanStore.create().build();
E1 x = new E1();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createA0").run()).doesNotExist();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createA1").run()).exists();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createA2").run()).doesNotExist();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createA3").run()).doesNotExist();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createA4").run()).doesNotExist();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createA5").run()).doesNotExist();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createA6").run()).doesNotExist();
- assertThrown(()->bf.beanCreateMethodFinder(E.class, x).find("createA7").run()).contains("foo");
-
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createB0").run()).doesNotExist();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createB1").run()).exists();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createB2").run()).doesNotExist();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createB3").run()).doesNotExist();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createB4").run()).doesNotExist();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createB5").run()).doesNotExist();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createB6").run()).doesNotExist();
- assertThrown(()->bf.beanCreateMethodFinder(E.class, x).find("createB7").run()).contains("foo");
-
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC1").run()).doesNotExist();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC2").run()).doesNotExist();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC3").run()).exists();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC3").run().a).doesNotExist();
- bf.addBean(A.class, new A());
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC1").run()).exists();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC2").run()).exists();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC3").run()).exists();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC3").run().a).exists();
- bf.addBean(A.class, null);
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC1").run()).doesNotExist();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC2").run()).doesNotExist();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC3").run()).exists();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC3").run().a).doesNotExist();
- bf.addBeanSupplier(A.class, ()->new A());
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC1").run()).exists();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC2").run()).exists();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC3").run()).exists();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC3").run().a).exists();
- bf.addBeanSupplier(A.class, null);
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC1").run()).doesNotExist();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC2").run()).doesNotExist();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC3").run()).exists();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createC3").run().a).doesNotExist();
-
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createAx").thenFind("createA1").run()).exists();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createA1").thenFind("createAx").run()).exists();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createA1", A.class).thenFind("createA2", A.class).run()).doesNotExist();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createA1", A.class).thenFind("createA1").run()).exists();
- assertObject(bf.beanCreateMethodFinder(E.class, x).find("createA1", A.class).withDefault(new E()).run()).exists();
-
- bf.addBeanSupplier(A.class, ()->new A());
- assertObject(bf.createBean(A.class)).exists();
-
- BeanFactory bf2 = BeanFactory.of(bf, null);
- assertObject(bf2.beanCreateMethodFinder(E.class, x).find("createA1").run()).exists();
-
- assertString(bf2.toString()).is("{parent:{beanMap:['A']}}");
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createA0").run()).doesNotExist();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createA1").run()).exists();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createA2").run()).doesNotExist();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createA3").run()).doesNotExist();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createA4").run()).doesNotExist();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createA5").run()).doesNotExist();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createA6").run()).doesNotExist();
+ assertThrown(()->bs.beanCreateMethodFinder(E.class, x).find("createA7").run()).contains("foo");
+
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createB0").run()).doesNotExist();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createB1").run()).exists();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createB2").run()).doesNotExist();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createB3").run()).doesNotExist();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createB4").run()).doesNotExist();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createB5").run()).doesNotExist();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createB6").run()).doesNotExist();
+ assertThrown(()->bs.beanCreateMethodFinder(E.class, x).find("createB7").run()).contains("foo");
+
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC1").run()).doesNotExist();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC2").run()).doesNotExist();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC3").run()).exists();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC3").run().a).doesNotExist();
+ bs.addBean(A.class, new A());
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC1").run()).exists();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC2").run()).exists();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC3").run()).exists();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC3").run().a).exists();
+ bs.addBean(A.class, null);
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC1").run()).doesNotExist();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC2").run()).doesNotExist();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC3").run()).exists();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC3").run().a).doesNotExist();
+ bs.addBeanSupplier(A.class, ()->new A());
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC1").run()).exists();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC2").run()).exists();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC3").run()).exists();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC3").run().a).exists();
+ bs.addBeanSupplier(A.class, null);
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC1").run()).doesNotExist();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC2").run()).doesNotExist();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC3").run()).exists();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createC3").run().a).doesNotExist();
+
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createAx").thenFind("createA1").run()).exists();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createA1").thenFind("createAx").run()).exists();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createA1", A.class).thenFind("createA2", A.class).run()).doesNotExist();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createA1", A.class).thenFind("createA1").run()).exists();
+ assertObject(bs.beanCreateMethodFinder(E.class, x).find("createA1", A.class).withDefault(new E()).run()).exists();
+
+ bs.addBeanSupplier(A.class, ()->new A());
+ assertObject(bs.createBean(A.class)).exists();
+
+ BeanStore bs2 = BeanStore.of(bs, null);
+ assertObject(bs2.beanCreateMethodFinder(E.class, x).find("createA1").run()).exists();
+
+ assertString(bs2.toString()).is("{parent:{beanMap:['A']}}");
}
}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/mstat/MethodExecStore_Test.java b/juneau-utest/src/test/java/org/apache/juneau/mstat/MethodExecStore_Test.java
index 1e41ab8..29ff1e9 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/mstat/MethodExecStore_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/mstat/MethodExecStore_Test.java
@@ -80,14 +80,14 @@ public class MethodExecStore_Test {
@Test
public void a05_builder_beanFactory() throws Exception {
- BeanFactory bf = BeanFactory.create().build();
+ BeanStore bs = BeanStore.create().build();
- assertThrown(()->MethodExecStore.create().beanFactory(bf).implClass(A5b.class).build()).contains("Public constructor found but could not find prerequisites: A5a");
- assertObject(MethodExecStore.create().beanFactory(bf).implClass(A5c.class).build()).isType(A5c.class);
+ assertThrown(()->MethodExecStore.create().beanStore(bs).implClass(A5b.class).build()).contains("Public constructor found but could not find prerequisites: A5a");
+ assertObject(MethodExecStore.create().beanStore(bs).implClass(A5c.class).build()).isType(A5c.class);
- bf.addBean(A5a.class, new A5a());
- assertObject(MethodExecStore.create().beanFactory(bf).implClass(A5b.class).build()).isType(A5b.class);
- assertObject(MethodExecStore.create().beanFactory(bf).implClass(A5c.class).build()).isType(A5c.class);
+ bs.addBean(A5a.class, new A5a());
+ assertObject(MethodExecStore.create().beanStore(bs).implClass(A5b.class).build()).isType(A5b.class);
+ assertObject(MethodExecStore.create().beanStore(bs).implClass(A5c.class).build()).isType(A5c.class);
}
@@ -111,15 +111,15 @@ public class MethodExecStore_Test {
@Test
public void a06_builder_statsImplClass() throws Exception {
- BeanFactory bf = BeanFactory.create().build();
+ BeanStore bs = BeanStore.create().build();
Method m = MethodExecStore_Test.class.getMethod("a06_builder_statsImplClass");
- assertThrown(()->MethodExecStore.create().beanFactory(bf).statsImplClass(A6b.class).build().getStats(m)).contains("Public constructor found but could not find prerequisites: A6a");
- assertObject(MethodExecStore.create().beanFactory(bf).statsImplClass(A6c.class).build().getStats(m)).isType(A6c.class);
+ assertThrown(()->MethodExecStore.create().beanStore(bs).statsImplClass(A6b.class).build().getStats(m)).contains("Public constructor found but could not find prerequisites: A6a");
+ assertObject(MethodExecStore.create().beanStore(bs).statsImplClass(A6c.class).build().getStats(m)).isType(A6c.class);
- bf.addBean(A6a.class, new A6a());
- assertObject(MethodExecStore.create().statsImplClass(A6b.class).beanFactory(bf).build().getStats(m)).isType(A6b.class);
- assertObject(MethodExecStore.create().statsImplClass(A6c.class).beanFactory(bf).build().getStats(m)).isType(A6c.class);
+ bs.addBean(A6a.class, new A6a());
+ assertObject(MethodExecStore.create().statsImplClass(A6b.class).beanStore(bs).build().getStats(m)).isType(A6b.class);
+ assertObject(MethodExecStore.create().statsImplClass(A6c.class).beanStore(bs).build().getStats(m)).isType(A6c.class);
}
@Test
@@ -133,8 +133,8 @@ public class MethodExecStore_Test {
assertObject(store.getThrownStore()).isSameObjectAs(s);
ThrownStore s2 = ThrownStore.create().build();
- BeanFactory bf = BeanFactory.create().build().addBean(ThrownStore.class, s2);
- store = MethodExecStore.create().beanFactory(bf).build();
+ BeanStore bs = BeanStore.create().build().addBean(ThrownStore.class, s2);
+ store = MethodExecStore.create().beanStore(bs).build();
assertObject(store.getThrownStore()).isSameObjectAs(s2);
}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/mstat/ThrownStore_Test.java b/juneau-utest/src/test/java/org/apache/juneau/mstat/ThrownStore_Test.java
index 495eabd..4bb67e7 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/mstat/ThrownStore_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/mstat/ThrownStore_Test.java
@@ -237,14 +237,14 @@ public class ThrownStore_Test {
@Test
public void b05_builder_beanFactory() throws Exception {
- BeanFactory bf = BeanFactory.create().build();
+ BeanStore bs = BeanStore.create().build();
- assertThrown(()->ThrownStore.create().beanFactory(bf).implClass(B5b.class).build()).contains("Public constructor found but could not find prerequisites: B5a");
- assertObject(ThrownStore.create().beanFactory(bf).implClass(B5c.class).build()).isType(B5c.class);
+ assertThrown(()->ThrownStore.create().beanStore(bs).implClass(B5b.class).build()).contains("Public constructor found but could not find prerequisites: B5a");
+ assertObject(ThrownStore.create().beanStore(bs).implClass(B5c.class).build()).isType(B5c.class);
- bf.addBean(B5a.class, new B5a());
- assertObject(ThrownStore.create().beanFactory(bf).implClass(B5b.class).build()).isType(B5b.class);
- assertObject(ThrownStore.create().beanFactory(bf).implClass(B5c.class).build()).isType(B5c.class);
+ bs.addBean(B5a.class, new B5a());
+ assertObject(ThrownStore.create().beanStore(bs).implClass(B5b.class).build()).isType(B5b.class);
+ assertObject(ThrownStore.create().beanStore(bs).implClass(B5c.class).build()).isType(B5c.class);
}
public static class B6a {}
@@ -267,17 +267,17 @@ public class ThrownStore_Test {
@Test
public void b06_statsImplClass() throws Exception {
- BeanFactory bf = BeanFactory.create().build();
+ BeanStore bs = BeanStore.create().build();
Throwable t1 = new Throwable();
t1.fillInStackTrace();
- assertThrown(()->ThrownStore.create().beanFactory(bf).statsImplClass(B6b.class).build().add(t1)).contains("Public constructor found but could not find prerequisites: B6a");
- assertObject(ThrownStore.create().beanFactory(bf).statsImplClass(B6c.class).build().add(t1)).isType(B6c.class);
+ assertThrown(()->ThrownStore.create().beanStore(bs).statsImplClass(B6b.class).build().add(t1)).contains("Public constructor found but could not find prerequisites: B6a");
+ assertObject(ThrownStore.create().beanStore(bs).statsImplClass(B6c.class).build().add(t1)).isType(B6c.class);
- bf.addBean(B6a.class, new B6a());
- assertObject(ThrownStore.create().statsImplClass(B6b.class).beanFactory(bf).build().add(t1)).isType(B6b.class);
- assertObject(ThrownStore.create().statsImplClass(B6c.class).beanFactory(bf).build().add(t1)).isType(B6c.class);
+ bs.addBean(B6a.class, new B6a());
+ assertObject(ThrownStore.create().statsImplClass(B6b.class).beanStore(bs).build().add(t1)).isType(B6b.class);
+ assertObject(ThrownStore.create().statsImplClass(B6c.class).beanStore(bs).build().add(t1)).isType(B6c.class);
}
//------------------------------------------------------------------------------------------------------------------
diff --git a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestAnnotation_Test.java b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestAnnotation_Test.java
index 848bf19..59150e4 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestAnnotation_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/rest/annotation/RestAnnotation_Test.java
@@ -41,7 +41,7 @@ public class RestAnnotation_Test {
.allowedHeaderParams("allowedHeaderParams")
.allowedMethodHeaders("allowedMethodHeaders")
.allowedMethodParams("allowedMethodParams")
- .beanFactory(BeanFactory.class)
+ .beanStore(BeanStore.class)
.callLogger(BasicRestLogger.class)
.children(RestAnnotation_Test.class)
.clientVersionHeader("clientVersionHeader")
@@ -96,7 +96,7 @@ public class RestAnnotation_Test {
.allowedHeaderParams("allowedHeaderParams")
.allowedMethodHeaders("allowedMethodHeaders")
.allowedMethodParams("allowedMethodParams")
- .beanFactory(BeanFactory.class)
+ .beanStore(BeanStore.class)
.callLogger(BasicRestLogger.class)
.children(RestAnnotation_Test.class)
.clientVersionHeader("clientVersionHeader")
@@ -153,7 +153,7 @@ public class RestAnnotation_Test {
+ "allowedHeaderParams:'allowedHeaderParams',"
+ "allowedMethodHeaders:'allowedMethodHeaders',"
+ "allowedMethodParams:'allowedMethodParams',"
- + "beanFactory:'org.apache.juneau.cp.BeanFactory',"
+ + "beanStore:'org.apache.juneau.cp.BeanStore',"
+ "callLogger:'org.apache.juneau.rest.logging.BasicRestLogger',"
+ "children:['"+CNAME+"'],"
+ "clientVersionHeader:'clientVersionHeader',"
@@ -254,7 +254,7 @@ public class RestAnnotation_Test {
allowedHeaderParams="allowedHeaderParams",
allowedMethodHeaders="allowedMethodHeaders",
allowedMethodParams="allowedMethodParams",
- beanFactory=BeanFactory.class,
+ beanStore=BeanStore.class,
callLogger=BasicRestLogger.class,
children=RestAnnotation_Test.class,
clientVersionHeader="clientVersionHeader",
@@ -311,7 +311,7 @@ public class RestAnnotation_Test {
allowedHeaderParams="allowedHeaderParams",
allowedMethodHeaders="allowedMethodHeaders",
allowedMethodParams="allowedMethodParams",
- beanFactory=BeanFactory.class,
+ beanStore=BeanStore.class,
callLogger=BasicRestLogger.class,
children=RestAnnotation_Test.class,
clientVersionHeader="clientVersionHeader",