[jboss-dev-forums] [Design of POJO Server] - Re: Integrating aop-mc-int bean metadata with AS5

alesj do-not-reply at jboss.com
Fri Aug 8 06:34:03 EDT 2008


"adrian at jboss.org" wrote : 
  | A quick hack for you (though not the correct fix)
  | would be to change your ScopeInfo initialization code to something like:
  | 
I've already applied something similar:
 - http://fisheye.jboss.org/browse/JBossAS/projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/deployer/kernel/BeanMetaDataDeployer.java?r1=76637&r2=76811

  | <>	113	 	-	      scopeInfo.setScope(unit.getScope());
  |  	114	 	-	      scopeInfo.setMutableScope(unit.getMutableScope());
  |  	 	117	+	      if (scopeInfo != null)
  |  	 	118	+	      {
  |  	 	119	+	         mergeScopes(scopeInfo.getScope(), unit.getScope());
  |  	 	120	+	         mergeScopes(scopeInfo.getMutableScope(), unit.getMutableScope());
  |  	 	121	+	      }
  | 	115	122	 	      try
  |  	116	123	 	      {
  |  	117	124	 	         controller.install(context);
  |   	  	  	
  | 
  |  !
  | 
  | 	
  | 
  | …
  | 
  | 	122	129	 	      }
  |  	123	130	 	   }
  |  	124	131	 	
  | <>	 	132	+	   /**
  |  	 	133	+	    * Merge scope keys.
  |  	 	134	+	    *
  |  	 	135	+	    * @param contextKey the context key
  |  	 	136	+	    * @param unitKey the unit key
  |  	 	137	+	    */
  |  	 	138	+	   protected static void mergeScopes(ScopeKey contextKey, ScopeKey unitKey)
  |  	 	139	+	   {
  |  	 	140	+	      if (contextKey == null)
  |  	 	141	+	         return;
  |  	 	142	+	      if (unitKey == null)
  |  	 	143	+	         return;
  |  	 	144	+	
  |  	 	145	+	      Collection<Scope> unitScopes = unitKey.getScopes();
  |  	 	146	+	      if (unitScopes == null || unitScopes.isEmpty())
  |  	 	147	+	         return;
  |  	 	148	+	
  |  	 	149	+	      for (Scope scope : unitScopes)
  |  	 	150	+	         contextKey.addScope(scope);
  |  	 	151	+	   }
  | 

But like I posted on the jboss-dev:
"alesj wrote : 
  | The JBossAS5_trunk now boots fine with all MC snapshots.
  | My demos also work. :-)
  | 
  | But I haven't closed JBDEPLOY-69 yet.
  | Any other corner case we can think of? 
  | 


I'll add a test for annotated beans in deployers first.
And Kabir should/could also add some test exposing his work.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169556#4169556

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169556




More information about the jboss-dev-forums mailing list