You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2012/01/26 18:33:05 UTC

svn commit: r1236306 - in /tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc: RegistryBuilder.java internal/RegistryImpl.java

Author: hlship
Date: Thu Jan 26 17:33:05 2012
New Revision: 1236306

URL: http://svn.apache.org/viewvc?rev=1236306&view=rev
Log:
Modify RegistryBuilder and RegistryImpl to allow the OperationTracker to be provided as a constructor parameter to RegistryImpl

Modified:
    tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/RegistryBuilder.java
    tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/RegistryImpl.java

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/RegistryBuilder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/RegistryBuilder.java?rev=1236306&r1=1236305&r2=1236306&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/RegistryBuilder.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/RegistryBuilder.java Thu Jan 26 17:33:05 2012
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008, 2009, 2010, 2011 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -16,10 +16,7 @@ package org.apache.tapestry5.ioc;
 
 import org.apache.tapestry5.ioc.annotations.SubModule;
 import org.apache.tapestry5.ioc.def.ModuleDef;
-import org.apache.tapestry5.ioc.internal.DefaultModuleDefImpl;
-import org.apache.tapestry5.ioc.internal.LoggerSourceImpl;
-import org.apache.tapestry5.ioc.internal.RegistryImpl;
-import org.apache.tapestry5.ioc.internal.RegistryWrapper;
+import org.apache.tapestry5.ioc.internal.*;
 import org.apache.tapestry5.ioc.internal.services.PlasticProxyFactoryImpl;
 import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
 import org.apache.tapestry5.ioc.internal.util.InternalUtils;
@@ -72,7 +69,7 @@ public final class RegistryBuilder
         this.loggerSource = loggerSource;
         logger = loggerSource.getLogger(RegistryBuilder.class);
 
-        // Make the ClassFactory appear to be a service inside TapestryIOCModule, even before that
+        // Make the Proxy Factory appear to be a service inside TapestryIOCModule, even before that
         // module exists.
 
         Logger proxyFactoryLogger = loggerSource.getLogger(TapestryIOCModule.class.getName() + ".PlasticProxyFactory");
@@ -168,7 +165,9 @@ public final class RegistryBuilder
     {
         lock.lock();
 
-        RegistryImpl registry = new RegistryImpl(modules, proxyFactory, loggerSource);
+        PerThreadOperationTracker tracker = new PerThreadOperationTracker(loggerSource.getLogger(Registry.class));
+
+        RegistryImpl registry = new RegistryImpl(modules, proxyFactory, loggerSource, tracker);
 
         return new RegistryWrapper(registry);
     }

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/RegistryImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/RegistryImpl.java?rev=1236306&r1=1236305&r2=1236306&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/RegistryImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/RegistryImpl.java Thu Jan 26 17:33:05 2012
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008, 2009, 2010, 2011 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -109,20 +109,21 @@ public class RegistryImpl implements Reg
     /**
      * Constructs the registry from a set of module definitions and other resources.
      *
-     * @param moduleDefs   defines the modules (and builders, decorators, etc., within)
-     * @param proxyFactory TODO
-     * @param loggerSource used to obtain Logger instances
+     * @param moduleDefs       defines the modules (and builders, decorators, etc., within)
+     * @param proxyFactory     used to create new proxy objects
+     * @param loggerSource     used to obtain Logger instances
+     * @param operationTracker used to track operations related to the registry and its services
      */
     public RegistryImpl(Collection<ModuleDef> moduleDefs, PlasticProxyFactory proxyFactory,
-                        LoggerSource loggerSource)
+                        LoggerSource loggerSource, OperationTracker operationTracker)
     {
         assert moduleDefs != null;
         assert proxyFactory != null;
         assert loggerSource != null;
+        assert operationTracker != null;
 
         this.loggerSource = loggerSource;
-
-        operationTracker = new PerThreadOperationTracker(loggerSource.getLogger(Registry.class));
+        this.operationTracker = operationTracker;
 
         this.proxyFactory = proxyFactory;