"alesj" wrote : "adrian(a)jboss.org" wrote :
| | So another fix would be to somehow make the Deployer's ScopeBuilder
| | somehow aware of the class scope when it creates the component scope.
| |
| ScopeBuilder per attachment type?
|
| | public static ScopeBuilder getScopeBuilder(DeploymentContext
deploymentContext)
| | {
| | if (deploymentContext == null)
| | throw new IllegalArgumentException("Null deployment context");
| | ScopeBuilder builder =
deploymentContext.getTransientAttachments().getAttachment(ScopeBuilder.class);
| | if (builder != null)
| | return builder;
| | DeploymentContext parent = deploymentContext.getParent();
| | if (parent != null)
| | return getScopeBuilder(parent);
| | return DefaultScopeBuilder.INSTANCE;
| | }
| |
| Setting BeanMD aware ScopeBuilder?
Those sound overly complicated.
The simplest fix would be in the component visitor, something like:
| protected static void addBeanComponent(DeploymentUnit unit, BeanMetaData bean)
| {
| DeploymentUnit component = unit.addComponent(bean.getName());
| component.addAttachment(BeanMetaData.class.getName(), bean);
| + String className = bean.getBean();
| + if (className != null)
| + component.getScope().addScope(CommonLevels.CLASS, className);
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4185152#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...