Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…safe.
  • Loading branch information...
commit 8393ffc0721660c92167fb9659fe61bb06db0f7d 1 parent 3529570
@pledbrook pledbrook authored
View
3  grails.org/grails-app/conf/spring/resources.groovy
@@ -42,8 +42,7 @@ beans = {
wikiContext(BaseInitialRenderContext)
wikiEngine(GrailsWikiEngineFactoryBean) {
cacheService = ref('cacheService')
- def config = ConfigurationHolder.getConfig()
- contextPath = config.grails.serverURL
+ contextPath = ConfigurationHolder.config.grails.serverURL
context = wikiContext
}
View
28 grails.org/src/groovy/org/grails/wiki/GrailsWikiEngineFactoryBean.groovy
@@ -6,26 +6,22 @@ import org.grails.cache.CacheService
import org.springframework.beans.factory.InitializingBean
-class GrailsWikiEngineFactoryBean implements FactoryBean, InitializingBean {
+class GrailsWikiEngineFactoryBean implements FactoryBean {
- def context = new BaseInitialRenderContext();
-
- CacheService cacheService
+ def context
String contextPath
+ CacheService cacheService
- private engine
-
- public Object getObject() { engine }
-
- Class getObjectType() { GrailsWikiEngine }
-
- boolean isSingleton() { true }
-
- public void afterPropertiesSet() {
+ public Object getObject() {
context.set(GrailsWikiEngine.CONTEXT_PATH, contextPath)
context.set(GrailsWikiEngine.CACHE, cacheService)
- engine = new GrailsWikiEngine(context)
- context.setRenderEngine engine
+ def engine = new GrailsWikiEngine(context)
+ context.setRenderEngine engine
+ return engine
}
-}
+
+ Class getObjectType() { GrailsWikiEngine }
+
+ boolean isSingleton() { false }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.