You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2016/06/16 09:44:47 UTC

[06/13] isis git commit: ISIS-1407: ensures that internal domain services (not annotated with @DomainService) are also loaded into the metamodel as service specifications.

ISIS-1407: ensures that internal domain services (not annotated with @DomainService) are also loaded into the metamodel as service specifications.

ie markAsService toggled on.   This then means that the code to invoke markAsService() whenever any PersistenceSession is opened can be removed.


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/29f1e083
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/29f1e083
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/29f1e083

Branch: refs/heads/ISIS-1427
Commit: 29f1e0839c6a8e7322a2554b5bd611f6254b788e
Parents: e2e206c
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Jun 15 16:42:46 2016 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Jun 15 16:42:46 2016 +0100

----------------------------------------------------------------------
 .../isis/core/metamodel/specloader/SpecificationLoader.java  | 8 +++-----
 .../core/runtime/system/persistence/PersistenceSession.java  | 5 -----
 2 files changed, 3 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/29f1e083/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoader.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoader.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoader.java
index 5f487e3..ebd988e 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoader.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/SpecificationLoader.java
@@ -156,11 +156,9 @@ public class SpecificationLoader implements ApplicationScopedComponent {
     private void loadSpecificationsForServices() {
         for (final Class<?> serviceClass : allServiceClasses()) {
             final DomainService domainService = serviceClass.getAnnotation(DomainService.class);
-            if(domainService != null) {
-                if(domainService.nature() == NatureOfService.VIEW || domainService.nature() == NatureOfService.VIEW_CONTRIBUTIONS_ONLY) {
-                    internalLoadSpecification(serviceClass, domainService.nature());
-                }
-            }
+            final NatureOfService nature = domainService != null ? domainService.nature() : NatureOfService.DOMAIN;
+            // will 'markAsService'
+            internalLoadSpecification(serviceClass, nature);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/isis/blob/29f1e083/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java
index 14073cc..5c4d1a0 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSession.java
@@ -370,12 +370,7 @@ public class PersistenceSession implements
      */
     private void initServices() {
         final List<Object> registeredServices = servicesInjector.getRegisteredServices();
-
         for (final Object service : registeredServices) {
-            final ObjectSpecification serviceSpecification =
-                    specificationLoader.loadSpecification(service.getClass());
-            serviceSpecification.markAsService();
-
             final ObjectAdapter serviceAdapter = adapterFor(service);
             remapAsPersistentIfRequired(serviceAdapter);
         }