tuscany-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Boynes <jboy...@apache.org>
Subject Scope factory initialization: svn commit: r427726 [1/2] ...
Date Tue, 01 Aug 2006 22:51:57 GMT

I think the factories should wait until their init method is called  
otherwise they are registering before they have finished being  
initialized. This also allows a "this" reference to leak before the  
object has finished being constructed (i.e. it could be invoked  
before it is fully instantiated). This problem is in all the recent  
scope factory changes.

Will this fix the issue Ant mentioned yesterday where leaving off  
@Scope("MODULE") gave a NPE?


  public class ModuleScopeObjectFactory implements  
ObjectFactory<ModuleScopeContainer> {
+    public ModuleScopeObjectFactory(@Autowire ScopeRegistry registry) {
+        registry.registerFactory(Scope.MODULE, this);
+    }
+    @Init(eager = true)
+    public void init() {
+    }

To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org

View raw message