[jboss-dev-forums] [Design of POJO Server] - Re: Intercepting ManagedComponent ctor

kabir.khan@jboss.com do-not-reply at jboss.com
Mon Apr 27 08:09:43 EDT 2009


When/how is ManagedComponentImpl instantiated and intercepted?

IIRC you used to do this with AOP proxies? If that is the case you need to invoke the constructor aspects yourself as is done for MC beans in AOPConstructorJoinPoint


  |    private Object createTarget(ContainerCache cache, AOPProxyFactoryParameters params) throws Throwable
  |    {
  |       Advisor advisor = cache.getAdvisor();
  |       if (advisor != null)
  |       {
  |          org.jboss.aop.ConstructorInfo aopinfo = findAopConstructorInfo(advisor);
  |          
  |          Interceptor[] interceptors = (aopinfo != null) ? aopinfo.getInterceptors() : null;
  | 
  |          if (interceptors != null)
  |          {
  |             ConstructorInvocation inv = new ConstructorInvocation(aopinfo, aopinfo.getInterceptors());
  |             inv.setArguments(getArguments());
  |             return inv.invokeNext();
  |          }
  | ...
  | 

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

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



More information about the jboss-dev-forums mailing list