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/09 07:08:55 UTC

[07/26] isis git commit: ISIS-1247: don't pass IsisConfiguration and SpecificationLoader into PersistenceSession's constructor, can look up from ServicesInjector.

ISIS-1247: don't pass IsisConfiguration and SpecificationLoader into PersistenceSession's constructor, can look up from ServicesInjector.


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

Branch: refs/heads/ISIS-1427
Commit: 78661493f8c24b2174b50c9f3eddb163c4988de7
Parents: 3bffc3a
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Jun 7 22:31:01 2016 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Jun 7 22:31:01 2016 +0100

----------------------------------------------------------------------
 .../runtime/system/persistence/PersistenceSession.java | 13 +++++--------
 .../system/persistence/PersistenceSessionFactory.java  |  4 +---
 2 files changed, 6 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/78661493/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 10bf2c2..5f66961 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
@@ -63,7 +63,6 @@ import org.apache.isis.applib.services.user.UserService;
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.components.SessionScopedComponent;
 import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.commons.config.IsisConfigurationDefault;
 import org.apache.isis.core.commons.ensure.Assert;
 import org.apache.isis.core.commons.ensure.IsisAssertException;
 import org.apache.isis.core.commons.exceptions.IsisException;
@@ -181,7 +180,7 @@ public class PersistenceSession implements
     private final FixturesInstalledFlag fixturesInstalledFlag;
 
     private final PersistenceQueryFactory persistenceQueryFactory;
-    private final IsisConfigurationDefault configuration;
+    private final IsisConfiguration configuration;
     private final SpecificationLoader specificationLoader;
     private final AuthenticationSession authenticationSession;
 
@@ -229,9 +228,7 @@ public class PersistenceSession implements
      * persisted objects and persist changes to the object that are saved.
      */
     public PersistenceSession(
-            final IsisConfigurationDefault configuration,
             final ServicesInjector servicesInjector,
-            final SpecificationLoader specificationLoader,
             final AuthenticationSession authenticationSession,
             final PersistenceManagerFactory jdoPersistenceManagerFactory,
             final FixturesInstalledFlag fixturesInstalledFlag) {
@@ -245,8 +242,8 @@ public class PersistenceSession implements
         this.fixturesInstalledFlag = fixturesInstalledFlag;
 
         // injected
-        this.configuration = configuration;
-        this.specificationLoader = specificationLoader;
+        this.configuration = servicesInjector.getConfigurationServiceInternal();
+        this.specificationLoader = servicesInjector.getSpecificationLoader();
         this.authenticationSession = authenticationSession;
 
         this.commandContext = lookupService(CommandContext.class);
@@ -262,13 +259,13 @@ public class PersistenceSession implements
 
         // sub-components
         final AdapterManager adapterManager = this;
-        this.persistenceQueryFactory = new PersistenceQueryFactory(adapterManager, specificationLoader);
+        this.persistenceQueryFactory = new PersistenceQueryFactory(adapterManager, this.specificationLoader);
         this.transactionManager = new IsisTransactionManager(this, servicesInjector);
 
         this.state = State.NOT_INITIALIZED;
 
         final boolean concurrencyCheckingGloballyDisabled =
-                configuration.getBoolean("isis.persistor.disableConcurrencyChecking", false);
+                this.configuration.getBoolean("isis.persistor.disableConcurrencyChecking", false);
         this.concurrencyCheckingGloballyEnabled = !concurrencyCheckingGloballyDisabled;
 
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/78661493/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
index d0ed28a..90fcbc4 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/PersistenceSessionFactory.java
@@ -35,7 +35,6 @@ import org.apache.isis.core.commons.components.ApplicationScopedComponent;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.config.IsisConfigurationDefault;
 import org.apache.isis.core.metamodel.services.ServicesInjector;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
 import org.apache.isis.core.runtime.persistence.FixturesInstalledFlag;
 import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
 import org.apache.isis.objectstore.jdo.datanucleus.JDOStateManagerForIsis;
@@ -168,7 +167,6 @@ public class PersistenceSessionFactory implements ApplicationScopedComponent, Fi
     @Programmatic
     public PersistenceSession createPersistenceSession(
             final ServicesInjector servicesInjector,
-            final SpecificationLoader specificationLoader,
             final AuthenticationSession authenticationSession) {
 
         final FixturesInstalledFlag fixturesInstalledFlag = this;
@@ -176,7 +174,7 @@ public class PersistenceSessionFactory implements ApplicationScopedComponent, Fi
                 applicationComponents.getPersistenceManagerFactory();
 
         return new PersistenceSession(
-                configuration, servicesInjector, specificationLoader,
+                servicesInjector,
                 authenticationSession, persistenceManagerFactory,
                 fixturesInstalledFlag);
     }