You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2010/06/15 14:42:49 UTC

svn commit: r954854 - in /cayenne/main/trunk/framework: cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/ cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/ cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/

Author: aadamchik
Date: Tue Jun 15 12:42:49 2010
New Revision: 954854

URL: http://svn.apache.org/viewvc?rev=954854&view=rev
Log:
comments, naming refactoring

Modified:
    cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/Scope.java
    cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/Binding.java
    cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/DefaultInjector.java
    cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/NoScope.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCase.java

Modified: cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/Scope.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/Scope.java?rev=954854&r1=954853&r2=954854&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/Scope.java (original)
+++ cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/Scope.java Tue Jun 15 12:42:49 2010
@@ -25,7 +25,7 @@ package org.apache.cayenne.di;
  * shutdown.
  * <p>
  * Cayenne defines a few standard scopes in {@link Scopes} class. The default scope of a
- * binding in Cayenne is {@link Scopes#SINGLETON}.
+ * binding in Cayenne is {@link Scopes#INSTANCE}.
  * 
  * @since 3.1
  */

Modified: cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/Binding.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/Binding.java?rev=954854&r1=954853&r2=954854&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/Binding.java (original)
+++ cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/Binding.java Tue Jun 15 12:42:49 2010
@@ -39,7 +39,7 @@ class Binding<T> {
 
     void changeScope(Scope scope) {
         if (scope == null) {
-            scope = NoScope.SINGLETON;
+            scope = NoScope.INSTANCE;
         }
 
         scoped = scope.scope(unscoped);

Modified: cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/DefaultInjector.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/DefaultInjector.java?rev=954854&r1=954853&r2=954854&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/DefaultInjector.java (original)
+++ cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/DefaultInjector.java Tue Jun 15 12:42:49 2010
@@ -45,7 +45,7 @@ public class DefaultInjector implements 
     public DefaultInjector(Module... modules) throws ConfigurationException {
 
         this.singletonScope = new DefaultScope();
-        this.noScope = NoScope.SINGLETON;
+        this.noScope = NoScope.INSTANCE;
 
         // this is intentionally hardcoded and is not configurable
         this.defaultScope = singletonScope;

Modified: cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/NoScope.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/NoScope.java?rev=954854&r1=954853&r2=954854&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/NoScope.java (original)
+++ cayenne/main/trunk/framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/NoScope.java Tue Jun 15 12:42:49 2010
@@ -26,7 +26,7 @@ import org.apache.cayenne.di.Scope;
  */
 final class NoScope implements Scope {
 
-    static final Scope SINGLETON = new NoScope();
+    static final Scope INSTANCE = new NoScope();
 
     public <T> Provider<T> scope(Provider<T> unscoped) {
         return unscoped;

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCase.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCase.java?rev=954854&r1=954853&r2=954854&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCase.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCase.java Tue Jun 15 12:42:49 2010
@@ -58,10 +58,10 @@ public class ServerCase extends DICase {
                 DefaultScope testScope = new DefaultScope();
 
                 // these are the objects injectable in unit tests that subclass from
-                // ServerCase. Server runtime extensions are configured in
-                // CachingServerRuntimeFactory. There is some overlap between the two
-                // registries (some services declared in both), as cayenne-di does not
-                // support registry inheritance.
+                // ServerCase. Note that ServerRuntimeProvider creates ServerRuntime
+                // instances complete with their own DI injectors, independent from the
+                // unit test injector. ServerRuntime injector contents are customized
+                // inside ServerRuntimeProvider.
 
                 // singleton objects
                 binder.bind(UnitTestLifecycleManager.class).toInstance(
@@ -86,7 +86,6 @@ public class ServerCase extends DICase {
                         new ServerRuntimeProvider(resources)).in(testScope);
                 binder.bind(ObjectContext.class).toProvider(
                         ServerCaseDataContextProvider.class).in(testScope);
-
                 binder
                         .bind(DBHelper.class)
                         .toProvider(FlavoredDBHelperProvider.class)