incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1098935 [5/20] - in /incubator/isis/trunk/runtimes/dflt: bytecode/dflt/src/main/java/org/apache/isis/runtimes/dflt/bytecode/dflt/classsubstitutor/ bytecode/dflt/src/main/java/org/apache/isis/runtimes/dflt/bytecode/dflt/objectfactory/ bytec...
Date Tue, 03 May 2011 06:22:23 GMT
Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionAbstract.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionAbstract.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionAbstract.java Tue May  3 06:22:09 2011
@@ -17,9 +17,14 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.runtime.persistence;
 
+import static org.apache.isis.core.commons.ensure.Ensure.ensureThatArg;
+import static org.apache.isis.core.commons.ensure.Ensure.ensureThatState;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -59,13 +64,6 @@ import org.apache.isis.runtimes.dflt.run
 import org.apache.isis.runtimes.dflt.runtime.system.transaction.IsisTransactionManager;
 import org.apache.log4j.Logger;
 
-import static org.apache.isis.core.commons.ensure.Ensure.ensureThatArg;
-import static org.apache.isis.core.commons.ensure.Ensure.ensureThatState;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.nullValue;
-
-
 public abstract class PersistenceSessionAbstract implements PersistenceSession {
     private static final Logger LOG = Logger.getLogger(PersistenceSessionAbstract.class);
 
@@ -87,24 +85,19 @@ public abstract class PersistenceSession
      */
     private IsisTransactionManager transactionManager;
 
-    
     private static enum State {
-        NOT_INITIALIZED,
-        OPEN,
-        CLOSED
+        NOT_INITIALIZED, OPEN, CLOSED
     }
+
     private State state;
-    
-    public PersistenceSessionAbstract(
-            final PersistenceSessionFactory persistenceSessionFactory, 
-            final ObjectAdapterFactory adapterFactory, 
-            final ObjectFactory objectFactory, 
-            final ServicesInjector servicesInjector, 
-            final OidGenerator oidGenerator, 
-            final AdapterManagerExtended identityMap) {
+
+    public PersistenceSessionAbstract(final PersistenceSessionFactory persistenceSessionFactory,
+        final ObjectAdapterFactory adapterFactory, final ObjectFactory objectFactory,
+        final ServicesInjector servicesInjector, final OidGenerator oidGenerator,
+        final AdapterManagerExtended identityMap) {
 
         ensureThatArg(persistenceSessionFactory, is(not(nullValue())), "persistence session factory required");
-        
+
         ensureThatArg(adapterFactory, is(not(nullValue())), "adapter factory required");
         ensureThatArg(objectFactory, is(not(nullValue())), "object factory required");
         ensureThatArg(servicesInjector, is(not(nullValue())), "services injector required");
@@ -113,7 +106,7 @@ public abstract class PersistenceSession
 
         // owning, application scope
         this.persistenceSessionFactory = persistenceSessionFactory;
-        
+
         // session scope
         this.adapterFactory = adapterFactory;
         this.objectFactory = objectFactory;
@@ -124,23 +117,19 @@ public abstract class PersistenceSession
         setState(State.NOT_INITIALIZED);
     }
 
-
-    
     // ///////////////////////////////////////////////////////////////////////////
     // PersistenceSessionFactory
     // ///////////////////////////////////////////////////////////////////////////
-    
+
     @Override
     public PersistenceSessionFactory getPersistenceSessionFactory() {
         return persistenceSessionFactory;
     }
 
-    
     // ///////////////////////////////////////////////////////////////////////////
     // open, close
     // ///////////////////////////////////////////////////////////////////////////
 
-
     /**
      * Injects components, calls {@link #doOpen()}, and then creates service adapters.
      * 
@@ -149,15 +138,15 @@ public abstract class PersistenceSession
     @Override
     public final void open() {
         ensureNotOpened();
-        
+
         if (LOG.isDebugEnabled()) {
             LOG.debug("opening " + this);
         }
-        
+
         // 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);
@@ -171,7 +160,7 @@ public abstract class PersistenceSession
 
         // wire dependencies into oid generator
         specificationLoader.injectInto(oidGenerator);
-        
+
         servicesInjector.open();
         adapterFactory.open();
         objectFactory.open();
@@ -180,12 +169,11 @@ public abstract class PersistenceSession
 
         doOpen();
         createServiceAdapters();
-        
+
         setState(State.OPEN);
         doOpened();
     }
 
-
     /**
      * Calls {@link #doClose()}, then closes all components.
      * 
@@ -197,54 +185,48 @@ public abstract class PersistenceSession
             // nothing to do
             return;
         }
-       
+
         if (LOG.isInfoEnabled()) {
             LOG.info("closing " + this);
         }
 
         doClose();
-        
+
         adapterManager.close();
         servicesInjector.close();
         objectFactory.close();
         adapterFactory.close();
         oidGenerator.close();
-        
+
         setState(State.CLOSED);
     }
 
-
-
     /**
-     * Optional hook method called prior to creating service adapters for subclass 
-     * to initialize its components.
+     * Optional hook method called prior to creating service adapters for subclass to initialize its components.
      */
-    protected void doOpen() {}
+    protected void doOpen() {
+    }
 
     /**
      * Optional hook method for any final processing from {@link #open()}.
      */
-    protected void doOpened() {}
-
+    protected void doOpened() {
+    }
 
     /**
      * Optional hook method to close subclass' components.
      */
-    protected void doClose() {}
-
-
-
-
-
+    protected void doClose() {
+    }
 
     /**
-     * Creates (or recreates following a {@link #testReset()}) {@link ObjectAdapter adapters}
-     * for the {@link #serviceList}.
+     * Creates (or recreates following a {@link #testReset()}) {@link ObjectAdapter adapters} for the
+     * {@link #serviceList}.
      */
     private void createServiceAdapters() {
         getTransactionManager().startTransaction();
         for (final Object service : servicesInjector.getRegisteredServices()) {
-            ObjectSpecification serviceNoSpec = specificationLoader.loadSpecification(service.getClass());
+            final ObjectSpecification serviceNoSpec = specificationLoader.loadSpecification(service.getClass());
             serviceNoSpec.markAsService();
             final String serviceId = ServiceUtil.id(service);
             final Oid existingOid = getOidForService(serviceId);
@@ -254,29 +236,29 @@ public abstract class PersistenceSession
             } else {
                 adapter = getAdapterManager().recreateRootAdapter(existingOid, service);
             }
-            
+
             if (adapter.getOid().isTransient()) {
-            	adapterManager.remapAsPersistent(adapter);
+                adapterManager.remapAsPersistent(adapter);
             }
-            
+
             if (adapter.getResolveState().canChangeTo(ResolveState.RESOLVING)) {
-            	adapter.changeState(ResolveState.RESOLVING);
-            	adapter.changeState(ResolveState.RESOLVED);
+                adapter.changeState(ResolveState.RESOLVING);
+                adapter.changeState(ResolveState.RESOLVED);
             }
             if (existingOid == null) {
                 final Oid persistentOid = adapter.getOid();
                 registerService(serviceId, persistentOid);
             }
-            
+
         }
         getTransactionManager().endTransaction();
     }
 
-    
     private State getState() {
         return state;
     }
-    private void setState(State state) {
+
+    private void setState(final State state) {
         this.state = state;
     }
 
@@ -289,13 +271,13 @@ public abstract class PersistenceSession
             throw new IllegalStateException("Persistence session has already been initialized");
         }
     }
-    
+
     protected void ensureOpen() {
         if (getState() != State.OPEN) {
             throw new IllegalStateException("Persistence session is not open");
         }
     }
-    
+
     // ///////////////////////////////////////////////////////////////////////////
     // shutdown, reset
     // ///////////////////////////////////////////////////////////////////////////
@@ -306,10 +288,6 @@ public abstract class PersistenceSession
     @Override
     public void testReset() {
     }
-    
-
-
-
 
     // ///////////////////////////////////////////////////////////////////////////
     // Factory (for transient instance)
@@ -319,27 +297,28 @@ public abstract class PersistenceSession
      * Create a root or standalone {@link ObjectAdapter adapter}.
      * 
      * <p>
-     * The returned object will be initialised (had the relevant callback lifecycle methods 
-     * invoked).
+     * The returned object will be initialised (had the relevant callback lifecycle methods invoked).
      * 
      * <p>
-     * TODO: this is the same as {@link RuntimeContextFromSession#createTransientInstance(ObjectSpecification)}; could it be unified?
+     * TODO: this is the same as {@link RuntimeContextFromSession#createTransientInstance(ObjectSpecification)}; could
+     * it be unified?
      */
     @Override
     public ObjectAdapter createInstance(final ObjectSpecification specification) {
-    	if (LOG.isDebugEnabled()) {
-    		LOG.debug("creating transient instance of " + specification);
-    	}
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("creating transient instance of " + specification);
+        }
         final Object pojo = specification.createObject(CreationMode.INITIALIZE);
         return getAdapterManager().adapterFor(pojo);
     }
 
-    public ObjectAdapter createAggregatedInstance(ObjectSpecification specification, ObjectAdapter parent) {
-    	if (LOG.isDebugEnabled()) {
-    		LOG.debug("creating aggregated instance of " + specification);
-    	}
+    @Override
+    public ObjectAdapter createAggregatedInstance(final ObjectSpecification specification, final ObjectAdapter parent) {
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("creating aggregated instance of " + specification);
+        }
         final Object pojo = specification.createAggregatedObject(parent, CreationMode.INITIALIZE);
-        ObjectAdapter adapter = getAdapterManager().adapterFor(pojo);
+        final ObjectAdapter adapter = getAdapterManager().adapterFor(pojo);
         if (adapter.getResolveState().isGhost()) {
             adapter.changeState(ResolveState.RESOLVING);
         }
@@ -348,7 +327,7 @@ public abstract class PersistenceSession
         }
         return adapter;
     }
-    
+
     @Override
     public ObjectAdapter recreateAdapter(final Oid oid, final ObjectSpecification specification) {
         final ObjectAdapter adapterLookedUpByOid = getAdapterManager().getAdapterFor(oid);
@@ -360,11 +339,10 @@ public abstract class PersistenceSession
             LOG.debug("recreating adapter for Oid: " + oid + " of type " + specification);
         }
         final Object pojo = specification.createObject(CreationMode.NO_INITIALIZE);
-        
+
         return getAdapterManager().recreateRootAdapter(oid, pojo);
     }
 
-
     @Override
     public ObjectAdapter recreateAdapter(final Oid oid, final Object pojo) {
         final ObjectAdapter adapterLookedUpByOid = getAdapterManager().getAdapterFor(oid);
@@ -384,32 +362,27 @@ public abstract class PersistenceSession
         return getAdapterManager().recreateRootAdapter(oid, pojo);
     }
 
-
-
-    
     // ///////////////////////////////////////////////////////////////////////////
     // reload
     // ///////////////////////////////////////////////////////////////////////////
 
     @Override
-    public ObjectAdapter reload(Oid oid) {
-        ObjectAdapter adapter = getAdapterManager().getAdapterFor(oid);
+    public ObjectAdapter reload(final Oid oid) {
+        final ObjectAdapter adapter = getAdapterManager().getAdapterFor(oid);
         reload(adapter);
         return adapter;
     }
-    
 
     @Override
     public abstract void reload(ObjectAdapter adapter);
-    
-    
+
     // ///////////////////////////////////////////////////////////////////////////
     // findInstances, getInstances
     // ///////////////////////////////////////////////////////////////////////////
 
     @Override
-    public <T> ObjectAdapter findInstances(Query<T> query, QueryCardinality cardinality) {
-    	final PersistenceQuery persistenceQuery = createPersistenceQueryFor(query, cardinality);
+    public <T> ObjectAdapter findInstances(final Query<T> query, final QueryCardinality cardinality) {
+        final PersistenceQuery persistenceQuery = createPersistenceQueryFor(query, cardinality);
         if (persistenceQuery == null) {
             throw new IllegalArgumentException("Unknown query type: " + query.getDescription());
         }
@@ -417,7 +390,7 @@ public abstract class PersistenceSession
     }
 
     @Override
-    public ObjectAdapter findInstances(PersistenceQuery persistenceQuery) {
+    public ObjectAdapter findInstances(final PersistenceQuery persistenceQuery) {
         final ObjectAdapter[] instances = getInstances(persistenceQuery);
         final ObjectSpecification specification = persistenceQuery.getSpecification();
         final ObjectList results = new ObjectList(specification, instances);
@@ -425,60 +398,58 @@ public abstract class PersistenceSession
     }
 
     /**
-     * Converts the {@link Query applib representation of a query} into the
-     * {@link PersistenceQuery NOF-internal representation}. 
+     * Converts the {@link Query applib representation of a query} into the {@link PersistenceQuery NOF-internal
+     * representation}.
      */
-	protected final PersistenceQuery createPersistenceQueryFor(Query<?> query, QueryCardinality cardinality) {
-		LOG.info("createPersistenceQueryFor: " + query.getDescription());
-		ObjectSpecification noSpec = specFor(query);
-	    if (query instanceof QueryFindAllInstances) {
-			return new PersistenceQueryFindAllInstances(noSpec);
-	    }
-	    if (query instanceof QueryFindByTitle) {
-			QueryFindByTitle<?> queryByTitle = (QueryFindByTitle<?>) query;
-	    	String title = queryByTitle.getTitle();
-			return new PersistenceQueryFindByTitle(noSpec, title);
-	    }
-	    if (query instanceof QueryFindByPattern) {
-			QueryFindByPattern<?> queryByPattern = (QueryFindByPattern<?>) query;
-			Object pattern = queryByPattern.getPattern();
-			ObjectAdapter patternAdapter = getAdapterManager().adapterFor(pattern);
-			return new PersistenceQueryFindByPattern(noSpec, patternAdapter);
-	    }
-	    if (query instanceof QueryDefault) {
-			QueryDefault<?> queryDefault = (QueryDefault<?>) query;
-			String queryName = queryDefault.getQueryName();
-			Map<String, ObjectAdapter> argumentsAdaptersByParameterName = wrap(queryDefault.getArgumentsByParameterName());
-			return new PersistenceQueryFindUsingApplibQueryDefault(noSpec, queryName, argumentsAdaptersByParameterName, cardinality);
-	    }
-	    // fallback; generic serializable applib query.
-	    return new PersistenceQueryFindUsingApplibQuerySerializable(noSpec, query, cardinality);
-	}
-
-	private ObjectSpecification specFor(Query<?> query) {
-		return getSpecificationLoader().loadSpecification(query.getResultType());
-	}
-
-	/**
-	 * Converts a map of pojos keyed by string to a map of adapters keyed by the
-	 * same strings.
-	 */
-	private Map<String, ObjectAdapter> wrap(
-			Map<String, Object> argumentsByParameterName) {
-		Map<String, ObjectAdapter> argumentsAdaptersByParameterName = new HashMap<String, ObjectAdapter>();
-		for (Map.Entry<String,Object> entry: argumentsByParameterName.entrySet()) {
-		    String parameterName = entry.getKey();
-			Object argument = argumentsByParameterName.get(parameterName);
-			ObjectAdapter argumentAdapter = argument != null? getAdapterManager().adapterFor(argument): null;
-			argumentsAdaptersByParameterName.put(parameterName, argumentAdapter);
-		}
-		return argumentsAdaptersByParameterName;
-	}
+    protected final PersistenceQuery createPersistenceQueryFor(final Query<?> query, final QueryCardinality cardinality) {
+        LOG.info("createPersistenceQueryFor: " + query.getDescription());
+        final ObjectSpecification noSpec = specFor(query);
+        if (query instanceof QueryFindAllInstances) {
+            return new PersistenceQueryFindAllInstances(noSpec);
+        }
+        if (query instanceof QueryFindByTitle) {
+            final QueryFindByTitle<?> queryByTitle = (QueryFindByTitle<?>) query;
+            final String title = queryByTitle.getTitle();
+            return new PersistenceQueryFindByTitle(noSpec, title);
+        }
+        if (query instanceof QueryFindByPattern) {
+            final QueryFindByPattern<?> queryByPattern = (QueryFindByPattern<?>) query;
+            final Object pattern = queryByPattern.getPattern();
+            final ObjectAdapter patternAdapter = getAdapterManager().adapterFor(pattern);
+            return new PersistenceQueryFindByPattern(noSpec, patternAdapter);
+        }
+        if (query instanceof QueryDefault) {
+            final QueryDefault<?> queryDefault = (QueryDefault<?>) query;
+            final String queryName = queryDefault.getQueryName();
+            final Map<String, ObjectAdapter> argumentsAdaptersByParameterName =
+                wrap(queryDefault.getArgumentsByParameterName());
+            return new PersistenceQueryFindUsingApplibQueryDefault(noSpec, queryName, argumentsAdaptersByParameterName,
+                cardinality);
+        }
+        // fallback; generic serializable applib query.
+        return new PersistenceQueryFindUsingApplibQuerySerializable(noSpec, query, cardinality);
+    }
 
+    private ObjectSpecification specFor(final Query<?> query) {
+        return getSpecificationLoader().loadSpecification(query.getResultType());
+    }
+
+    /**
+     * Converts a map of pojos keyed by string to a map of adapters keyed by the same strings.
+     */
+    private Map<String, ObjectAdapter> wrap(final Map<String, Object> argumentsByParameterName) {
+        final Map<String, ObjectAdapter> argumentsAdaptersByParameterName = new HashMap<String, ObjectAdapter>();
+        for (final Map.Entry<String, Object> entry : argumentsByParameterName.entrySet()) {
+            final String parameterName = entry.getKey();
+            final Object argument = argumentsByParameterName.get(parameterName);
+            final ObjectAdapter argumentAdapter = argument != null ? getAdapterManager().adapterFor(argument) : null;
+            argumentsAdaptersByParameterName.put(parameterName, argumentAdapter);
+        }
+        return argumentsAdaptersByParameterName;
+    }
 
-	protected abstract ObjectAdapter[] getInstances(final PersistenceQuery persistenceQuery);
+    protected abstract ObjectAdapter[] getInstances(final PersistenceQuery persistenceQuery);
 
-    
     // ///////////////////////////////////////////////////////////////////////////
     // Manual dirtying support
     // ///////////////////////////////////////////////////////////////////////////
@@ -498,19 +469,19 @@ public abstract class PersistenceSession
     }
 
     /**
-     * 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}. 
+     * 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}.
      */
     @Override
     public void objectChangedAllDirty() {
         if (!dirtiableSupport) {
             return;
         }
-        
+
         if (LOG.isDebugEnabled()) {
             LOG.debug("marking as changed any objects that have been manually set as dirty");
         }
-        for (final ObjectAdapter adapter: getAdapterManager()) {
+        for (final ObjectAdapter adapter : getAdapterManager()) {
             if (adapter.getSpecification().isDirty(adapter)) {
                 if (LOG.isDebugEnabled()) {
                     LOG.debug("  found dirty object " + adapter);
@@ -528,12 +499,12 @@ public abstract class PersistenceSession
     public synchronized void clearAllDirty() {
         if (!isCheckObjectsForDirtyFlag()) {
             return;
-        } 
+        }
         if (LOG.isDebugEnabled()) {
             LOG.debug("cleaning any manually dirtied objects");
         }
-        
-        for (final ObjectAdapter object: getAdapterManager()) {
+
+        for (final ObjectAdapter object : getAdapterManager()) {
             if (object.getSpecification().isDirty(object)) {
                 if (LOG.isDebugEnabled()) {
                     LOG.debug("  found dirty object " + object);
@@ -541,17 +512,16 @@ public abstract class PersistenceSession
                 object.getSpecification().clearDirty(object);
             }
         }
-        
+
     }
 
     // ///////////////////////////////////////////////////////////////////////////
     // AdaptedServiceManager
     // ///////////////////////////////////////////////////////////////////////////
 
-
     /**
-     * Returns the OID for the adapted service. This allows a service object to be given the same OID that it
-     * had when it was created in a different session.
+     * Returns the OID for the adapted service. This allows a service object to be given the same OID that it had when
+     * it was created in a different session.
      */
     protected abstract Oid getOidForService(String name);
 
@@ -572,12 +542,12 @@ public abstract class PersistenceSession
         return null;
     }
 
-    // REVIEW why does this get called multiple times when starting up 
+    // REVIEW why does this get called multiple times when starting up
     @Override
     public List<ObjectAdapter> getServices() {
-        List<Object> services = servicesInjector.getRegisteredServices();
-        List<ObjectAdapter> serviceAdapters = new ArrayList<ObjectAdapter>();
-        for (Object service : services) {
+        final List<Object> services = servicesInjector.getRegisteredServices();
+        final List<ObjectAdapter> serviceAdapters = new ArrayList<ObjectAdapter>();
+        for (final Object service : services) {
             serviceAdapters.add(getService(service));
         }
         return serviceAdapters;
@@ -604,36 +574,32 @@ public abstract class PersistenceSession
         return adapter;
     }
 
-
     // ////////////////////////////////////////////////////////////////////
     // Helpers
     // ////////////////////////////////////////////////////////////////////
-    
-	protected boolean isImmutable(final ObjectAdapter adapter) {
-		final ObjectSpecification noSpec = adapter.getSpecification();
-		return ImmutableFacetUtils.isAlwaysImmutable(noSpec) || 
-			(ImmutableFacetUtils.isImmutableOncePersisted(noSpec) && 
-			 adapter.isPersistent());
-	}
 
+    protected boolean isImmutable(final ObjectAdapter adapter) {
+        final ObjectSpecification noSpec = adapter.getSpecification();
+        return ImmutableFacetUtils.isAlwaysImmutable(noSpec)
+            || (ImmutableFacetUtils.isImmutableOncePersisted(noSpec) && adapter.isPersistent());
+    }
 
     // ////////////////////////////////////////////////////////////////////
     // injectInto
     // ////////////////////////////////////////////////////////////////////
 
     @Override
-    public void injectInto(Object candidate) {
+    public void injectInto(final Object candidate) {
         if (PersistenceSessionAware.class.isAssignableFrom(candidate.getClass())) {
-            PersistenceSessionAware cast = PersistenceSessionAware.class.cast(candidate);
+            final PersistenceSessionAware cast = PersistenceSessionAware.class.cast(candidate);
             cast.setPersistenceSession(this);
         }
         if (PersistenceSessionHydratorAware.class.isAssignableFrom(candidate.getClass())) {
-            PersistenceSessionHydratorAware cast = PersistenceSessionHydratorAware.class.cast(candidate);
+            final PersistenceSessionHydratorAware cast = PersistenceSessionHydratorAware.class.cast(candidate);
             cast.setHydrator(this);
         }
     }
 
-    
     // ///////////////////////////////////////////////////////////////////////////
     // Debugging
     // ///////////////////////////////////////////////////////////////////////////
@@ -657,15 +623,14 @@ public abstract class PersistenceSession
         for (final Object service : servicesInjector.getRegisteredServices()) {
             final String id = ServiceUtil.id(service);
             final String serviceClassName = service.getClass().getName();
-            Oid oidForService = getOidForService(id);
-            String serviceId = id + (id.equals(serviceClassName) ? "" : " (" + serviceClassName + ")");
-            debug.appendln(oidForService != null? oidForService.toString(): "[NULL]", serviceId);
+            final Oid oidForService = getOidForService(id);
+            final String serviceId = id + (id.equals(serviceClassName) ? "" : " (" + serviceClassName + ")");
+            debug.appendln(oidForService != null ? oidForService.toString() : "[NULL]", serviceId);
         }
         debug.appendln();
 
     }
 
-
     // ///////////////////////////////////////////////////////////////////////////
     // Dependencies (injected in constructor, possibly implicitly)
     // ///////////////////////////////////////////////////////////////////////////
@@ -677,7 +642,7 @@ public abstract class PersistenceSession
     public final ObjectAdapterFactory getAdapterFactory() {
         return adapterFactory;
     }
-    
+
     /**
      * Injected in constructor.
      */
@@ -694,9 +659,8 @@ public abstract class PersistenceSession
         return adapterManager;
     }
 
-
     /**
-     * The {@link ServicesInjector}. 
+     * The {@link ServicesInjector}.
      */
     @Override
     public ServicesInjector getServicesInjector() {
@@ -711,7 +675,6 @@ public abstract class PersistenceSession
         return objectFactory;
     }
 
-
     // ///////////////////////////////////////////////////////////////////////////
     // Dependencies (injected)
     // ///////////////////////////////////////////////////////////////////////////
@@ -720,7 +683,6 @@ public abstract class PersistenceSession
         return specificationLoader;
     }
 
-    
     /**
      * Injects the {@link SpecificationLoader}
      */
@@ -729,9 +691,6 @@ public abstract class PersistenceSession
         this.specificationLoader = specificationLoader;
     }
 
-
-
-
     @Override
     public void setTransactionManager(final IsisTransactionManager transactionManager) {
         this.transactionManager = transactionManager;
@@ -742,6 +701,4 @@ public abstract class PersistenceSession
         return transactionManager;
     }
 
-
-
 }

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionAware.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionAware.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionAware.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionAware.java Tue May  3 06:22:09 2011
@@ -17,13 +17,11 @@
  *  under the License.
  */
 
-
-package org.apache.isis.runtimes.dflt.runtime.persistence;
+package org.apache.isis.runtimes.dflt.runtime.persistence;
 
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
-
-
-public interface PersistenceSessionAware {
-
-    void setPersistenceSession(PersistenceSession persistenceSession);
-}
+
+public interface PersistenceSessionAware {
+
+    void setPersistenceSession(PersistenceSession persistenceSession);
+}

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionFactoryDelegate.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionFactoryDelegate.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionFactoryDelegate.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionFactoryDelegate.java Tue May  3 06:22:09 2011
@@ -17,26 +17,21 @@
  *  under the License.
  */
 
-
-package org.apache.isis.runtimes.dflt.runtime.persistence;
+package org.apache.isis.runtimes.dflt.runtime.persistence;
 
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSessionFactory;
-
-
-/**
- * Creates a {@link PersistenceSession} on behalf of a {@link PersistenceSessionFactory}.
- */
-public interface PersistenceSessionFactoryDelegate {
-
-    
-    /**
-     * As per {@link PersistenceSessionFactory#createPersistenceSession()}, but
-     * passing a {@link PersistenceSessionFactory} to act as the {@link PersistenceSession}'s
-     * {@link PersistenceSession#getPersistenceSessionFactory() owning factory}.
-     */
-    PersistenceSession createPersistenceSession(PersistenceSessionFactory persistenceSessionFactory);
-
-}
-
-
+
+/**
+ * Creates a {@link PersistenceSession} on behalf of a {@link PersistenceSessionFactory}.
+ */
+public interface PersistenceSessionFactoryDelegate {
+
+    /**
+     * As per {@link PersistenceSessionFactory#createPersistenceSession()}, but passing a
+     * {@link PersistenceSessionFactory} to act as the {@link PersistenceSession}'s
+     * {@link PersistenceSession#getPersistenceSessionFactory() owning factory}.
+     */
+    PersistenceSession createPersistenceSession(PersistenceSessionFactory persistenceSessionFactory);
+
+}

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionFactoryDelegating.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionFactoryDelegating.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionFactoryDelegating.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionFactoryDelegating.java Tue May  3 06:22:09 2011
@@ -17,128 +17,130 @@
  *  under the License.
  */
 
+package org.apache.isis.runtimes.dflt.runtime.persistence;
 
-package org.apache.isis.runtimes.dflt.runtime.persistence;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.notNullValue;
 import static org.apache.isis.core.commons.ensure.Ensure.ensureThatState;
-
-import java.util.List;
-
-import org.apache.isis.applib.clock.Clock;
-import org.apache.isis.applib.fixtures.FixtureClock;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.notNullValue;
+
+import java.util.List;
+
+import org.apache.isis.applib.clock.Clock;
+import org.apache.isis.applib.fixtures.FixtureClock;
 import org.apache.isis.core.metamodel.spec.SpecificationLoader;
 import org.apache.isis.runtimes.dflt.runtime.system.DeploymentType;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSessionFactory;
-
-
-/**
- * Implementation that just delegates to a supplied {@link PersistenceSessionFactory}.
- */
-public abstract class PersistenceSessionFactoryDelegating implements PersistenceSessionFactory, FixturesInstalledFlag {
-
-    private final DeploymentType deploymentType;
-    private final PersistenceSessionFactoryDelegate persistenceSessionFactoryDelegate;
-    private SpecificationLoader specificationLoader;
-    private List<Object> serviceList;
-
-    private Boolean fixturesInstalled;
-
-	public PersistenceSessionFactoryDelegating(
-            final DeploymentType deploymentType,
-            final PersistenceSessionFactoryDelegate persistenceSessionFactoryDelegate) {
-        this.deploymentType = deploymentType;
-        this.persistenceSessionFactoryDelegate = persistenceSessionFactoryDelegate;
-    }
-
-    public DeploymentType getDeploymentType() {
-        return deploymentType;
-    }
-
-    public PersistenceSessionFactoryDelegate getDelegate() {
-        return persistenceSessionFactoryDelegate;
-    }
-
-    public PersistenceSession createPersistenceSession() {
-        return persistenceSessionFactoryDelegate.createPersistenceSession(this);
-    }
-
-
-    public final void init() {
-    	// check prereq dependencies injected
-    	ensureThatState(specificationLoader, is(notNullValue()));
-    	ensureThatState(serviceList, is(notNullValue()));
-    	
-        
-        // a bit of a workaround, but required if anything in the metamodel (for example, a
-        // ValueSemanticsProvider for a date value type) needs to use the Clock singleton
-        // we do this after loading the services to allow a service to prime a different clock
-        // implementation (eg to use an NTP time service).
-        if (!deploymentType.isProduction() && !Clock.isInitialized()) {
-        	FixtureClock.initialize();
-        }
-
-        doInit();
-    }
-
-    /**
-     * Optional hook method for implementation-specific initialization.
-     */
-    protected void doInit() {}
-
-    public final void shutdown() {
-        doShutdown();
-        // other
-    }
-
-    /**
-     * Optional hook method for implementation-specific shutdown.
-     */
-    protected void doShutdown() {}
-
-
-    ////////////////////////////////////////////////////////
-    // FixturesInstalledFlag impl
-    ////////////////////////////////////////////////////////
-
-    public Boolean isFixturesInstalled() {
-		return fixturesInstalled;
-	}
-	public void setFixturesInstalled(Boolean fixturesInstalled) {
-		this.fixturesInstalled = fixturesInstalled;
-	}
-
-    
-    ////////////////////////////////////////////////////////
-    // Dependencies (injected via setters)
-    ////////////////////////////////////////////////////////
-
-    public List<Object> getServices() {
-        return serviceList;
-    }
-
-    public void setServices(List<Object> serviceList) {
-    	this.serviceList = serviceList;
-    }
-
-    /**
-     * @see #setSpecificationLoader(SpecificationLoader)
-     */
-    public SpecificationLoader getSpecificationLoader() {
-        return specificationLoader;
-    }
-
-    /**
-     * Injected prior to {@link #init()}.
-     */
-    public void setSpecificationLoader(SpecificationLoader specificationLoader) {
-        this.specificationLoader = specificationLoader;
-    }
-
-    
-    
-
-}
-
+
+/**
+ * Implementation that just delegates to a supplied {@link PersistenceSessionFactory}.
+ */
+public abstract class PersistenceSessionFactoryDelegating implements PersistenceSessionFactory, FixturesInstalledFlag {
+
+    private final DeploymentType deploymentType;
+    private final PersistenceSessionFactoryDelegate persistenceSessionFactoryDelegate;
+    private SpecificationLoader specificationLoader;
+    private List<Object> serviceList;
+
+    private Boolean fixturesInstalled;
+
+    public PersistenceSessionFactoryDelegating(final DeploymentType deploymentType,
+        final PersistenceSessionFactoryDelegate persistenceSessionFactoryDelegate) {
+        this.deploymentType = deploymentType;
+        this.persistenceSessionFactoryDelegate = persistenceSessionFactoryDelegate;
+    }
+
+    @Override
+    public DeploymentType getDeploymentType() {
+        return deploymentType;
+    }
+
+    public PersistenceSessionFactoryDelegate getDelegate() {
+        return persistenceSessionFactoryDelegate;
+    }
+
+    @Override
+    public PersistenceSession createPersistenceSession() {
+        return persistenceSessionFactoryDelegate.createPersistenceSession(this);
+    }
+
+    @Override
+    public final void init() {
+        // check prereq dependencies injected
+        ensureThatState(specificationLoader, is(notNullValue()));
+        ensureThatState(serviceList, is(notNullValue()));
+
+        // a bit of a workaround, but required if anything in the metamodel (for example, a
+        // ValueSemanticsProvider for a date value type) needs to use the Clock singleton
+        // we do this after loading the services to allow a service to prime a different clock
+        // implementation (eg to use an NTP time service).
+        if (!deploymentType.isProduction() && !Clock.isInitialized()) {
+            FixtureClock.initialize();
+        }
+
+        doInit();
+    }
+
+    /**
+     * Optional hook method for implementation-specific initialization.
+     */
+    protected void doInit() {
+    }
+
+    @Override
+    public final void shutdown() {
+        doShutdown();
+        // other
+    }
+
+    /**
+     * Optional hook method for implementation-specific shutdown.
+     */
+    protected void doShutdown() {
+    }
+
+    // //////////////////////////////////////////////////////
+    // FixturesInstalledFlag impl
+    // //////////////////////////////////////////////////////
+
+    @Override
+    public Boolean isFixturesInstalled() {
+        return fixturesInstalled;
+    }
+
+    @Override
+    public void setFixturesInstalled(final Boolean fixturesInstalled) {
+        this.fixturesInstalled = fixturesInstalled;
+    }
+
+    // //////////////////////////////////////////////////////
+    // Dependencies (injected via setters)
+    // //////////////////////////////////////////////////////
+
+    @Override
+    public List<Object> getServices() {
+        return serviceList;
+    }
+
+    @Override
+    public void setServices(final List<Object> serviceList) {
+        this.serviceList = serviceList;
+    }
+
+    /**
+     * @see #setSpecificationLoader(SpecificationLoader)
+     */
+    @Override
+    public SpecificationLoader getSpecificationLoader() {
+        return specificationLoader;
+    }
+
+    /**
+     * Injected prior to {@link #init()}.
+     */
+    @Override
+    public void setSpecificationLoader(final SpecificationLoader specificationLoader) {
+        this.specificationLoader = specificationLoader;
+    }
+
+}

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionHydratorAware.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionHydratorAware.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionHydratorAware.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionHydratorAware.java Tue May  3 06:22:09 2011
@@ -17,12 +17,10 @@
  *  under the License.
  */
 
-
-package org.apache.isis.runtimes.dflt.runtime.persistence;
+package org.apache.isis.runtimes.dflt.runtime.persistence;
 
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSessionHydrator;
-
-public interface PersistenceSessionHydratorAware {
-    void setHydrator(PersistenceSessionHydrator hydrator);
-}
-
+
+public interface PersistenceSessionHydratorAware {
+    void setHydrator(PersistenceSessionHydrator hydrator);
+}

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionLogger.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionLogger.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionLogger.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistenceSessionLogger.java Tue May  3 06:22:09 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.runtime.persistence;
 
 import java.util.List;
@@ -42,9 +41,8 @@ import org.apache.isis.runtimes.dflt.run
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSessionFactory;
 import org.apache.isis.runtimes.dflt.runtime.system.transaction.IsisTransactionManager;
 
-
 public class PersistenceSessionLogger extends Logger implements PersistenceSession, DebuggableWithTitle {
-    
+
     private final PersistenceSession underlying;
 
     public PersistenceSessionLogger(final PersistenceSession decorated, final String level) {
@@ -56,26 +54,31 @@ public class PersistenceSessionLogger ex
         this.underlying = decorated;
     }
 
+    @Override
     public void destroyObject(final ObjectAdapter object) {
         log("destroy " + object.getObject());
         underlying.destroyObject(object);
     }
 
-    public ObjectAdapter findInstances(Query query, QueryCardinality cardinality) throws UnsupportedFindException {
+    @Override
+    public ObjectAdapter findInstances(final Query query, final QueryCardinality cardinality)
+        throws UnsupportedFindException {
         log("find instances matching " + query.getDescription());
         return underlying.findInstances(query, cardinality);
     }
 
+    @Override
+    public ObjectAdapter findInstances(final PersistenceQuery criteria) {
+        log("find instances matching " + criteria.getSpecification());
+        return underlying.findInstances(criteria);
+    }
 
-	public ObjectAdapter findInstances(PersistenceQuery criteria) {
-		log("find instances matching " + criteria.getSpecification());
-		return underlying.findInstances(criteria);
-	}
-
+    @Override
     public void debugData(final DebugBuilder debug) {
         underlying.debugData(debug);
     }
 
+    @Override
     public String debugTitle() {
         return underlying.debugTitle();
     }
@@ -85,148 +88,174 @@ public class PersistenceSessionLogger ex
         return underlying.getClass();
     }
 
+    @Override
     public ObjectAdapter loadObject(final Oid oid, final ObjectSpecification hint) throws ObjectNotFoundException {
         final ObjectAdapter object = underlying.loadObject(oid, hint);
         log("get object for " + oid + " (of type " + hint.getShortIdentifier() + ")", object.getObject());
         return object;
     }
 
+    @Override
     public boolean hasInstances(final ObjectSpecification specification) {
         final boolean hasInstances = underlying.hasInstances(specification);
         log("has instances of " + specification.getShortIdentifier(), "" + hasInstances);
         return hasInstances;
     }
 
+    @Override
     public boolean isFixturesInstalled() {
         final boolean isInitialized = underlying.isFixturesInstalled();
         log("is initialized: " + isInitialized);
         return isInitialized;
     }
 
-
+    @Override
     public void open() {
         log("opening " + underlying);
         underlying.open();
     }
 
+    @Override
     public void close() {
         log("closing " + underlying);
         underlying.close();
     }
 
+    @Override
     public void makePersistent(final ObjectAdapter object) {
         log("make object graph persistent: " + object);
         underlying.makePersistent(object);
     }
 
+    @Override
     public void objectChanged(final ObjectAdapter object) {
         log("notify of change " + object);
         underlying.objectChanged(object);
     }
 
+    @Override
     public void reload(final ObjectAdapter object) {
         underlying.reload(object);
         log("reload: " + object);
     }
 
+    @Override
     public void testReset() {
         log("reset object manager");
         underlying.testReset();
     }
 
+    @Override
     public void resolveImmediately(final ObjectAdapter object) {
         underlying.resolveImmediately(object);
         log("resolve immediately: " + object);
     }
 
+    @Override
     public void resolveField(final ObjectAdapter object, final ObjectAssociation field) {
         log("resolve eagerly (object in a field) " + field + " of " + object);
         underlying.resolveField(object, field);
     }
 
+    @Override
     public void objectChangedAllDirty() {
         log("saving changes");
         underlying.objectChangedAllDirty();
     }
 
-
+    @Override
     public ObjectAdapter getService(final String id) {
         log("get service " + id);
         return underlying.getService(id);
     }
 
+    @Override
     public List<ObjectAdapter> getServices() {
         log("get services ");
         return underlying.getServices();
     }
 
-
+    @Override
     public ObjectAdapter createInstance(final ObjectSpecification specification) {
         log("create instance " + specification);
         return underlying.createInstance(specification);
     }
 
-    public ObjectAdapter createAggregatedInstance(ObjectSpecification specification, ObjectAdapter parent) {
+    @Override
+    public ObjectAdapter createAggregatedInstance(final ObjectSpecification specification, final ObjectAdapter parent) {
         log("create aggregated instance " + specification + " as part of " + parent);
         return underlying.createAggregatedInstance(specification, parent);
     }
 
+    @Override
     public ObjectAdapter recreateAdapter(final Oid oid, final ObjectSpecification specification) {
         log("recreate instance " + oid + " " + specification);
         return underlying.recreateAdapter(oid, specification);
     }
 
+    @Override
     public void setSpecificationLoader(final SpecificationLoader specificationLoader) {
         underlying.setSpecificationLoader(specificationLoader);
     }
 
+    @Override
     public OidGenerator getOidGenerator() {
         return underlying.getOidGenerator();
     }
 
+    @Override
     public ObjectAdapterFactory getAdapterFactory() {
         return underlying.getAdapterFactory();
     }
 
+    @Override
     public PersistenceSessionFactory getPersistenceSessionFactory() {
         return underlying.getPersistenceSessionFactory();
     }
 
+    @Override
     public ServicesInjector getServicesInjector() {
         return underlying.getServicesInjector();
     }
 
+    @Override
     public IsisTransactionManager getTransactionManager() {
         return underlying.getTransactionManager();
     }
 
-    public void setTransactionManager(IsisTransactionManager transactionManager) {
+    @Override
+    public void setTransactionManager(final IsisTransactionManager transactionManager) {
         underlying.setTransactionManager(transactionManager);
     }
 
-	public ObjectFactory getObjectFactory() {
-		return underlying.getObjectFactory();
-	}
+    @Override
+    public ObjectFactory getObjectFactory() {
+        return underlying.getObjectFactory();
+    }
 
+    @Override
     public void clearAllDirty() {
         underlying.clearAllDirty();
     }
 
-    public ObjectAdapter reload(Oid oid) {
+    @Override
+    public ObjectAdapter reload(final Oid oid) {
         return underlying.reload(oid);
     }
 
+    @Override
     public AdapterManager getAdapterManager() {
         return underlying.getAdapterManager();
     }
 
-    public ObjectAdapter recreateAdapter(Oid oid, Object pojo) {
+    @Override
+    public ObjectAdapter recreateAdapter(final Oid oid, final Object pojo) {
         return underlying.recreateAdapter(oid, pojo);
     }
 
-    public void injectInto(Object candidate) {
+    @Override
+    public void injectInto(final Object candidate) {
         underlying.injectInto(candidate);
     }
 
-
 }

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistorUtil.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistorUtil.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistorUtil.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/PersistorUtil.java Tue May  3 06:22:09 2011
@@ -17,45 +17,42 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.runtime.persistence;
 
-import org.apache.log4j.Logger;
 import org.apache.isis.core.commons.ensure.Assert;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.ResolveState;
-
+import org.apache.log4j.Logger;
 
 public class PersistorUtil {
 
     private static final Logger LOG = Logger.getLogger(PersistorUtil.class);
 
-    private PersistorUtil() {}
-
+    private PersistorUtil() {
+    }
 
     // //////////////////////////////////////////////////////////////////
     // update resolve state
     // //////////////////////////////////////////////////////////////////
 
     public static void start(final ObjectAdapter object, final ResolveState state) {
-    	if (LOG.isTraceEnabled()) {
-    		LOG.trace("start " + object + " as " + state.name());
-    	}
+        if (LOG.isTraceEnabled()) {
+            LOG.trace("start " + object + " as " + state.name());
+        }
         object.changeState(state);
     }
 
     /**
-     * Marks the specified object as loaded: resolved, partly resolve or updated as specified by the second
-     * parameter. Attempting to specify any other state throws a run time exception.
+     * Marks the specified object as loaded: resolved, partly resolve or updated as specified by the second parameter.
+     * Attempting to specify any other state throws a run time exception.
      */
     public static void end(final ObjectAdapter object) {
         final ResolveState endState = object.getResolveState().getEndState();
         Assert.assertNotNull("end state required", endState);
         if (LOG.isTraceEnabled()) {
-        	LOG.trace("end " + object + " as " + endState.name());
+            LOG.trace("end " + object + " as " + endState.name());
         }
         object.changeState(endState);
     }
 
 }
-

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/UnsupportedFindException.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/UnsupportedFindException.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/UnsupportedFindException.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/UnsupportedFindException.java Tue May  3 06:22:09 2011
@@ -17,12 +17,10 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.runtime.persistence;
 
 import org.apache.isis.core.commons.exceptions.IsisException;
 
-
 public class UnsupportedFindException extends IsisException {
     private static final long serialVersionUID = 1L;
 

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/AdapterFactoryAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/AdapterFactoryAbstract.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/AdapterFactoryAbstract.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/AdapterFactoryAbstract.java Tue May  3 06:22:09 2011
@@ -17,37 +17,40 @@
  *  under the License.
  */
 
+package org.apache.isis.runtimes.dflt.runtime.persistence.adapterfactory;
 
-package org.apache.isis.runtimes.dflt.runtime.persistence.adapterfactory;
-
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapterFactory;
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
-
-public abstract class AdapterFactoryAbstract implements ObjectAdapterFactory {
-
-    public abstract ObjectAdapter createAdapter(Object pojo, Oid oid);
-
-    /**
-     * Default implementation does nothing.
-     */
-    public void open() {}
-
-    /**
-     * Default implementation does nothing.
-     */
-    public void close() {}
-    
-    /**
-     * Injects.
-     */
-    public void injectInto(Object candidate) {
-        if (AdapterFactoryAware.class.isAssignableFrom(candidate.getClass())) {
-            AdapterFactoryAware cast = AdapterFactoryAware.class.cast(candidate);
-            cast.setAdapterFactory(this);
-        }
-    }
-
-}
-
-
+
+public abstract class AdapterFactoryAbstract implements ObjectAdapterFactory {
+
+    @Override
+    public abstract ObjectAdapter createAdapter(Object pojo, Oid oid);
+
+    /**
+     * Default implementation does nothing.
+     */
+    @Override
+    public void open() {
+    }
+
+    /**
+     * Default implementation does nothing.
+     */
+    @Override
+    public void close() {
+    }
+
+    /**
+     * Injects.
+     */
+    @Override
+    public void injectInto(final Object candidate) {
+        if (AdapterFactoryAware.class.isAssignableFrom(candidate.getClass())) {
+            final AdapterFactoryAware cast = AdapterFactoryAware.class.cast(candidate);
+            cast.setAdapterFactory(this);
+        }
+    }
+
+}

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/AdapterFactoryAware.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/AdapterFactoryAware.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/AdapterFactoryAware.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/AdapterFactoryAware.java Tue May  3 06:22:09 2011
@@ -17,14 +17,11 @@
  *  under the License.
  */
 
-
-package org.apache.isis.runtimes.dflt.runtime.persistence.adapterfactory;
+package org.apache.isis.runtimes.dflt.runtime.persistence.adapterfactory;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapterFactory;
-
-public interface AdapterFactoryAware {
-
-    void setAdapterFactory(ObjectAdapterFactory adapterFactory);
-}
-
-
+
+public interface AdapterFactoryAware {
+
+    void setAdapterFactory(ObjectAdapterFactory adapterFactory);
+}

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/AdapterFactoryInstaller.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/AdapterFactoryInstaller.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/AdapterFactoryInstaller.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/AdapterFactoryInstaller.java Tue May  3 06:22:09 2011
@@ -17,17 +17,14 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.runtime.persistence.adapterfactory;
 
 import org.apache.isis.core.commons.components.Installer;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapterFactory;
 
-
 public interface AdapterFactoryInstaller extends Installer {
 
-	static String TYPE = "adapter-factory";
+    static String TYPE = "adapter-factory";
 
     ObjectAdapterFactory createAdapterFactory();
 }
-

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapter.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapter.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapter.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapter.java Tue May  3 06:22:09 2011
@@ -17,14 +17,11 @@
  *  under the License.
  */
 
-
 package org.apache.isis.runtimes.dflt.runtime.persistence.adapterfactory.pojo;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.notNullValue;
 
-import org.apache.log4j.Logger;
-
 import org.apache.isis.applib.adapters.Localization;
 import org.apache.isis.core.commons.ensure.Assert;
 import org.apache.isis.core.commons.ensure.Ensure;
@@ -46,30 +43,28 @@ import org.apache.isis.runtimes.dflt.run
 import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.AdapterManager;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
-
-
-
+import org.apache.log4j.Logger;
 
 public class PojoAdapter extends InstanceAbstract implements ObjectAdapter {
-    
+
     private final static Logger LOG = Logger.getLogger(PojoAdapter.class);
-    
+
     private static final int INCOMPLETE_COLLECTION = -1;
-    
+
     private Object pojo;
-    
+
     private transient ResolveState resolveState;
-    
+
     private Oid oid;
     private Version version;
-    
+
     private String defaultTitle;
 
     private ElementSpecificationProvider elementSpecificationProvider;
 
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
     // Constructor, finalizer
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
 
     public PojoAdapter(final Object pojo, final Oid oid) {
         if (pojo instanceof ObjectAdapter) {
@@ -84,28 +79,28 @@ public class PojoAdapter extends Instanc
     protected void finalize() throws Throwable {
         super.finalize();
         if (LOG.isDebugEnabled()) {
-        	
-        	// be careful not to touch the pojo
-        	// this method is called by the FinalizerThread so could be called at any time.
-        	// for Hibernate-based object stores (and similar), it may no longer be valid to
-        	// touch the pojo (although arguably, closing the session should detach these pojos)
-
-        	// we also mustn't touch the adapter's specification.  That's because the loading
-        	// of specifications isn't threadsafe, due to the way in which we put non-introspected
-        	// specifications into the SpecificationCache to prevent infinite loops. 
-        	
-        	// better safe than sorry, though
-        	// LOG.debug("finalizing pojo, oid: " + getOid());
+
+            // be careful not to touch the pojo
+            // this method is called by the FinalizerThread so could be called at any time.
+            // for Hibernate-based object stores (and similar), it may no longer be valid to
+            // touch the pojo (although arguably, closing the session should detach these pojos)
+
+            // we also mustn't touch the adapter's specification. That's because the loading
+            // of specifications isn't threadsafe, due to the way in which we put non-introspected
+            // specifications into the SpecificationCache to prevent infinite loops.
+
+            // better safe than sorry, though
+            // LOG.debug("finalizing pojo, oid: " + getOid());
         }
     }
 
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
     // Specification
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
 
     @Override
     protected ObjectSpecification loadSpecification() {
-        ObjectSpecification specification = getReflector().loadSpecification(getObject().getClass());
+        final ObjectSpecification specification = getReflector().loadSpecification(getObject().getClass());
         this.defaultTitle = "A" + (" " + specification.getSingularName()).toLowerCase();
         return specification;
     }
@@ -115,49 +110,46 @@ public class PojoAdapter extends Instanc
      */
     @Override
     public final ObjectSpecification getSpecification() {
-    	ObjectSpecification specification = (ObjectSpecification) super.getSpecification();
-		return specification;
+        final ObjectSpecification specification = (ObjectSpecification) super.getSpecification();
+        return specification;
     }
 
-
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
     // Object, replacePojo
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
 
     @Override
     public Object getObject() {
         return pojo;
     }
-    
+
     /**
-     * Sometimes it is necessary to manage the replacement of the underlying domain object (by another
-     * component such as an object store). This method allows the adapter to be kept while the domain object
-     * is replaced.
+     * Sometimes it is necessary to manage the replacement of the underlying domain object (by another component such as
+     * an object store). This method allows the adapter to be kept while the domain object is replaced.
      */
     @Override
     public void replacePojo(final Object pojo) {
         this.pojo = pojo;
     }
 
-    
-
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
     // ResolveState, changeState
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
 
     @Override
     public ResolveState getResolveState() {
         return resolveState;
     }
 
-
     @Override
     public void changeState(final ResolveState newState) {
-        
-        boolean validToChangeTo = resolveState.isValidToChangeTo(newState);
+
+        final boolean validToChangeTo = resolveState.isValidToChangeTo(newState);
         // don't call toString() since that could hit titleString() and we might be
         // in the process of transitioning to ghost
-        Assert.assertTrue("oid= " + this.getOid() + "; can't change from " + resolveState.name() + " to " + newState.name(), validToChangeTo);
+        Assert.assertTrue(
+            "oid= " + this.getOid() + "; can't change from " + resolveState.name() + " to " + newState.name(),
+            validToChangeTo);
 
         if (LOG.isTraceEnabled()) {
             String oidString;
@@ -176,10 +168,9 @@ public class PojoAdapter extends Instanc
         return isTransient() || this.getResolveState().isResolved();
     }
 
-
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
     // isPersistent, isTransient
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
 
     /**
      * Just delegates to {@link #getResolveState() resolve state}.
@@ -187,10 +178,10 @@ public class PojoAdapter extends Instanc
      * @see ResolveState#isPersistent()
      * @see #isTransient()
      */
-	@Override
+    @Override
     public boolean isPersistent() {
-		return getResolveState().isPersistent();
-	}
+        return getResolveState().isPersistent();
+    }
 
     /**
      * Just delegates to {@link #getResolveState() resolve state}.
@@ -198,16 +189,14 @@ public class PojoAdapter extends Instanc
      * @see ResolveState#isTransient()
      * @see #isPersistent()
      */
-	@Override
+    @Override
     public boolean isTransient() {
-		return getResolveState().isTransient();
-	}
-
-
+        return getResolveState().isTransient();
+    }
 
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
     // Oid
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
 
     @Override
     public Oid getOid() {
@@ -224,10 +213,9 @@ public class PojoAdapter extends Instanc
         return getOid() instanceof AggregatedOid;
     }
 
-
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
     // Version
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
 
     @Override
     public Version getVersion() {
@@ -253,19 +241,17 @@ public class PojoAdapter extends Instanc
         return this.version == null || version == null || version.different(this.version);
     }
 
-
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
     // Title, toString
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
 
     /**
      * Returns the title from the underlying business object.
      * 
      * <p>
-     * If the object has not yet been resolved the specification will be asked for a unresolved title, 
-     * which could of been persisted by the persistence mechanism. If either of the above provides null 
-     * as the title then this method will return a title relating to the name of the object type, 
-     * e.g. "A Customer", "A Product".
+     * If the object has not yet been resolved the specification will be asked for a unresolved title, which could of
+     * been persisted by the persistence mechanism. If either of the above provides null as the title then this method
+     * will return a title relating to the name of the object type, e.g. "A Customer", "A Product".
      */
     @Override
     public String titleString() {
@@ -286,7 +272,7 @@ public class PojoAdapter extends Instanc
                 return (String) getObject();
             }
             final ObjectSpecification specification = getSpecification();
-            Localization localization = IsisContext.getLocalization();
+            final Localization localization = IsisContext.getLocalization();
             String title = specification.getTitle(this, localization);
             if (title == null) {
                 if (resolveState.isGhost()) {
@@ -300,7 +286,7 @@ public class PojoAdapter extends Instanc
                 title = getDefaultTitle();
             }
             return title;
-            }
+        }
     }
 
     private String collectionTitleString(final CollectionFacet facet) {
@@ -308,25 +294,25 @@ public class PojoAdapter extends Instanc
         final ObjectSpecification elementSpecification = getElementSpecification();
         if (elementSpecification == null || elementSpecification.getFullIdentifier().equals(Object.class.getName())) {
             switch (size) {
-            case -1:
-                return "Objects";
-            case 0:
-                return "No objects";
-            case 1:
-                return "1 object";
-            default:
-                return size + " objects";
+                case -1:
+                    return "Objects";
+                case 0:
+                    return "No objects";
+                case 1:
+                    return "1 object";
+                default:
+                    return size + " objects";
             }
         } else {
             switch (size) {
-            case -1:
-                return elementSpecification.getPluralName();
-            case 0:
-                return "No " + elementSpecification.getPluralName();
-            case 1:
-                return "1 " + elementSpecification.getSingularName();
-            default:
-                return size + " " + elementSpecification.getPluralName();
+                case -1:
+                    return elementSpecification.getPluralName();
+                case 0:
+                    return "No " + elementSpecification.getPluralName();
+                case 1:
+                    return "1 " + elementSpecification.getSingularName();
+                default:
+                    return size + " " + elementSpecification.getPluralName();
             }
         }
     }
@@ -336,9 +322,9 @@ public class PojoAdapter extends Instanc
         final ToString str = new ToString(this);
         toString(str);
 
-        // don't do title of any entities.  For persistence entities, might forces an unwanted resolve 
-        // of the object.  For transient objects, may not be fully initialized.
-        
+        // don't do title of any entities. For persistence entities, might forces an unwanted resolve
+        // of the object. For transient objects, may not be fully initialized.
+
         str.append("pojo-toString", pojo.toString());
         str.appendAsHex("pojo-hash", pojo.hashCode());
         return str.toString();
@@ -366,10 +352,9 @@ public class PojoAdapter extends Instanc
         str.append("version", version == null ? null : version.sequence());
     }
 
-    
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
     // IconName
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
 
     /**
      * Returns the name of the icon to use to represent this object.
@@ -379,60 +364,54 @@ public class PojoAdapter extends Instanc
         return getSpecification().getIconName(this);
     }
 
-
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
     // ElementType
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
 
     @Override
     public ObjectSpecification getElementSpecification() {
-        if(elementSpecificationProvider==null) {
+        if (elementSpecificationProvider == null) {
             return null;
         }
         return elementSpecificationProvider.getElementType();
     }
 
     @Override
-    public void setElementSpecificationProvider(ElementSpecificationProvider elementSpecificationProvider) {
+    public void setElementSpecificationProvider(final ElementSpecificationProvider elementSpecificationProvider) {
         this.elementSpecificationProvider = elementSpecificationProvider;
     }
 
-
-
     // /////////////////////////////////////////////////////////////
     // getInstance
     // /////////////////////////////////////////////////////////////
-    
+
     /**
      * Not supported by this implementation.
      */
     @Override
-    public Instance getInstance(Specification specification) {
+    public Instance getInstance(final Specification specification) {
         throw new UnsupportedOperationException();
     }
 
-
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
     // Fire Changes
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
 
     /**
-     * Guaranteed to be called whenever this object is known to have changed
-     * (specifically, by the <tt>ObjectStorePersistor</tt>).
+     * Guaranteed to be called whenever this object is known to have changed (specifically, by the
+     * <tt>ObjectStorePersistor</tt>).
      * 
      * <p>
-     * This implementation does nothing, but subclasses (for example <tt>PojoAdapterX</tt>)
-     * might provide listeners. 
+     * This implementation does nothing, but subclasses (for example <tt>PojoAdapterX</tt>) might provide listeners.
      */
     @Override
     public void fireChangedEvent() {
     }
 
-    
-    /////////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////////
     // Dependencies (from singleton)
-    /////////////////////////////////////////////////////////////////////
-    
+    // ///////////////////////////////////////////////////////////////////
+
     private SpecificationLoader getReflector() {
         return IsisContext.getSpecificationLoader();
     }
@@ -444,17 +423,17 @@ public class PojoAdapter extends Instanc
     @Override
     public ObjectAdapter getAggregateRoot() {
         if (getSpecification().isAggregated()) {
-            Oid parentOid = ((AggregatedOid) this.getOid()).getParentOid();
+            final Oid parentOid = ((AggregatedOid) this.getOid()).getParentOid();
             return getAdapterManager().getAdapterFor(parentOid);
         } else {
             return this;
         }
     }
 
-    //////////////////////////////////////////////////////////////////
+    // ////////////////////////////////////////////////////////////////
     // Dependencies (from context)
-    //////////////////////////////////////////////////////////////////
-    
+    // ////////////////////////////////////////////////////////////////
+
     protected AdapterManager getAdapterManager() {
         return getPersistenceSession().getAdapterManager();
     }
@@ -463,7 +442,4 @@ public class PojoAdapter extends Instanc
         return IsisContext.getPersistenceSession();
     }
 
-
-
-
 }

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapterFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapterFactory.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapterFactory.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapterFactory.java Tue May  3 06:22:09 2011
@@ -17,17 +17,16 @@
  *  under the License.
  */
 
+package org.apache.isis.runtimes.dflt.runtime.persistence.adapterfactory.pojo;
 
-package org.apache.isis.runtimes.dflt.runtime.persistence.adapterfactory.pojo;
-
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
 import org.apache.isis.runtimes.dflt.runtime.persistence.adapterfactory.AdapterFactoryAbstract;
-
-public class PojoAdapterFactory extends AdapterFactoryAbstract {
-
-    public PojoAdapter createAdapter(Object pojo, Oid oid) {
-        return new PojoAdapter(pojo, oid);
-    }
-
-    
-}
+
+public class PojoAdapterFactory extends AdapterFactoryAbstract {
+
+    @Override
+    public PojoAdapter createAdapter(final Object pojo, final Oid oid) {
+        return new PojoAdapter(pojo, oid);
+    }
+
+}

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerAbstract.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerAbstract.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerAbstract.java Tue May  3 06:22:09 2011
@@ -17,31 +17,27 @@
  *  under the License.
  */
 
+package org.apache.isis.runtimes.dflt.runtime.persistence.adaptermanager;
 
-package org.apache.isis.runtimes.dflt.runtime.persistence.adaptermanager;
-
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.oid.Oid;
-
-
-
-public abstract class AdapterManagerAbstract implements AdapterManagerExtended  {
-
-
-    public void removeAdapter(Oid oid) {
-        ObjectAdapter adapter = getAdapterFor(oid);
-        if (adapter != null) {
-        	removeAdapter(adapter);
-        }
-    }
-
-    public void injectInto(Object candidate) {
-        if (AdapterManagerAware.class.isAssignableFrom(candidate.getClass())) {
-            AdapterManagerAware cast = AdapterManagerAware.class.cast(candidate);
-            cast.setAdapterManager(this);
-        }
-    }
-
-
-}
-
+
+public abstract class AdapterManagerAbstract implements AdapterManagerExtended {
+
+    @Override
+    public void removeAdapter(final Oid oid) {
+        final ObjectAdapter adapter = getAdapterFor(oid);
+        if (adapter != null) {
+            removeAdapter(adapter);
+        }
+    }
+
+    @Override
+    public void injectInto(final Object candidate) {
+        if (AdapterManagerAware.class.isAssignableFrom(candidate.getClass())) {
+            final AdapterManagerAware cast = AdapterManagerAware.class.cast(candidate);
+            cast.setAdapterManager(this);
+        }
+    }
+
+}

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerAware.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerAware.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerAware.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerAware.java Tue May  3 06:22:09 2011
@@ -17,12 +17,10 @@
  *  under the License.
  */
 
-
-package org.apache.isis.runtimes.dflt.runtime.persistence.adaptermanager;
+package org.apache.isis.runtimes.dflt.runtime.persistence.adaptermanager;
 
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.AdapterManager;
-
-public interface AdapterManagerAware {
-    void setAdapterManager(AdapterManager adapterManager);
-}
-
+
+public interface AdapterManagerAware {
+    void setAdapterManager(AdapterManager adapterManager);
+}

Modified: incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerBackdoor.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerBackdoor.java?rev=1098935&r1=1098934&r2=1098935&view=diff
==============================================================================
--- incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerBackdoor.java (original)
+++ incubator/isis/trunk/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerBackdoor.java Tue May  3 06:22:09 2011
@@ -17,28 +17,24 @@
  *  under the License.
  */
 
+package org.apache.isis.runtimes.dflt.runtime.persistence.adaptermanager;
 
-package org.apache.isis.runtimes.dflt.runtime.persistence.adaptermanager;
-
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.AdapterManager;
 import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSessionHydrator;
-
-/**
- * Not part of the standard API, but used by the <tt>MemoryObjectStore</tt> to add pre-existing
- * {@link ObjectAdapter adapter}s straight into the identity maps.
- * 
- * <p>
- * Don't think this is used anymore; see instead {@link PersistenceSessionHydrator}.
- */
-public interface AdapterManagerBackdoor extends AdapterManager {
-
-
-    /**
-     * Add a pre-existing {@link ObjectAdapter adapter} straight into the maps.
-     */
-    ObjectAdapter addExistingAdapter(ObjectAdapter object);
-
-}
-
-
+
+/**
+ * Not part of the standard API, but used by the <tt>MemoryObjectStore</tt> to add pre-existing {@link ObjectAdapter
+ * adapter}s straight into the identity maps.
+ * 
+ * <p>
+ * Don't think this is used anymore; see instead {@link PersistenceSessionHydrator}.
+ */
+public interface AdapterManagerBackdoor extends AdapterManager {
+
+    /**
+     * Add a pre-existing {@link ObjectAdapter adapter} straight into the maps.
+     */
+    ObjectAdapter addExistingAdapter(ObjectAdapter object);
+
+}



Mime
View raw message