It would repeatedly reinitialize itself on every invocation because the 
"initialized" flag wasnt being set. Net result was very slow performance when 
using PER_INSTANCE scoping.

neil.
ps. I wasnt sure where to put this.
PerInstanceAdvice.java

   public Object invoke(Invocation invocation) throws Throwable
   {
      Object targetObject = invocation.getTargetObject();
      if (targetObject == null) return invocation.invokeNext(); // static 
method call or static field call

      Advised advised = (Advised)targetObject;
      ClassInstanceAdvisor advisor = 
(ClassInstanceAdvisor)advised._getInstanceAdvisor();
      Object aspect = advisor.getPerInstanceAspect(aspectDefinition);
      if (!initialized)
      {
         init(adviceName, aspect.getClass());
>>>>         initialized = true;
      }
      Method advice = resolveAdvice(invocation);
      Object[] args = {invocation};

      try
      {
         return advice.invoke(aspect, args);
      }
      catch (InvocationTargetException e)
      {
         throw e.getCause();  //To change body of catch statement use Options | 
File Templates.
      }
   }



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

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


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
JBoss-Development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to