You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2019/10/17 10:06:56 UTC
[isis] branch v2 updated: ISIS-2158: polishing
component-scan-interceptor
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch v2
in repository https://gitbox.apache.org/repos/asf/isis.git
The following commit(s) were added to refs/heads/v2 by this push:
new fadfaa2 ISIS-2158: polishing component-scan-interceptor
fadfaa2 is described below
commit fadfaa2b6940655dfaaef4ff49878cd20cfdd213
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu Oct 17 12:06:39 2019 +0200
ISIS-2158: polishing component-scan-interceptor
---
.../config/beans/IsisComponentScanInterceptor.java | 40 +++++++++++-----------
.../isis/config/registry/IsisBeanTypeRegistry.java | 16 ++++++++-
2 files changed, 35 insertions(+), 21 deletions(-)
diff --git a/core/config/src/main/java/org/apache/isis/config/beans/IsisComponentScanInterceptor.java b/core/config/src/main/java/org/apache/isis/config/beans/IsisComponentScanInterceptor.java
index 08cbabd..c4e24cc 100644
--- a/core/config/src/main/java/org/apache/isis/config/beans/IsisComponentScanInterceptor.java
+++ b/core/config/src/main/java/org/apache/isis/config/beans/IsisComponentScanInterceptor.java
@@ -32,11 +32,11 @@ public interface IsisComponentScanInterceptor {
/**
* Allows for the given type-meta to by modified before bean-definition registration
- * is finalized by the IoC immediately after the type-scan phase.
- * Supported aspects to be modified:
- * <p>- Whether given {@link Component} annotated or meta-annotated type should be made
+ * is finalized by the IoC, immediately after the type-scan phase.
+ * Aspects to be modified:
+ * <br>- Whether given {@link Component} annotated or meta-annotated type should be made
* available for injection.
- * <p>- Naming strategy to override that of the IoC.
+ * <br>- Naming strategy to override that of the IoC.
*
* @param type
* @apiNote implementing classes might have side effects, eg. intercept
@@ -44,21 +44,21 @@ public interface IsisComponentScanInterceptor {
*/
void intercept(TypeMetaData type);
- /**
- * If given type is available for injection, returns the <em>Managed Bean's</em> name (id) as
- * recognized by the IoC container, {@code null} otherwise;
- * @param type
- * @return
- */
- String getManagedBeanNameForType(Class<?> type);
-
- /**
- * Whether given type is available for injection. Is a <em>Managed Bean</em>.
- * @param type
- * @return
- */
- default boolean isManagedBean(Class<?> type) {
- return getManagedBeanNameForType(type)!=null;
- }
+// /**
+// * If given type is available for injection, returns the <em>Managed Bean's</em> name (id) as
+// * recognized by the IoC container, {@code null} otherwise;
+// * @param type
+// * @return
+// */
+// String getManagedBeanNameForType(Class<?> type);
+//
+// /**
+// * Whether given type is available for injection. Is a <em>Managed Bean</em>.
+// * @param type
+// * @return
+// */
+// default boolean isManagedBean(Class<?> type) {
+// return getManagedBeanNameForType(type)!=null;
+// }
}
diff --git a/core/config/src/main/java/org/apache/isis/config/registry/IsisBeanTypeRegistry.java b/core/config/src/main/java/org/apache/isis/config/registry/IsisBeanTypeRegistry.java
index ca303f0..170183c 100644
--- a/core/config/src/main/java/org/apache/isis/config/registry/IsisBeanTypeRegistry.java
+++ b/core/config/src/main/java/org/apache/isis/config/registry/IsisBeanTypeRegistry.java
@@ -190,7 +190,12 @@ public final class IsisBeanTypeRegistry implements IsisComponentScanInterceptor,
}
- @Override
+ /**
+ * If given type is available for injection, returns the <em>Managed Bean's</em> name (id) as
+ * recognized by the IoC container, {@code null} otherwise;
+ * @param type
+ * @return
+ */
public String getManagedBeanNameForType(Class<?> type) {
if(vetoedTypes.contains(type)) { // vetos are coming from the spec-loader during init
return null;
@@ -198,6 +203,15 @@ public final class IsisBeanTypeRegistry implements IsisComponentScanInterceptor,
return managedBeanNamesByType.get(type);
}
+ /**
+ * Whether given type is available for injection. Is a <em>Managed Bean</em>.
+ * @param type
+ * @return
+ */
+ public boolean isManagedBean(Class<?> type) {
+ return getManagedBeanNameForType(type)!=null;
+ }
+
// -- HELPER
// the SpecLoader does a better job at this