Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

The GrailsWikiEngine is now a prototype bean because it isn't thread-…

…safe.
  • Loading branch information...
commit 8393ffc0721660c92167fb9659fe61bb06db0f7d 1 parent 3529570
Peter Ledbrook authored July 09, 2010
3  grails.org/grails-app/conf/spring/resources.groovy
@@ -42,8 +42,7 @@ beans = {
42 42
     wikiContext(BaseInitialRenderContext)
43 43
     wikiEngine(GrailsWikiEngineFactoryBean) {
44 44
         cacheService = ref('cacheService')
45  
-        def config = ConfigurationHolder.getConfig()
46  
-        contextPath = config.grails.serverURL
  45
+        contextPath = ConfigurationHolder.config.grails.serverURL
47 46
         context = wikiContext
48 47
     }
49 48
 
28  grails.org/src/groovy/org/grails/wiki/GrailsWikiEngineFactoryBean.groovy
@@ -6,26 +6,22 @@ import org.grails.cache.CacheService
6 6
 import org.springframework.beans.factory.InitializingBean
7 7
 
8 8
 
9  
-class GrailsWikiEngineFactoryBean implements FactoryBean, InitializingBean {
  9
+class GrailsWikiEngineFactoryBean implements FactoryBean {
10 10
 
11  
-    def context = new BaseInitialRenderContext();
12  
-
13  
-    CacheService cacheService
  11
+    def context
14 12
     String contextPath
  13
+    CacheService cacheService
15 14
 
16  
-    private engine
17  
-
18  
-    public Object getObject() { engine }
19  
-
20  
-    Class getObjectType() { GrailsWikiEngine }
21  
-
22  
-    boolean isSingleton() { true }
23  
-
24  
-    public void afterPropertiesSet() {
  15
+    public Object getObject() {
25 16
         context.set(GrailsWikiEngine.CONTEXT_PATH, contextPath)
26 17
         context.set(GrailsWikiEngine.CACHE, cacheService)
27  
-        engine = new GrailsWikiEngine(context)
28  
-        context.setRenderEngine engine
29 18
 
  19
+        def engine = new GrailsWikiEngine(context)
  20
+        context.setRenderEngine engine
  21
+        return engine
30 22
     }
31  
-}
  23
+
  24
+    Class getObjectType() { GrailsWikiEngine }
  25
+
  26
+    boolean isSingleton() { false }
  27
+}

0 notes on commit 8393ffc

Please sign in to comment.
Something went wrong with that request. Please try again.