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

adrian@jboss.org do-not-reply at jboss.com
Fri Aug 8 05:27:15 EDT 2008


"kabir.khan at jboss.com" wrote : 
  | Also, the call to scopeInfo.setMutableScope changes the scopeInfo.mutableScopeKey from
  | 
  |   | [INSTANCE=ScopedAlias_13_Factory$ScopedInterceptor]
  |   | 
  | to
  | 
  |   | [APPLICATION=vfszip:/Users/kabir/sourcecontrol/jboss-head/testsuite/output/lib/aop-scopeddependency-scoped.sar]
  |   | 
  | 

You're main problem is that you are not using the BeanMetaDataDeployer
(or whatever code you copied from it) properly.

The BeanMetaDataDeployer is designed to be run against a Component deployment
which will have a mutable INSTANCE scope. You're running it against the top level
deployment which has a mutable scope of the whole APPLICATION.

AbstractDeploymentContext (i.e. an application/deployment)

  | 
  |    public ScopeKey getMutableScope()
  |    {
  |       if (mutableScope == null)
  |       {
  |          ScopeBuilder builder = getScopeBuilder(this);
  |          mutableScope = builder.getMutableDeploymentScope(this);
  |       }
  |       return mutableScope;
  |    }
  | 

ComponentDeploymentContext (i.e. a bean)

  |    public ScopeKey getMutableScope()
  |    {
  |       if (mutableScope == null)
  |       {
  |          ScopeBuilder builder = AbstractDeploymentContext.getScopeBuilder(this);
  |          mutableScope = builder.getMutableComponentScope(this);
  |       }
  |       return mutableScope;
  |    }
  | 

DefaultScopeBuilder

  |    public ScopeKey getMutableDeploymentScope(DeploymentContext context)
  |    {
  |       if (context == null)
  |          throw new IllegalArgumentException("Null context");
  | 
  |       if (context.isTopLevel())
  |          return new ScopeKey(CommonLevels.APPLICATION, context.getName());
  |       else
  |          return new ScopeKey(CommonLevels.DEPLOYMENT, context.getName());
  |    }
  | 
  | ...
  | 
  |    public ScopeKey getMutableComponentScope(DeploymentContext context)
  |    {
  |       if (context == null)
  |          throw new IllegalArgumentException("Null context");
  | 
  |       return new ScopeKey(CommonLevels.INSTANCE, context.getName());
  |    }
  | 

Similar things happen for the runtime scope except there it builds a hierarchy
of scopes.

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

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



More information about the jboss-dev-forums mailing list