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 2012/08/10 01:16:35 UTC
svn commit: r1371529 [7/9] - in /incubator/isis/trunk/framework:
core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/
core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/map/
core/metamodel/src/main/java/org/apache/isis/...
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectfactory/ObjectFactoryAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectfactory/ObjectFactoryAbstract.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectfactory/ObjectFactoryAbstract.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectfactory/ObjectFactoryAbstract.java Thu Aug 9 23:16:27 2012
@@ -21,10 +21,10 @@ package org.apache.isis.runtimes.dflt.ru
import java.lang.reflect.Modifier;
-import org.apache.isis.core.metamodel.services.ServicesInjector;
+import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
import org.apache.isis.core.metamodel.spec.ObjectInstantiationException;
-import org.apache.isis.core.metamodel.spec.SpecificationLoader;
-import org.apache.isis.core.metamodel.spec.SpecificationLoaderAware;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpiAware;
import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
import org.apache.isis.runtimes.dflt.runtime.system.persistence.ObjectFactory;
import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
@@ -40,11 +40,11 @@ import org.apache.isis.runtimes.dflt.run
* {@link PersistenceSession} could change over the lifetime of the instance (eg
* when using the {@link InMemoryObjectStore}), we must always look the
* {@link PersistenceSession} from the {@link IsisContext}. The same applies to
- * the {@link ServicesInjector}.
+ * the {@link ServicesInjectorSpi}.
*
* <p>
- * In theory it would be possible to cache the {@link SpecificationLoader} and
- * inject using {@link SpecificationLoaderAware}, but since we are already using
+ * In theory it would be possible to cache the {@link SpecificationLoaderSpi} and
+ * inject using {@link SpecificationLoaderSpiAware}, but since we are already using
* the {@link IsisContext}, decided instead to use the same approach throughout.
*/
public abstract class ObjectFactoryAbstract implements ObjectFactory {
@@ -83,7 +83,7 @@ public abstract class ObjectFactoryAbstr
final T newInstance = doInstantiate(cls);
if (getServicesInjector() != null) {
- getServicesInjector().injectDependenciesInto(newInstance);
+ getServicesInjector().injectServicesInto(newInstance);
}
return newInstance;
}
@@ -119,7 +119,7 @@ public abstract class ObjectFactoryAbstr
// Dependencies (looked up from context)
// /////////////////////////////////////////////////////////////////
- protected SpecificationLoader getSpecificationLoader() {
+ protected SpecificationLoaderSpi getSpecificationLoader() {
return IsisContext.getSpecificationLoader();
}
@@ -127,7 +127,7 @@ public abstract class ObjectFactoryAbstr
return IsisContext.getPersistenceSession();
}
- protected ServicesInjector getServicesInjector() {
+ protected ServicesInjectorSpi getServicesInjector() {
return getPersistenceSession().getServicesInjector();
}
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisObjectStoreDelegating.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisObjectStoreDelegating.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisObjectStoreDelegating.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisObjectStoreDelegating.java Thu Aug 9 23:16:27 2012
@@ -34,17 +34,17 @@ import org.apache.isis.runtimes.dflt.run
import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceQuery;
/**
- * Implementation that simply delegates to underlying {@link ObjectStore}.
+ * Implementation that simply delegates to underlying {@link ObjectStoreSpi}.
*
* <p>
* Useful for quickly writing decorating implementations.
*/
-public class IsisObjectStoreDelegating implements ObjectStore {
+public class IsisObjectStoreDelegating implements ObjectStoreSpi {
- private final ObjectStore underlying;
+ private final ObjectStoreSpi underlying;
private final String name;
- public IsisObjectStoreDelegating(final ObjectStore underlying, final String name) {
+ public IsisObjectStoreDelegating(final ObjectStoreSpi underlying, final String name) {
this.underlying = underlying;
this.name = name;
}
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisObjectStoreLogger.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisObjectStoreLogger.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisObjectStoreLogger.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisObjectStoreLogger.java Thu Aug 9 23:16:27 2012
@@ -39,15 +39,15 @@ import org.apache.isis.runtimes.dflt.run
import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceQuery;
import org.apache.isis.runtimes.dflt.runtime.transaction.ObjectPersistenceException;
-public class IsisObjectStoreLogger extends Logger implements ObjectStore {
- private final ObjectStore underlying;
+public class IsisObjectStoreLogger extends Logger implements ObjectStoreSpi {
+ private final ObjectStoreSpi underlying;
- public IsisObjectStoreLogger(final ObjectStore decorated, final String level) {
+ public IsisObjectStoreLogger(final ObjectStoreSpi decorated, final String level) {
super(level);
this.underlying = decorated;
}
- public IsisObjectStoreLogger(final ObjectStore decorated) {
+ public IsisObjectStoreLogger(final ObjectStoreSpi decorated) {
this.underlying = decorated;
}
Copied: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStoreSpi.java (from r1371199, incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStore.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStoreSpi.java?p2=incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStoreSpi.java&p1=incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStore.java&r1=1371199&r2=1371529&rev=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStore.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStoreSpi.java Thu Aug 9 23:16:27 2012
@@ -19,6 +19,9 @@
package org.apache.isis.runtimes.dflt.runtime.persistence.objectstore;
-public interface ObjectStore extends ObjectStorePersistence, ObjectStoreTransactionManagement {
+import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.TransactionalResource;
+import org.apache.isis.runtimes.dflt.runtime.system.persistence.ObjectStore;
+
+public interface ObjectStoreSpi extends ObjectStore, TransactionalResource {
}
Copied: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/TransactionalResource.java (from r1371199, incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStoreTransactionManagement.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/TransactionalResource.java?p2=incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/TransactionalResource.java&p1=incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStoreTransactionManagement.java&r1=1371199&r2=1371529&rev=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStoreTransactionManagement.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/transaction/TransactionalResource.java Thu Aug 9 23:16:27 2012
@@ -17,29 +17,29 @@
* under the License.
*/
-package org.apache.isis.runtimes.dflt.runtime.persistence.objectstore;
+package org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction;
import java.util.List;
-import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.PersistenceCommand;
+import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.ObjectStoreSpi;
import org.apache.isis.runtimes.dflt.runtime.system.transaction.IsisTransaction;
import org.apache.isis.runtimes.dflt.runtime.system.transaction.IsisTransactionManager;
/**
- * Interface for the {@link IsisTransactionManager} to interact with the
- * {@link ObjectStore}.
+ * Interface for the {@link IsisTransactionManager} to interact with some
+ * transactional resource (ie a {@link ObjectStoreSpi}).
*/
-public interface ObjectStoreTransactionManagement {
+public interface TransactionalResource {
/**
* Used by the {@link ObjectStoreTransactionManager} to tell the underlying
- * {@link ObjectStore} to start a transaction.
+ * {@link ObjectStoreSpi} to start a transaction.
*/
void startTransaction();
/**
* Used by the current {@link IsisTransaction} to flush changes to
- * the {@link ObjectStore} (either via a
+ * the {@link ObjectStoreSpi} (either via a
* {@link IsisTransactionManager#flushTransaction()} or a
* {@link IsisTransactionManager#endTransaction()}).
*/
@@ -47,13 +47,13 @@ public interface ObjectStoreTransactionM
/**
* Used by the {@link ObjectStoreTransactionManager} to tell the underlying
- * {@link ObjectStore} to commit a transaction.
+ * {@link ObjectStoreSpi} to commit a transaction.
*/
void endTransaction();
/**
* Used by the {@link ObjectStoreTransactionManager} to tell the underlying
- * {@link ObjectStore} to abort a transaction.
+ * {@link ObjectStoreSpi} to abort a transaction.
*/
void abortTransaction();
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/package-info.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/package-info.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/package-info.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/package-info.java Thu Aug 9 23:16:27 2012
@@ -38,7 +38,7 @@
*
* <p>
* Note that the {@link PersistenceSession} both extends a number of superinterfaces as well as uses implementations of
- * various helpers (for example {@link org.apache.isis.metamodel.services.ServicesInjector} and {@link org.apache.isis.runtime.persistence.oidgenerator.OidGenerator}).
+ * various helpers (for example {@link org.apache.isis.ServicesInjectorSpi.services.ServicesInjector} and {@link org.apache.isis.runtime.persistence.oidgenerator.OidGenerator}).
* These superinterfaces and helper interfaces are not normally implemented directly, and it is the
* responsibility of the {@link PersistenceMechanismInstaller} to ensure that the correct helper objects
* are passed to the {@link PersistenceSession} implementation.
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/query/PersistenceQueryAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/query/PersistenceQueryAbstract.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/query/PersistenceQueryAbstract.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/query/PersistenceQueryAbstract.java Thu Aug 9 23:16:27 2012
@@ -25,7 +25,7 @@ import org.apache.isis.core.commons.enco
import org.apache.isis.core.commons.encoding.DataOutputExtended;
import org.apache.isis.core.commons.encoding.Encodable;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.SpecificationLoader;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceQuery;
@@ -101,7 +101,7 @@ public abstract class PersistenceQueryAb
// Dependencies (from context)
// ///////////////////////////////////////////////////////
- protected static SpecificationLoader getSpecificationLoader() {
+ protected static SpecificationLoaderSpi getSpecificationLoader() {
return IsisContext.getSpecificationLoader();
}
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/services/RepositoryHelper.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/services/RepositoryHelper.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/services/RepositoryHelper.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/services/RepositoryHelper.java Thu Aug 9 23:16:27 2012
@@ -28,7 +28,7 @@ import org.apache.isis.core.metamodel.fa
import org.apache.isis.core.metamodel.facets.collections.modify.CollectionFacetUtils;
import org.apache.isis.core.metamodel.services.container.query.QueryCardinality;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.SpecificationLoader;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
import org.apache.isis.runtimes.dflt.runtime.persistence.query.PersistenceQueryFindByTitle;
import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceQuery;
@@ -99,7 +99,7 @@ public final class RepositoryHelper {
return IsisContext.getPersistenceSession();
}
- private static SpecificationLoader getSpecificationLoader() {
+ private static SpecificationLoaderSpi getSpecificationLoader() {
return IsisContext.getSpecificationLoader();
}
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/snapshot/XmlSnapshotBuilder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/snapshot/XmlSnapshotBuilder.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/snapshot/XmlSnapshotBuilder.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/snapshot/XmlSnapshotBuilder.java Thu Aug 9 23:16:27 2012
@@ -24,7 +24,7 @@ import com.google.common.collect.Lists;
import org.apache.isis.applib.snapshot.Snapshottable;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.map.AdapterMap;
+import org.apache.isis.core.metamodel.adapter.map.AdapterManager;
import org.apache.isis.core.runtime.snapshot.XmlSchema;
import org.apache.isis.core.runtime.snapshot.XmlSnapshot;
import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
@@ -90,7 +90,7 @@ public class XmlSnapshotBuilder {
// Dependencies (from context)
// ///////////////////////////////////////////////////////
- private static AdapterMap getAdapterMap() {
+ private static AdapterManager getAdapterMap() {
return getPersistenceSession().getAdapterManager();
}
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/IsisSystemFixturesHookAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/IsisSystemFixturesHookAbstract.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/IsisSystemFixturesHookAbstract.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/IsisSystemFixturesHookAbstract.java Thu Aug 9 23:16:27 2012
@@ -28,7 +28,7 @@ import org.apache.isis.applib.fixtures.L
import org.apache.isis.core.commons.config.IsisConfiguration;
import org.apache.isis.core.commons.debug.DebugBuilder;
import org.apache.isis.core.commons.debug.DebuggableWithTitle;
-import org.apache.isis.core.metamodel.specloader.ObjectReflector;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
import org.apache.isis.core.runtime.about.AboutIsis;
import org.apache.isis.core.runtime.authentication.AuthenticationManager;
import org.apache.isis.core.runtime.authorization.AuthorizationManager;
@@ -196,7 +196,7 @@ public abstract class IsisSystemFixtures
// Reflector
// ///////////////////////////////////////////
- protected abstract ObjectReflector obtainReflector(DeploymentType deploymentType) throws IsisSystemException;
+ protected abstract SpecificationLoaderSpi obtainSpecificationLoaderSpi(DeploymentType deploymentType) throws IsisSystemException;
// ///////////////////////////////////////////
// PersistenceSessionFactory
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/SystemConstants.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/SystemConstants.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/SystemConstants.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/SystemConstants.java Thu Aug 9 23:16:27 2012
@@ -21,7 +21,7 @@ package org.apache.isis.runtimes.dflt.ru
import org.apache.isis.core.commons.config.ConfigurationConstants;
import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.metamodel.specloader.ObjectReflector;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
import org.apache.isis.core.metamodel.specloader.ObjectReflectorInstaller;
import org.apache.isis.core.runtime.authentication.AuthenticationManager;
import org.apache.isis.core.runtime.authentication.AuthenticationManagerInstaller;
@@ -50,11 +50,12 @@ public final class SystemConstants {
public static final String DEPLOYMENT_TYPE_KEY = ConfigurationConstants.ROOT + "deploymentType";
/**
- * Key used to lookup {@link ObjectReflector reflector} in
+ * Key used to lookup {@link SpecificationLoaderSpi specification Loader} in
* {@link IsisConfiguration}, and root for any
* {@link ObjectReflectorInstaller reflector}-specific configuration keys.
*/
public final static String REFLECTOR_KEY = ConfigurationConstants.ROOT + ObjectReflectorInstaller.TYPE;
+
/**
* Default for {@link #REFLECTOR_KEY}
*/
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/context/IsisContext.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/context/IsisContext.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/context/IsisContext.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/context/IsisContext.java Thu Aug 9 23:16:27 2012
@@ -32,7 +32,7 @@ import org.apache.isis.core.commons.debu
import org.apache.isis.core.commons.debug.DebugList;
import org.apache.isis.core.commons.debug.DebuggableWithTitle;
import org.apache.isis.core.commons.exceptions.IsisException;
-import org.apache.isis.core.metamodel.spec.SpecificationLoader;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
import org.apache.isis.core.runtime.authentication.AuthenticationManager;
import org.apache.isis.core.runtime.authorization.AuthorizationManager;
import org.apache.isis.core.runtime.imageloader.TemplateImageLoader;
@@ -340,7 +340,7 @@ public abstract class IsisContext implem
*
* @see IsisSessionFactory#getSpecificationLoader()
*/
- public static SpecificationLoader getSpecificationLoader() {
+ public static SpecificationLoaderSpi getSpecificationLoader() {
return getSessionFactory().getSpecificationLoader();
}
@@ -525,7 +525,7 @@ public abstract class IsisContext implem
debugList.add("Transaction Manager", getTransactionManager());
debugList.add("Service injector", getPersistenceSession().getServicesInjector());
- debugList.add("Adapter factory", getPersistenceSession().getAdapterFactory());
+ debugList.add("Adapter factory", getPersistenceSession().getObjectAdapterFactory());
debugList.add("Object factory", getPersistenceSession().getObjectFactory());
debugList.add("OID generator", getPersistenceSession().getOidGenerator());
debugList.add("Adapter manager", getPersistenceSession().getAdapterManager());
Copied: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/AdapterManagerSpi.java (from r1371199, incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerPersist.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/AdapterManagerSpi.java?p2=incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/AdapterManagerSpi.java&p1=incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerPersist.java&r1=1371199&r2=1371529&rev=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerPersist.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/AdapterManagerSpi.java Thu Aug 9 23:16:27 2012
@@ -17,23 +17,43 @@
* under the License.
*/
-package org.apache.isis.runtimes.dflt.runtime.persistence.adaptermanager;
+package org.apache.isis.runtimes.dflt.runtime.system.persistence;
import org.apache.isis.applib.annotation.Aggregated;
+import org.apache.isis.core.commons.components.Injectable;
+import org.apache.isis.core.commons.components.Resettable;
+import org.apache.isis.core.commons.components.SessionScopedComponent;
+import org.apache.isis.core.commons.debug.DebuggableWithTitle;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapterLookup;
import org.apache.isis.core.metamodel.adapter.ResolveState;
+import org.apache.isis.core.metamodel.adapter.map.AdapterManager;
import org.apache.isis.core.metamodel.adapter.oid.Oid;
import org.apache.isis.core.metamodel.adapter.oid.RootOid;
import org.apache.isis.core.metamodel.adapter.oid.TypedOid;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.runtimes.dflt.runtime.persistence.adaptermanager.PojoRecreator;
import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.algorithm.PersistAlgorithm;
-import org.apache.isis.runtimes.dflt.runtime.system.persistence.OidGenerator;
-import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
/**
- * API used solely by the {@link PersistenceSession}.
+ * Responsible for managing the {@link ObjectAdapter adapter}s and {@link Oid
+ * identities} for each and every POJO that is being used by the framework.
+ *
+ * <p>
+ * It provides a consistent set of adapters in memory, providing an
+ * {@link ObjectAdapter adapter} for the POJOs that are in use ensuring that the
+ * same object is not loaded twice into memory.
+ *
+ * <p>
+ * Each POJO is given an {@link ObjectAdapter adapter} so that the framework can
+ * work with the POJOs even though it does not understand their types. Each POJO
+ * maps to an {@link ObjectAdapter adapter} and these are reused.
*/
-public interface AdapterManagerPersist {
+public interface AdapterManagerSpi extends AdapterManager, Iterable<ObjectAdapter>
+ , SessionScopedComponent,
+ DebuggableWithTitle,
+ Resettable {
+
/**
* Remaps the {@link ObjectAdapter adapter} and any associated
@@ -102,4 +122,32 @@ public interface AdapterManagerPersist {
*/
ObjectAdapter recreatePersistentAdapter(TypedOid oid);
+
+
+
+ /**
+ * Add a pre-existing {@link ObjectAdapter adapter} straight into the maps.
+ */
+ ObjectAdapter addExistingAdapter(ObjectAdapter object);
+
+ // /////////////////////////////////////////////////////////
+ // removal
+ // /////////////////////////////////////////////////////////
+
+ /**
+ * Removes the specified {@link ObjectAdapter adapter} from the identity
+ * maps.
+ */
+ void removeAdapter(ObjectAdapter adapter);
+
+ /**
+ * Removes the {@link ObjectAdapter adapter} identified by the specified
+ * {@link Oid}.
+ *
+ * <p>
+ * Should be same as {@link #getAdapterFor(Oid)} followed by
+ * {@link #removeAdapter(ObjectAdapter)}.
+ */
+ void removeAdapter(Oid oid);
+
}
Copied: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/ObjectStore.java (from r1371199, incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStorePersistence.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/ObjectStore.java?p2=incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/ObjectStore.java&p1=incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStorePersistence.java&r1=1371199&r2=1371529&rev=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStorePersistence.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/ObjectStore.java Thu Aug 9 23:16:27 2012
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.isis.runtimes.dflt.runtime.persistence.objectstore;
+package org.apache.isis.runtimes.dflt.runtime.system.persistence;
import java.util.List;
@@ -35,11 +35,8 @@ import org.apache.isis.runtimes.dflt.run
import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.DestroyObjectCommand;
import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.PersistenceCommand;
import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.SaveObjectCommand;
-import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceQuery;
-import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
-import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSessionFactory;
-public interface ObjectStorePersistence extends DebuggableWithTitle, SessionScopedComponent {
+public interface ObjectStore extends DebuggableWithTitle, SessionScopedComponent {
/**
* The name of this component.
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/OidGenerator.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/OidGenerator.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/OidGenerator.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/OidGenerator.java Thu Aug 9 23:16:27 2012
@@ -21,7 +21,6 @@ package org.apache.isis.runtimes.dflt.ru
import org.apache.isis.applib.annotation.Aggregated;
import org.apache.isis.core.commons.components.Injectable;
-import org.apache.isis.core.commons.components.SessionScopedComponent;
import org.apache.isis.core.commons.debug.DebugBuilder;
import org.apache.isis.core.commons.debug.DebuggableWithTitle;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -33,10 +32,10 @@ import org.apache.isis.core.metamodel.ad
import org.apache.isis.core.metamodel.adapter.oid.stringable.OidStringifier;
import org.apache.isis.core.metamodel.spec.ObjectSpecId;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.SpecificationLookup;
+import org.apache.isis.core.metamodel.spec.SpecificationLoader;
import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
-public class OidGenerator implements DebuggableWithTitle, SessionScopedComponent, Injectable {
+public class OidGenerator implements DebuggableWithTitle, Injectable {
private final OidStringifier oidStringifier;
private final IdentifierGenerator identifierGenerator;
@@ -63,25 +62,7 @@ public class OidGenerator implements Deb
return oidStringifier;
}
- // //////////////////////////////////////////////////////////////
- // open, close (session scoped)
- // //////////////////////////////////////////////////////////////
-
- /**
- * Default implementation does nothing.
- */
- @Override
- public void open() {
- }
- /**
- * Default implementation does nothing.
- */
- @Override
- public void close() {
- }
-
-
// //////////////////////////////////////////////////////////////
// API and mandatory hooks
// //////////////////////////////////////////////////////////////
@@ -181,7 +162,7 @@ public class OidGenerator implements Deb
// context
//////////////////////////////////////////////////////////////////
- protected SpecificationLookup getSpecificationLookup() {
+ protected SpecificationLoader getSpecificationLookup() {
return IsisContext.getSpecificationLoader();
}
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSession.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSession.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSession.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSession.java Thu Aug 9 23:16:27 2012
@@ -34,6 +34,7 @@ import com.google.common.collect.Maps;
import org.apache.log4j.Logger;
+import org.apache.isis.applib.DomainObjectContainer;
import org.apache.isis.applib.query.Query;
import org.apache.isis.applib.query.QueryDefault;
import org.apache.isis.applib.query.QueryFindAllInstances;
@@ -60,7 +61,7 @@ import org.apache.isis.core.metamodel.fa
import org.apache.isis.core.metamodel.facets.object.callbacks.UpdatingCallbackFacet;
import org.apache.isis.core.metamodel.facets.object.immutable.ImmutableFacetUtils;
import org.apache.isis.core.metamodel.services.ServiceUtil;
-import org.apache.isis.core.metamodel.services.ServicesInjector;
+import org.apache.isis.core.metamodel.services.ServicesInjectorSpi;
import org.apache.isis.core.metamodel.services.container.query.QueryCardinality;
import org.apache.isis.core.metamodel.services.container.query.QueryFindByPattern;
import org.apache.isis.core.metamodel.services.container.query.QueryFindByTitle;
@@ -68,16 +69,15 @@ import org.apache.isis.core.metamodel.sp
import org.apache.isis.core.metamodel.spec.FreeStandingList;
import org.apache.isis.core.metamodel.spec.ObjectSpecId;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.SpecificationLoader;
-import org.apache.isis.core.metamodel.spec.SpecificationLoaderAware;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
+import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
import org.apache.isis.runtimes.dflt.runtime.persistence.FixturesInstalledFlag;
import org.apache.isis.runtimes.dflt.runtime.persistence.NotPersistableException;
import org.apache.isis.runtimes.dflt.runtime.persistence.PersistenceSessionAware;
-import org.apache.isis.runtimes.dflt.runtime.persistence.adaptermanager.AdapterManagerExtended;
+import org.apache.isis.runtimes.dflt.runtime.persistence.UnsupportedFindException;
import org.apache.isis.runtimes.dflt.runtime.persistence.internal.RuntimeContextFromSession;
-import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.ObjectStore;
-import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.ObjectStorePersistence;
+import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.ObjectStoreSpi;
import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.algorithm.PersistAlgorithm;
import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.algorithm.ToPersistObjectSet;
import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.CreateObjectCommand;
@@ -89,6 +89,7 @@ import org.apache.isis.runtimes.dflt.run
import org.apache.isis.runtimes.dflt.runtime.persistence.query.PersistenceQueryFindUsingApplibQueryDefault;
import org.apache.isis.runtimes.dflt.runtime.persistence.query.PersistenceQueryFindUsingApplibQuerySerializable;
import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
+import org.apache.isis.runtimes.dflt.runtime.system.transaction.EnlistedObjectDirtying;
import org.apache.isis.runtimes.dflt.runtime.system.transaction.IsisTransactionManager;
import org.apache.isis.runtimes.dflt.runtime.system.transaction.IsisTransactionManagerAware;
import org.apache.isis.runtimes.dflt.runtime.system.transaction.UpdateNotifier;
@@ -96,25 +97,29 @@ import org.apache.isis.runtimes.dflt.run
import org.apache.isis.runtimes.dflt.runtime.transaction.TransactionalClosureAbstract;
import org.apache.isis.runtimes.dflt.runtime.transaction.TransactionalClosureWithReturnAbstract;
-public class PersistenceSession implements PersistenceSessionContainer, PersistenceSessionAdaptedServiceManager, PersistenceSessionTransactionManagement, PersistenceSessionTestSupport, SpecificationLoaderAware,
- IsisTransactionManagerAware, SessionScopedComponent, Injectable, DebuggableWithTitle, ToPersistObjectSet {
+public class PersistenceSession implements
+ EnlistedObjectDirtying, ToPersistObjectSet,
+ IsisTransactionManagerAware,
+ SessionScopedComponent, Injectable, DebuggableWithTitle {
+
+ private static final Logger LOG = Logger.getLogger(PersistenceSession.class);
private final PersistenceSessionFactory persistenceSessionFactory;
- private final ObjectAdapterFactory adapterFactory;
+ private final ObjectAdapterFactory objectAdapterFactory;
private final ObjectFactory objectFactory;
- private final ServicesInjector servicesInjector;
+ private final ServicesInjectorSpi servicesInjector;
private final OidGenerator oidGenerator;
- private final AdapterManagerExtended adapterManager;
+ private final AdapterManagerSpi adapterManager;
+
+ private final PersistAlgorithm persistAlgorithm;
+ private final ObjectStore objectStore;
+ private final Map<ObjectSpecId, RootOid> servicesByObjectType = Maps.newHashMap();
private boolean dirtiableSupport;
/**
* Injected using setter-based injection.
*/
- private SpecificationLoader specificationLoader;
- /**
- * Injected using setter-based injection.
- */
private IsisTransactionManager transactionManager;
private static enum State {
@@ -122,21 +127,38 @@ public class PersistenceSession implemen
}
private State state;
-
- private static final Logger LOG = Logger.getLogger(PersistenceSession.class);
- private final PersistAlgorithm persistAlgorithm;
- private final ObjectStorePersistence objectStore;
- private final Map<ObjectSpecId, RootOid> servicesByObjectType = Maps.newHashMap();
+ /**
+ * Initialize the object store so that calls to this object store access
+ * persisted objects and persist changes to the object that are saved.
+ */
+ public PersistenceSession(
+ final PersistenceSessionFactory persistenceSessionFactory,
+ final ObjectAdapterFactory adapterFactory,
+ final ObjectFactory objectFactory,
+ final ServicesInjectorSpi servicesInjector,
+ final IdentifierGenerator identifierGenerator,
+ final AdapterManagerSpi adapterManager,
+ final PersistAlgorithm persistAlgorithm,
+ final ObjectStore objectStore) {
+
+ this(persistenceSessionFactory, adapterFactory, objectFactory, servicesInjector, new OidGenerator(identifierGenerator), adapterManager,
+ persistAlgorithm, objectStore);
+ }
-
/**
* Initialize the object store so that calls to this object store access
* persisted objects and persist changes to the object that are saved.
*/
- public PersistenceSession(final PersistenceSessionFactory persistenceSessionFactory, final ObjectAdapterFactory adapterFactory, final ObjectFactory objectFactory, final ServicesInjector servicesInjector, final OidGenerator oidGenerator, final AdapterManagerExtended adapterManager,
- final PersistAlgorithm persistAlgorithm, final ObjectStorePersistence objectStore) {
+ public PersistenceSession(
+ final PersistenceSessionFactory persistenceSessionFactory,
+ final ObjectAdapterFactory adapterFactory,
+ final ObjectFactory objectFactory,
+ final ServicesInjectorSpi servicesInjector,
+ final OidGenerator oidGenerator,
+ final AdapterManagerSpi adapterManager,
+ final PersistAlgorithm persistAlgorithm, final ObjectStore objectStore) {
ensureThatArg(persistenceSessionFactory, is(not(nullValue())), "persistence session factory required");
@@ -150,7 +172,7 @@ public class PersistenceSession implemen
this.persistenceSessionFactory = persistenceSessionFactory;
// session scope
- this.adapterFactory = adapterFactory;
+ this.objectAdapterFactory = adapterFactory;
this.objectFactory = objectFactory;
this.servicesInjector = servicesInjector;
this.oidGenerator = oidGenerator;
@@ -170,17 +192,6 @@ public class PersistenceSession implemen
this.objectStore = objectStore;
}
- /**
- * Initialize the object store so that calls to this object store access
- * persisted objects and persist changes to the object that are saved.
- */
- public PersistenceSession(final PersistenceSessionFactory persistenceSessionFactory, final ObjectAdapterFactory adapterFactory, final ObjectFactory objectFactory, final ServicesInjector servicesInjector, final IdentifierGenerator identifierGenerator, final AdapterManagerExtended identityMap,
- final PersistAlgorithm persistAlgorithm, final ObjectStorePersistence objectStore) {
-
- this(persistenceSessionFactory, adapterFactory, objectFactory, servicesInjector, new OidGenerator(identifierGenerator), identityMap,
- persistAlgorithm, objectStore);
- }
-
// ///////////////////////////////////////////////////////////////////////////
// PersistenceSessionFactory
@@ -213,28 +224,19 @@ public class PersistenceSession implemen
}
// injected via setters
- ensureThatState(specificationLoader, is(not(nullValue())), "SpecificationLoader missing");
ensureThatState(transactionManager, is(not(nullValue())), "TransactionManager missing");
// inject any required dependencies into object factory
this.injectInto(objectFactory);
- specificationLoader.injectInto(objectFactory);
servicesInjector.injectInto(objectFactory);
- // wire dependencies into identityMap
- adapterFactory.injectInto(adapterManager);
- specificationLoader.injectInto(adapterManager);
+ // wire dependencies into adapterManager
oidGenerator.injectInto(adapterManager);
servicesInjector.injectInto(adapterManager);
- // wire dependencies into oid generator
- specificationLoader.injectInto(oidGenerator);
-
servicesInjector.open();
- adapterFactory.open();
objectFactory.open();
adapterManager.open();
- oidGenerator.open();
// doOpen..
ensureThatState(objectStore, is(notNullValue()), "object store required");
@@ -279,8 +281,6 @@ public class PersistenceSession implemen
adapterManager.close();
servicesInjector.close();
objectFactory.close();
- adapterFactory.close();
- oidGenerator.close();
setState(State.CLOSED);
}
@@ -293,7 +293,7 @@ public class PersistenceSession implemen
private void createServiceAdapters() {
getTransactionManager().startTransaction();
for (final Object service : servicesInjector.getRegisteredServices()) {
- final ObjectSpecification serviceSpecification = specificationLoader.loadSpecification(service.getClass());
+ final ObjectSpecification serviceSpecification = getSpecificationLoader().loadSpecification(service.getClass());
serviceSpecification.markAsService();
final RootOid existingOid = getOidForService(serviceSpecification);
ObjectAdapter serviceAdapter;
@@ -342,18 +342,6 @@ public class PersistenceSession implemen
}
// ///////////////////////////////////////////////////////////////////////////
- // shutdown, reset
- // ///////////////////////////////////////////////////////////////////////////
-
- /**
- * For testing purposes only.
- */
- public void testReset() {
- objectStore.reset();
- getAdapterManager().reset();
- }
-
- // ///////////////////////////////////////////////////////////////////////////
// Factory (for transient instance)
// ///////////////////////////////////////////////////////////////////////////
@@ -361,15 +349,34 @@ public class PersistenceSession implemen
* Create a root or standalone {@link ObjectAdapter adapter}.
*
* <p>
+ * Creates a new instance of the specified type and returns it in an adapter
+ * whose resolved state set to {@link ResolveState#TRANSIENT} (except if the
+ * type is marked as {@link ObjectSpecification#isValueOrIsParented()
+ * aggregated} in which case it will be set to {@link ResolveState#VALUE}).
+ *
+ * <p>
* The returned object will be initialised (had the relevant callback
* lifecycle methods invoked).
*
* <p>
+ * <b><i> REVIEW: not sure about {@link ResolveState#VALUE} - see comments
+ * in {@link #adapterFor(Object, Oid, OneToManyAssociation)}.</i></b>
+ * <p>
* TODO: this is the same as
- * {@link RuntimeContextFromSession#createTransientInstance(ObjectSpecification)}
- * ; could it be unified?
+ * {@link RuntimeContextFromSession#createTransientInstance(ObjectSpecification)};
+ * could it be unified?
+ *
+ * <p>
+ * While creating the object it will be initialised with default values and
+ * its created lifecycle method (its logical constructor) will be invoked.
+ * Contrast this with
+ * {@link #recreateTransientInstance(Oid, ObjectSpecification)}.
+ *
+ * <p>
+ * This method is ultimately delegated to by the
+ * {@link DomainObjectContainer}.
*/
- @Override
+ //@Override
public ObjectAdapter createInstance(final ObjectSpecification objectSpec) {
if (LOG.isDebugEnabled()) {
LOG.debug("creating transient instance of " + objectSpec);
@@ -379,7 +386,23 @@ public class PersistenceSession implemen
return objectSpec.initialize(adapter);
}
- @Override
+ /**
+ * Creates a new instance of the specified type and returns an adapter with
+ * an aggregated OID that show that this new object belongs to the specified
+ * parent. The new object's resolved state is set to
+ * {@link ResolveState#RESOLVED} as it state is part of it parent.
+ *
+ * <p>
+ * While creating the object it will be initialised with default values and
+ * its created lifecycle method (its logical constructor) will be invoked.
+ * Contrast this with
+ * {@link #recreateTransientInstance(Oid, ObjectSpecification)}.
+ *
+ * <p>
+ * This method is ultimately delegated to by the
+ * {@link DomainObjectContainer}.
+ */
+ //@Override
public ObjectAdapter createInstance(final ObjectSpecification objectSpec, final ObjectAdapter parentAdapter) {
if (LOG.isDebugEnabled()) {
LOG.debug("creating aggregated instance of " + objectSpec);
@@ -400,7 +423,17 @@ public class PersistenceSession implemen
// findInstances, getInstances
// ///////////////////////////////////////////////////////////////////////////
- @Override
+ /**
+ * Finds and returns instances that match the specified query.
+ *
+ * <p>
+ * The {@link QueryCardinality} determines whether all instances or just the
+ * first matching instance is returned.
+ *
+ * @throws UnsupportedFindException
+ * if the criteria is not support by this persistor
+ */
+ //@Override
public <T> ObjectAdapter findInstances(final Query<T> query, final QueryCardinality cardinality) {
final PersistenceQuery persistenceQuery = createPersistenceQueryFor(query, cardinality);
if (persistenceQuery == null) {
@@ -409,7 +442,20 @@ public class PersistenceSession implemen
return findInstances(persistenceQuery);
}
- @Override
+ /**
+ * Finds and returns instances that match the specified
+ * {@link PersistenceQuery}.
+ *
+ * <p>
+ * Compared to {@link #findInstances(Query, QueryCardinality)}, not that
+ * there is no {@link QueryCardinality} parameter. That's because
+ * {@link PersistenceQuery} intrinsically carry the knowledge as to how many
+ * rows they return.
+ *
+ * @throws UnsupportedFindException
+ * if the criteria is not support by this persistor
+ */
+ //@Override
public ObjectAdapter findInstances(final PersistenceQuery persistenceQuery) {
final List<ObjectAdapter> instances = getInstances(persistenceQuery);
final ObjectSpecification specification = persistenceQuery.getSpecification();
@@ -509,10 +555,18 @@ public class PersistenceSession implemen
}
/**
+ * Mark as {@link #objectChanged(ObjectAdapter) changed } all
+ * {@link Dirtiable} objects that have been
+ * {@link Dirtiable#markDirty(ObjectAdapter) manually marked} as dirty.
+ *
+ * <p>
* If {@link #isCheckObjectsForDirtyFlag() enabled}, will mark as
* {@link #objectChanged(ObjectAdapter) changed} any {@link Dirtiable}
* objects that have manually been
* {@link Dirtiable#markDirty(ObjectAdapter) marked as dirty}.
+ *
+ * <p>
+ * Called by the {@link IsisTransactionManager}.
*/
@Override
public void objectChangedAllDirty() {
@@ -534,10 +588,6 @@ public class PersistenceSession implemen
}
}
- /**
- * Set as {@link Dirtiable#clearDirty(ObjectAdapter) clean} any
- * {@link Dirtiable} objects.
- */
@Override
public synchronized void clearAllDirty() {
if (!isCheckObjectsForDirtyFlag()) {
@@ -578,7 +628,6 @@ public class PersistenceSession implemen
objectStore.registerService(rootOid);
}
- @Override
public ObjectAdapter getService(final String id) {
for (final Object service : servicesInjector.getRegisteredServices()) {
// TODO this (ServiceUtil) uses reflection to access the service
@@ -592,7 +641,6 @@ public class PersistenceSession implemen
}
// REVIEW why does this get called multiple times when starting up
- @Override
public List<ObjectAdapter> getServices() {
final List<Object> services = servicesInjector.getRegisteredServices();
final List<ObjectAdapter> serviceAdapters = Lists.newArrayList();
@@ -635,10 +683,10 @@ public class PersistenceSession implemen
* initialise the persistor.
*
* <p>
- * Returns the cached value of {@link ObjectStore#isFixturesInstalled()
+ * Returns the cached value of {@link ObjectStoreSpi#isFixturesInstalled()
* whether fixtures are installed} from the
* {@link PersistenceSessionFactory} (provided it implements
- * {@link FixturesInstalledFlag}), otherwise queries {@link ObjectStore}
+ * {@link FixturesInstalledFlag}), otherwise queries {@link ObjectStoreSpi}
* directly.
* <p>
* This caching is important because if we've determined, for a given run,
@@ -671,7 +719,11 @@ public class PersistenceSession implemen
// loadObject, reload
// ///////////////////////////////////////////////////////////////////////////
- @Override
+ /**
+ * Loads the object identified by the specified {@link TypedOid} from the
+ * persisted set of objects.
+ */
+ //@Override
public ObjectAdapter loadObject(final TypedOid oid) {
ensureThatArg(oid, is(notNullValue()));
@@ -698,7 +750,12 @@ public class PersistenceSession implemen
// resolveImmediately, resolveField
// ///////////////////////////////////////////////////////////////////////////
- @Override
+ /**
+ * Re-initialises the fields of an object. If the object is unresolved then
+ * the object's missing data should be retrieved from the persistence
+ * mechanism and be used to set up the value objects and associations.
+ */
+ //@Override
public void resolveImmediately(final ObjectAdapter adapter) {
// synchronize on the current session because getting race
// conditions, I think between different UI threads when running
@@ -743,7 +800,19 @@ public class PersistenceSession implemen
});
}
- @Override
+ /**
+ * Hint that specified field within the specified object is likely to be
+ * needed soon. This allows the object's data to be loaded, ready for use.
+ *
+ * <p>
+ * This method need not do anything, but offers the object store the
+ * opportunity to load in objects before their use. Contrast this with
+ * resolveImmediately, which requires an object to be loaded before
+ * continuing.
+ *
+ * @see #resolveImmediately(ObjectAdapter)
+ */
+ //@Override
public void resolveField(final ObjectAdapter objectAdapter, final ObjectAssociation field) {
if (field.isNotPersisted()) {
return;
@@ -789,7 +858,7 @@ public class PersistenceSession implemen
* Makes an {@link ObjectAdapter} persistent. The specified object should be
* stored away via this object store's persistence mechanism, and have an
* new and unique OID assigned to it. The object, should also be added to
- * the {@link AdapterManager} as the object is implicitly 'in use'.
+ * the {@link AdapterManagerSpi} as the object is implicitly 'in use'.
*
* <p>
* If the object has any associations then each of these, where they aren't
@@ -803,7 +872,7 @@ public class PersistenceSession implemen
*
* @see #remapAsPersistent(ObjectAdapter)
*/
- @Override
+ //@Override
public void makePersistent(final ObjectAdapter adapter) {
if (adapter.representsPersistent()) {
throw new NotPersistableException("Object already persistent: " + adapter);
@@ -850,7 +919,11 @@ public class PersistenceSession implemen
// objectChanged
// ///////////////////////////////////////////////////////////////////////////
- @Override
+ /**
+ * Mark the {@link ObjectAdapter} as changed, and therefore requiring
+ * flushing to the persistence mechanism.
+ */
+ //@Override
public void objectChanged(final ObjectAdapter adapter) {
if (adapter.isTransient() || (adapter.isParented() && adapter.getAggregateRoot().isTransient())) {
@@ -920,7 +993,7 @@ public class PersistenceSession implemen
* Removes the specified object from the system. The specified object's data
* should be removed from the persistence mechanism.
*/
- @Override
+ //@Override
public void destroyObject(final ObjectAdapter adapter) {
if (adapter.getSpecification().isParented()) {
return;
@@ -1004,12 +1077,19 @@ public class PersistenceSession implemen
// ///////////////////////////////////////////////////////////////////////////
/**
+ * Whether there are any instances of the specified
+ * {@link ObjectSpecification type}.
+ *
+ * <p>
* Checks whether there are any instances of the specified type. The object
* store should look for instances of the type represented by <variable>type
* </variable> and return <code>true</code> if there are, or
* <code>false</code> if there are not.
+ *
+ * <p>
+ * Used (ostensibly) by client-side code.
*/
- @Override
+ //@Override
public boolean hasInstances(final ObjectSpecification specification) {
if (LOG.isInfoEnabled()) {
LOG.info("hasInstances of " + specification.getShortIdentifier());
@@ -1048,8 +1128,8 @@ public class PersistenceSession implemen
/**
- * Uses the {@link ObjectStore} to
- * {@link ObjectStore#createCreateObjectCommand(ObjectAdapter) create} a
+ * Uses the {@link ObjectStoreSpi} to
+ * {@link ObjectStoreSpi#createCreateObjectCommand(ObjectAdapter) create} a
* {@link CreateObjectCommand}, and adds to the
* {@link IsisTransactionManager}.
*/
@@ -1142,13 +1222,26 @@ public class PersistenceSession implemen
// ///////////////////////////////////////////////////////////////////////////
+ // test support
+ // ///////////////////////////////////////////////////////////////////////////
+
+ /**
+ * For testing purposes only.
+ */
+ public void testReset() {
+ objectStore.reset();
+ getAdapterManager().reset();
+ }
+
+
+ // ///////////////////////////////////////////////////////////////////////////
// Dependencies (injected in constructor, possibly implicitly)
// ///////////////////////////////////////////////////////////////////////////
/**
* Injected by constructor.
*/
- public ObjectStorePersistence getObjectStore() {
+ public ObjectStore getObjectStore() {
return objectStore;
}
@@ -1169,8 +1262,8 @@ public class PersistenceSession implemen
* <p>
* Injected in constructor.
*/
- public final ObjectAdapterFactory getAdapterFactory() {
- return adapterFactory;
+ public final ObjectAdapterFactory getObjectAdapterFactory() {
+ return objectAdapterFactory;
}
/**
@@ -1184,19 +1277,19 @@ public class PersistenceSession implemen
}
/**
- * The configured {@link AdapterManager}.
+ * The configured {@link AdapterManagerSpi}.
*
* <p>
* Injected in constructor.
*/
- public final AdapterManagerExtended getAdapterManager() {
+ public final AdapterManagerSpi getAdapterManager() {
return adapterManager;
}
/**
- * The configured {@link ServicesInjector}.
+ * The configured {@link ServicesInjectorSpi}.
*/
- public ServicesInjector getServicesInjector() {
+ public ServicesInjectorSpi getServicesInjector() {
return servicesInjector;
}
@@ -1210,27 +1303,11 @@ public class PersistenceSession implemen
return objectFactory;
}
-
+
// ///////////////////////////////////////////////////////////////////////////
// Dependencies (injected)
// ///////////////////////////////////////////////////////////////////////////
- protected SpecificationLoader getSpecificationLoader() {
- return specificationLoader;
- }
-
- /**
- * Inject the {@link SpecificationLoader}.
- *
- * <p>
- * The need to inject the reflector was introduced to support the
- * HibernateObjectStore, which installs its own
- * <tt>HibernateClassStrategy</tt> to cope with the proxy classes that
- * Hibernate wraps around lists, sets and maps.
- */
- public void setSpecificationLoader(final SpecificationLoader specificationLoader) {
- this.specificationLoader = specificationLoader;
- }
/**
* Inject the {@link IsisTransactionManager}.
@@ -1238,7 +1315,7 @@ public class PersistenceSession implemen
* <p>
* This must be injected using setter-based injection rather than through
* the constructor because there is a bidirectional relationship between the
- * {@link PersistenceSessionHydrator} and the {@link IsisTransactionManager}.
+ * this class and the {@link IsisTransactionManager}.
*
* @see #getTransactionManager()
*/
@@ -1261,7 +1338,11 @@ public class PersistenceSession implemen
// Dependencies (from context)
// ///////////////////////////////////////////////////////////////////////////
- private static AuthenticationSession getAuthenticationSession() {
+ protected SpecificationLoaderSpi getSpecificationLoader() {
+ return IsisContext.getSpecificationLoader();
+ }
+
+ protected AuthenticationSession getAuthenticationSession() {
return IsisContext.getAuthenticationSession();
}
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSessionFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSessionFactory.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSessionFactory.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSessionFactory.java Thu Aug 9 23:16:27 2012
@@ -22,15 +22,15 @@ package org.apache.isis.runtimes.dflt.ru
import java.util.List;
import org.apache.isis.core.commons.components.ApplicationScopedComponent;
-import org.apache.isis.core.metamodel.spec.SpecificationLoader;
-import org.apache.isis.core.metamodel.spec.SpecificationLoaderAware;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpiAware;
import org.apache.isis.runtimes.dflt.runtime.persistence.PersistenceSessionFactoryDelegate;
import org.apache.isis.runtimes.dflt.runtime.system.DeploymentType;
/**
* @see PersistenceSessionFactoryDelegate
*/
-public interface PersistenceSessionFactory extends ApplicationScopedComponent, SpecificationLoaderAware {
+public interface PersistenceSessionFactory extends ApplicationScopedComponent {
DeploymentType getDeploymentType();
@@ -41,14 +41,6 @@ public interface PersistenceSessionFacto
*/
PersistenceSession createPersistenceSession();
- /**
- * Make available when creating {@link PersistenceSession}s.
- *
- * <p>
- * Needed for the <tt>RuntimeContextFromSession</tt>.
- */
- SpecificationLoader getSpecificationLoader();
-
// //////////////////////////////////////////////////////
// Services
// //////////////////////////////////////////////////////
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/session/IsisSessionDefault.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/session/IsisSessionDefault.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/session/IsisSessionDefault.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/session/IsisSessionDefault.java Thu Aug 9 23:16:27 2012
@@ -36,7 +36,7 @@ import org.apache.isis.core.commons.debu
import org.apache.isis.core.commons.debug.DebugString;
import org.apache.isis.core.commons.debug.DebuggableWithTitle;
import org.apache.isis.core.commons.lang.ToString;
-import org.apache.isis.core.metamodel.spec.SpecificationLoader;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
import org.apache.isis.core.runtime.imageloader.TemplateImageLoader;
import org.apache.isis.core.runtime.userprofile.UserProfile;
import org.apache.isis.runtimes.dflt.runtime.system.DeploymentType;
@@ -158,7 +158,7 @@ public class IsisSessionDefault implemen
/**
* Convenience method.
*/
- public SpecificationLoader getSpecificationLoader() {
+ public SpecificationLoaderSpi getSpecificationLoader() {
return executionContextFactory.getSpecificationLoader();
}
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/session/IsisSessionFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/session/IsisSessionFactory.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/session/IsisSessionFactory.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/session/IsisSessionFactory.java Thu Aug 9 23:16:27 2012
@@ -24,7 +24,7 @@ import java.util.List;
import org.apache.isis.core.commons.authentication.AuthenticationSession;
import org.apache.isis.core.commons.components.ApplicationScopedComponent;
import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.metamodel.spec.SpecificationLoader;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
import org.apache.isis.core.runtime.authentication.AuthenticationManager;
import org.apache.isis.core.runtime.authorization.AuthorizationManager;
import org.apache.isis.core.runtime.imageloader.TemplateImageLoader;
@@ -59,9 +59,9 @@ public interface IsisSessionFactory exte
/**
* The {@link ApplicationScopedComponent application-scoped}
- * {@link SpecificationLoader}.
+ * {@link SpecificationLoaderSpi}.
*/
- public SpecificationLoader getSpecificationLoader();
+ public SpecificationLoaderSpi getSpecificationLoader();
/**
* The {@link ApplicationScopedComponent application-scoped}
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/session/IsisSessionFactoryAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/session/IsisSessionFactoryAbstract.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/session/IsisSessionFactoryAbstract.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/session/IsisSessionFactoryAbstract.java Thu Aug 9 23:16:27 2012
@@ -30,7 +30,7 @@ import org.apache.isis.core.commons.auth
import org.apache.isis.core.commons.components.ApplicationScopedComponent;
import org.apache.isis.core.commons.config.IsisConfiguration;
import org.apache.isis.core.commons.lang.JavaClassUtils;
-import org.apache.isis.core.metamodel.spec.SpecificationLoader;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
import org.apache.isis.core.runtime.authentication.AuthenticationManager;
import org.apache.isis.core.runtime.authorization.AuthorizationManager;
import org.apache.isis.core.runtime.imageloader.TemplateImageLoader;
@@ -59,14 +59,14 @@ public abstract class IsisSessionFactory
private final DeploymentType deploymentType;
private final IsisConfiguration configuration;
private final TemplateImageLoader templateImageLoader;
- private final SpecificationLoader specificationLoader;
+ private final SpecificationLoaderSpi specificationLoaderSpi;
private final AuthenticationManager authenticationManager;
private final AuthorizationManager authorizationManager;
private final PersistenceSessionFactory persistenceSessionFactory;
private final UserProfileLoader userProfileLoader;
private final List<Object> serviceList;
- public IsisSessionFactoryAbstract(final DeploymentType deploymentType, final IsisConfiguration configuration, final SpecificationLoader specificationLoader, final TemplateImageLoader templateImageLoader, final AuthenticationManager authenticationManager,
+ public IsisSessionFactoryAbstract(final DeploymentType deploymentType, final IsisConfiguration configuration, final SpecificationLoaderSpi specificationLoader, final TemplateImageLoader templateImageLoader, final AuthenticationManager authenticationManager,
final AuthorizationManager authorizationManager, final UserProfileLoader userProfileLoader, final PersistenceSessionFactory persistenceSessionFactory, final List<Object> serviceList) {
ensureThatArg(deploymentType, is(not(nullValue())));
@@ -82,7 +82,7 @@ public abstract class IsisSessionFactory
this.deploymentType = deploymentType;
this.configuration = configuration;
this.templateImageLoader = templateImageLoader;
- this.specificationLoader = specificationLoader;
+ this.specificationLoaderSpi = specificationLoader;
this.authenticationManager = authenticationManager;
this.authorizationManager = authorizationManager;
this.userProfileLoader = userProfileLoader;
@@ -102,12 +102,12 @@ public abstract class IsisSessionFactory
public void init() {
templateImageLoader.init();
- specificationLoader.setServiceClasses(JavaClassUtils.toClasses(serviceList));
+ specificationLoaderSpi.setServiceClasses(JavaClassUtils.toClasses(serviceList));
- specificationLoader.init();
+ specificationLoaderSpi.init();
// must come after init of spec loader.
- specificationLoader.injectInto(persistenceSessionFactory);
+ specificationLoaderSpi.injectInto(persistenceSessionFactory);
persistenceSessionFactory.setServices(serviceList);
userProfileLoader.setServices(serviceList);
@@ -120,7 +120,7 @@ public abstract class IsisSessionFactory
public void shutdown() {
persistenceSessionFactory.shutdown();
authenticationManager.shutdown();
- specificationLoader.shutdown();
+ specificationLoaderSpi.shutdown();
templateImageLoader.shutdown();
userProfileLoader.shutdown();
}
@@ -153,8 +153,8 @@ public abstract class IsisSessionFactory
}
@Override
- public SpecificationLoader getSpecificationLoader() {
- return specificationLoader;
+ public SpecificationLoaderSpi getSpecificationLoader() {
+ return specificationLoaderSpi;
}
@Override
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/session/IsisSessionFactoryDefault.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/session/IsisSessionFactoryDefault.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/session/IsisSessionFactoryDefault.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/session/IsisSessionFactoryDefault.java Thu Aug 9 23:16:27 2012
@@ -22,7 +22,7 @@ package org.apache.isis.runtimes.dflt.ru
import java.util.List;
import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.metamodel.spec.SpecificationLoader;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
import org.apache.isis.core.runtime.authentication.AuthenticationManager;
import org.apache.isis.core.runtime.authorization.AuthorizationManager;
import org.apache.isis.core.runtime.imageloader.TemplateImageLoader;
@@ -36,7 +36,7 @@ import org.apache.isis.runtimes.dflt.run
*/
public class IsisSessionFactoryDefault extends IsisSessionFactoryAbstract {
- public IsisSessionFactoryDefault(final DeploymentType deploymentType, final IsisConfiguration configuration, final TemplateImageLoader templateImageLoader, final SpecificationLoader specificationLoader, final AuthenticationManager authenticationManager,
+ public IsisSessionFactoryDefault(final DeploymentType deploymentType, final IsisConfiguration configuration, final TemplateImageLoader templateImageLoader, final SpecificationLoaderSpi specificationLoader, final AuthenticationManager authenticationManager,
final AuthorizationManager authorizationManager, final UserProfileLoader userProfileLoader, final PersistenceSessionFactory persistenceSessionFactory, final List<Object> servicesList) {
super(deploymentType, configuration, specificationLoader, templateImageLoader, authenticationManager, authorizationManager, userProfileLoader, persistenceSessionFactory, servicesList);
}
Copied: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/transaction/EnlistedObjectDirtying.java (from r1371199, incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSessionTransactionManagement.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/transaction/EnlistedObjectDirtying.java?p2=incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/transaction/EnlistedObjectDirtying.java&p1=incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSessionTransactionManagement.java&r1=1371199&r2=1371529&rev=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/persistence/PersistenceSessionTransactionManagement.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/transaction/EnlistedObjectDirtying.java Thu Aug 9 23:16:27 2012
@@ -17,11 +17,10 @@
* under the License.
*/
-package org.apache.isis.runtimes.dflt.runtime.system.persistence;
+package org.apache.isis.runtimes.dflt.runtime.system.transaction;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.spec.Dirtiable;
-import org.apache.isis.runtimes.dflt.runtime.system.transaction.IsisTransactionManager;
/**
* As called by the {@link IsisTransactionManager}.
@@ -29,7 +28,7 @@ import org.apache.isis.runtimes.dflt.run
* <p>
* Dirtiable support.
*/
-public interface PersistenceSessionTransactionManagement {
+public interface EnlistedObjectDirtying {
/**
* Mark as {@link #objectChanged(ObjectAdapter) changed } all
@@ -41,6 +40,10 @@ public interface PersistenceSessionTrans
*/
void objectChangedAllDirty();
+ /**
+ * Set as {@link Dirtiable#clearDirty(ObjectAdapter) clean} any
+ * {@link Dirtiable} objects.
+ */
void clearAllDirty();
}
\ No newline at end of file
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/transaction/IsisTransaction.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/transaction/IsisTransaction.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/transaction/IsisTransaction.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/transaction/IsisTransaction.java Thu Aug 9 23:16:27 2012
@@ -37,11 +37,11 @@ import org.apache.isis.core.commons.ensu
import org.apache.isis.core.commons.lang.ToString;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.adapter.ResolveState;
-import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.ObjectStoreTransactionManagement;
import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.CreateObjectCommand;
import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.DestroyObjectCommand;
import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.PersistenceCommand;
import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.SaveObjectCommand;
+import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.TransactionalResource;
import org.apache.isis.runtimes.dflt.runtime.transaction.ObjectPersistenceException;
/**
@@ -160,7 +160,7 @@ public class IsisTransaction implements
private static final Logger LOG = Logger.getLogger(IsisTransaction.class);
- private final ObjectStoreTransactionManagement objectStore;
+ private final TransactionalResource objectStore;
private final List<PersistenceCommand> commands = Lists.newArrayList();
private final IsisTransactionManager transactionManager;
private final MessageBroker messageBroker;
@@ -171,7 +171,7 @@ public class IsisTransaction implements
private RuntimeException cause;
- public IsisTransaction(final IsisTransactionManager transactionManager, final MessageBroker messageBroker, final UpdateNotifier updateNotifier, final ObjectStoreTransactionManagement objectStore) {
+ public IsisTransaction(final IsisTransactionManager transactionManager, final MessageBroker messageBroker, final UpdateNotifier updateNotifier, final TransactionalResource objectStore) {
ensureThatArg(transactionManager, is(not(nullValue())), "transaction manager is required");
ensureThatArg(messageBroker, is(not(nullValue())), "message broker is required");
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/transaction/IsisTransactionManager.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/transaction/IsisTransactionManager.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/transaction/IsisTransactionManager.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/system/transaction/IsisTransactionManager.java Thu Aug 9 23:16:27 2012
@@ -33,10 +33,9 @@ import org.apache.log4j.Logger;
import org.apache.isis.core.commons.components.Injectable;
import org.apache.isis.core.commons.components.SessionScopedComponent;
import org.apache.isis.core.commons.debug.DebugBuilder;
-import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.ObjectStoreTransactionManagement;
import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.PersistenceCommand;
+import org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.TransactionalResource;
import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
-import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSessionTransactionManagement;
import org.apache.isis.runtimes.dflt.runtime.system.session.IsisSession;
import org.apache.isis.runtimes.dflt.runtime.transaction.IsisTransactionManagerException;
import org.apache.isis.runtimes.dflt.runtime.transaction.ObjectPersistenceException;
@@ -48,8 +47,8 @@ public class IsisTransactionManager impl
private static final Logger LOG = Logger.getLogger(IsisTransactionManager.class);
- private final PersistenceSessionTransactionManagement objectPersistor;
- private final ObjectStoreTransactionManagement objectStore;
+ private final EnlistedObjectDirtying objectPersistor;
+ private final TransactionalResource objectStore;
private int transactionLevel;
@@ -66,7 +65,7 @@ public class IsisTransactionManager impl
// constructor
// ////////////////////////////////////////////////////////////////
- public IsisTransactionManager(final PersistenceSessionTransactionManagement objectPersistor, final ObjectStoreTransactionManagement objectStore) {
+ public IsisTransactionManager(final EnlistedObjectDirtying objectPersistor, final TransactionalResource objectStore) {
this.objectPersistor = objectPersistor;
this.objectStore = objectStore;
}
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/systemusinginstallers/IsisSystemAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/systemusinginstallers/IsisSystemAbstract.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/systemusinginstallers/IsisSystemAbstract.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/systemusinginstallers/IsisSystemAbstract.java Thu Aug 9 23:16:27 2012
@@ -28,7 +28,7 @@ import org.apache.isis.core.commons.comp
import org.apache.isis.core.commons.components.Noop;
import org.apache.isis.core.commons.config.IsisConfiguration;
import org.apache.isis.core.commons.debug.DebugBuilder;
-import org.apache.isis.core.metamodel.specloader.ObjectReflector;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
import org.apache.isis.core.runtime.authentication.AuthenticationManager;
import org.apache.isis.core.runtime.authorization.AuthorizationManager;
import org.apache.isis.core.runtime.imageloader.TemplateImageLoader;
@@ -174,17 +174,15 @@ public abstract class IsisSystemAbstract
final AuthenticationManager authenticationManager = obtainAuthenticationManager(deploymentType);
final AuthorizationManager authorizationManager = obtainAuthorizationManager(deploymentType);
final TemplateImageLoader templateImageLoader = obtainTemplateImageLoader();
- final ObjectReflector reflector = obtainReflector(deploymentType);
+ final SpecificationLoaderSpi reflector = obtainSpecificationLoaderSpi(deploymentType);
final List<Object> servicesList = obtainServices();
// bind metamodel to the (runtime) framework
- // REVIEW: misplaced? seems like a side-effect...
- reflector.setRuntimeContext(new RuntimeContextFromSession());
+ RuntimeContextFromSession runtimeContext = new RuntimeContextFromSession();
+ runtimeContext.injectInto(reflector);
return new IsisSessionFactoryDefault(deploymentType, configuration, templateImageLoader, reflector, authenticationManager, authorizationManager, userProfileLoader, persistenceSessionFactory, servicesList);
}
-
-
}
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/systemusinginstallers/IsisSystemUsingInstallers.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/systemusinginstallers/IsisSystemUsingInstallers.java?rev=1371529&r1=1371528&r2=1371529&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/systemusinginstallers/IsisSystemUsingInstallers.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/systemusinginstallers/IsisSystemUsingInstallers.java Thu Aug 9 23:16:27 2012
@@ -30,7 +30,7 @@ import java.util.List;
import org.apache.log4j.Logger;
import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.metamodel.specloader.ObjectReflector;
+import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
import org.apache.isis.core.metamodel.specloader.ObjectReflectorInstaller;
import org.apache.isis.core.runtime.authentication.AuthenticationManager;
import org.apache.isis.core.runtime.authentication.AuthenticationManagerInstaller;
@@ -205,7 +205,7 @@ public class IsisSystemUsingInstallers e
}
@Override
- protected ObjectReflector obtainReflector(final DeploymentType deploymentType) throws IsisSystemException {
+ protected SpecificationLoaderSpi obtainSpecificationLoaderSpi(final DeploymentType deploymentType) throws IsisSystemException {
if (reflectorInstaller == null) {
final String fromCmdLine = getConfiguration().getString(SystemConstants.REFLECTOR_KEY);
reflectorInstaller = installerLookup.reflectorInstaller(fromCmdLine);