Package org.jboss.aop.introduction

Examples of org.jboss.aop.introduction.InterfaceIntroduction


    */
   public void removeInterfaceIntroduction(String name)
   {
      synchronized (interfaceIntroductions)
      {
         InterfaceIntroduction pointcut = interfaceIntroductions.remove(name);
         if (pointcut == null) return;
         pointcut.clearAdvisors();
      }
   }
View Full Code Here


         if (mixins != null)
         {
            HashMap<String, Integer> mixinIntfs = new HashMap<String, Integer>();
            for (int i = 0; i < mixins.size(); i++)
            {
               InterfaceIntroduction introduction = mixins.get(i);
               getIntroductionInterfaces(introduction, intfs, mixinIntfs, mixes, i);
            }
            if (mixes.size() > 0)
            {
               defaultCtor.insertAfter("mixins = new Object[" + mixes.size() + "];");
View Full Code Here

      lock.lockWrite();
      try
      {
         synchronized (interfaceIntroductions)
         {
            InterfaceIntroduction pointcut = interfaceIntroductions.remove(name);
            if (pointcut == null) return;
            pointcut.clearAdvisors();
         }
      }
      finally
      {
         lock.unlockWrite();
View Full Code Here

         indenter(pw, indent);
         pw.println("<introductions>");
         indent++;
         for (int i = 0; i < introductions.size(); i++)
         {
            InterfaceIntroduction pointcut = introductions.get(i);
            indenter(pw, indent);
            pw.println("<introduction classExpr=\"" + pointcut.getClassExpr() + "\">");
            indent++;
            String[] intfs = pointcut.getInterfaces();
            ArrayList<InterfaceIntroduction.Mixin> mixins = pointcut.getMixins();

            if (intfs != null && intfs.length > 0)
            {
               //Show interfaces
               for (int j = 0; j < intfs.length; j++)
View Full Code Here

      if (proxiedClass == null)
      {
         proxiedClass = Object.class;
      }
      String[] introducedNames = getClassNames(interfaces);
      InterfaceIntroduction intro = new InterfaceIntroduction("Introduction" + counter++, proxiedClass.getName(), introducedNames);

      if (mixinLength > 0)
      {
         addMixins(intro);
      }
View Full Code Here

   private void initInstanceContainer()
   {
      if (requiresInstanceAdvisor())
      {
         InterfaceIntroduction introduction = null;
         if (hasInterfaceIntroductions() || hasMixins())
         {
            introduction = getInterfaceIntroduction();
         }
View Full Code Here

         if (mixins != null)
         {
            HashMap<String, Integer> mixinIntfs = new HashMap<String, Integer>();
            for (int i = 0; i < mixins.size(); i++)
            {
               InterfaceIntroduction introduction = mixins.get(i);
               getIntroductionInterfaces(introduction, intfs, mixinIntfs, mixes, i);
            }
            if (mixes.size() > 0)
            {
               defaultCtor.insertAfter("mixins = new Object[" + mixes.size() + "];");
View Full Code Here

      Iterator<InterfaceIntroduction> it = pointcuts.iterator();
      if (it.hasNext()) setupBasics(clazz);
      while (it.hasNext())
      {

         InterfaceIntroduction pointcut = it.next();
         ArrayList<InterfaceIntroduction.Mixin> mixins = pointcut.getMixins();
         for (InterfaceIntroduction.Mixin mixin: mixins)
         {
            addMixin(clazz, pointcut, mixin, baseMethods);
         }
      }

      // pointcut interfaces.  If a method is already implemented for it then use that method
      // otherwise delegate to an interceptor
      it = pointcuts.iterator();
      while (it.hasNext())
      {
         InterfaceIntroduction pointcut = it.next();
         String[] interfaces = pointcut.getInterfaces();
         if (interfaces == null) continue;
         for (int i = 0; i < interfaces.length; i++)
         {
            addIntroductionPointcutInterface(clazz, advisor, interfaces[i], baseMethods);
         }
View Full Code Here

      if (introductions == null || introductions.size() == 0) return null;

      TreeNode[] nodes = new TreeNode[introductions.size()];
      for (int i = 0; i < introductions.size(); i++)
      {
         InterfaceIntroduction introduction = (InterfaceIntroduction) introductions.get(i);
         nodes[i] = createTreeNode(
                 "Introduction " + i, // name
                 "Introduction for " + advisor.getName(), // description
                 "images/service.gif", // Icon URL
                 "AOPIntroductionPointcut.jsp?pointcut=" + java.net.URLEncoder.encode(introduction.getName()), // Default URL
                 null, // menu
                 null, // sub nodes
                 null   // Sub-Resources
         );
      }
View Full Code Here

      if (name == null)
         name = GUID.asString();
     
      String[] intfs = (interfaces != null) ? interfaces.toArray(new String[interfaces.size()]) : null;
     
      InterfaceIntroduction introduction = null;
      if (classes != null)
      {
         introduction = new InterfaceIntroduction(name, classes, intfs);
      }
      else
      {
         ASTStart start = new TypeExpressionParser(new StringReader(expr)).Start();
         introduction = new InterfaceIntroduction(name, start, intfs);
      }
     
      if (mixins != null)
      {
         for (MixinEntry entry : mixins)
         {
            if (entry.getInterfaces() == null)
               throw new IllegalArgumentException("MixinEntry with null interfaces");
            if (entry.getMixin() == null)
               throw new IllegalArgumentException("MixinEntry with null mixin");
            String[] intfaces = entry.getInterfaces().toArray(new String[entry.getInterfaces().size()]);
           
            introduction.addMixin(new InterfaceIntroduction.Mixin(entry.getMixin(), intfaces, entry.getConstruction(), entry.isTransient()));
         }
      }     
      manager.addInterfaceIntroduction(introduction);
   }
View Full Code Here

TOP

Related Classes of org.jboss.aop.introduction.InterfaceIntroduction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.