This is an automated email from the ASF dual-hosted git repository. danhaywood pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/isis.git
commit 2a7bb445578be407b356da64f6e1a8d1677af0cb Author: danhaywood <d...@haywood-associates.co.uk> AuthorDate: Mon Jan 13 09:41:13 2020 +0000 ISIS-2250:: introspects value types eagerly in SpecificationLoaderDefault and improves logging --- .../specloader/SpecificationLoaderDefault.java | 39 ++++++++++++++-------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoaderDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoaderDefault.java index bd0daa4..a438f28 100644 --- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoaderDefault.java +++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoaderDefault.java @@ -203,19 +203,27 @@ public class SpecificationLoaderDefault implements SpecificationLoader { val typeRegistry = isisBeanTypeRegistryHolder.getIsisBeanTypeRegistry(); - val scannedSpecs = _Lists.<ObjectSpecification>newArrayList(); - val domainServiceSpecs = _Lists.<ObjectSpecification>newArrayList(); - val domainObjectSpecs = _Lists.<ObjectSpecification>newArrayList(); + val knownSpecs = _Lists.<ObjectSpecification>newArrayList(); + + val stopWatch = _Timing.now(); + + log.info(" - adding types from ValueTypeProviders"); + + val valueTypeSpecs = _Lists.<ObjectSpecification>newArrayList(); valueTypeRegistry.classes().forEach(clazz -> { val spec = loadSpecification(clazz, IntrospectionState.NOT_INTROSPECTED); if(spec!=null) { - scannedSpecs.add(spec); + knownSpecs.add(spec); + valueTypeSpecs.add(spec); } }); log.info(" - categorizing types from class-path scan"); - + + val domainServiceSpecs = _Lists.<ObjectSpecification>newArrayList(); + val domainObjectSpecs = _Lists.<ObjectSpecification>newArrayList(); + typeRegistry.snapshotIntrospectableTypes().entrySet() .forEach(entry->{ @@ -224,7 +232,7 @@ public class SpecificationLoaderDefault implements SpecificationLoader { val spec = loadSpecification(type, IntrospectionState.NOT_INTROSPECTED); if(spec!=null) { - scannedSpecs.add(spec); + knownSpecs.add(spec); } else { typeRegistry.veto(type); } @@ -239,19 +247,24 @@ public class SpecificationLoaderDefault implements SpecificationLoader { domainObjectSpecs.add(spec); return; + case VALUE: + case COLLECTION: + // handled by ValueTypeRegistry earlier + case UNKNOWN: default: - return; + // ignore } }); - val stopWatch = _Timing.now(); - - SpecificationLoaderDefault_debug.logBefore(log, cache, scannedSpecs); + SpecificationLoaderDefault_debug.logBefore(log, cache, knownSpecs); - log.info(" - introspecting {} type hierarchies", scannedSpecs.size()); - introspect(scannedSpecs, IntrospectionState.TYPE_INTROSPECTED); + log.info(" - introspecting {} type hierarchies", knownSpecs.size()); + introspect(knownSpecs, IntrospectionState.TYPE_INTROSPECTED); + + log.info(" - introspecting {} value types", valueTypeSpecs.size()); + introspect(domainServiceSpecs, IntrospectionState.TYPE_AND_MEMBERS_INTROSPECTED); log.info(" - introspecting {} domain services", domainServiceSpecs.size()); introspect(domainServiceSpecs, IntrospectionState.TYPE_AND_MEMBERS_INTROSPECTED); @@ -261,7 +274,7 @@ public class SpecificationLoaderDefault implements SpecificationLoader { log.info(" - introspecting {} view models", typeRegistry.getViewModelTypes().size()); introspect(domainObjectSpecs, IntrospectionState.TYPE_AND_MEMBERS_INTROSPECTED); - SpecificationLoaderDefault_debug.logAfter(log, cache, scannedSpecs); + SpecificationLoaderDefault_debug.logAfter(log, cache, knownSpecs); if(isFullIntrospect()) { val snapshot = cache.snapshotSpecs();