[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Scoped beans deployment

adrian@jboss.org do-not-reply at jboss.com
Fri Feb 9 11:53:35 EST 2007


"alesj" wrote : "adrian at jboss.org" wrote : 
  |   | So this means that Bindings should be deployed against new (Scoped)Kernel, not against the underlying.
  | 
  | The bindings are done against the MutableMetaData which is a shared
  | repository. It already has a notion of scope.
  | 
  | The scoped kernel is a different feature.
  | That is where you would do something like:
  | 
  | 
  |   | <deployment>
  |   |    <annotation>@org.jboss.metadata.plugins.scope.DeploymentScope</annotation>
  |   | </deployment>
  |   | 
  | 
  | This would:
  | 
  | Stages (1) and (2) are optional if they already exist
  | 
  | 1) Create a MutableMetaData for this scope
  | 2) Create a kernel (or maybe just a kernel controller) for this scope and add it to
  | the MutableMetaData, the kernel's parent would come from any kernel in the
  | parent's scope or the default kernel if there is no such thing
  | 3) Deploy the bean(s) into that scoped kernel
  | 
  | You should also support things like:
  | 
  |   | <deployment>
  |   |    <bean>
  |   |       <annotation>@org.jboss.metadata.plugins.scope.SubsystemScope("jca")</annotation>
  |   |    </bean>
  |   | </deployment>
  |   | 
  | 
  | In both cases, you pick out all the "scope" annotations.
  | 
  | Iincluding those that are on the bean class if they are not overridden.
  | The MetaData (read only context) already has the processing to do this
  | since each instance scope has a parent scope of the class.
  | 
  | For ease of use (less boiler plate) I've also previously suggested or would suggest:
  | 
  | 1) The qualifier for @org.jboss.metadata.plugins.scope.DeploymentScope
  | should come from KernelDeployment.getName() if the user doesn't specify it.
  | 2) Support simple scoping definitions directly in the xml, e.g.
  | 
  |   | <deployment scoped="true">
  |   | 
  | The latter being the same as just adding the DeploymentScope annotation
  | to the deployment.
  | 
  | NOTE: We don't have any processing at the moment that lets you add
  | annotations at the deployment level. This is obviously a useful feature
  | where you want all beans to have the same annotations, like the scope.

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

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



More information about the jboss-dev-forums mailing list