Package org.jboss.aop.advice

Examples of org.jboss.aop.advice.AspectDefinition


            if (aspects != null && aspects.size() > 0)
            {
               Iterator it = aspects.iterator();
               while (it.hasNext())
               {
                  AspectDefinition def = (AspectDefinition) it.next();
                  if (def instanceof ManagedAspectDefinition)
                  {
                     String name = ((ManagedAspectDefinition)def).getDependentAspectName();
                     if (name != null)
                     {
View Full Code Here


   }

   @Override
   public AspectDefinition getAspectDefinition(String name)
   {
      AspectDefinition factory = null;
      if (parentFirst)
      {
         factory = parent.getAspectDefinition(name);
         if (factory != null) return factory;
      }
View Full Code Here

         if (instanceDefs.size() > 0)
         {
            aspects = new WeakHashMap();
            for (Iterator it = instanceDefs.iterator() ; it.hasNext() ; )
            {
               AspectDefinition def = (AspectDefinition) it.next();
               ia.addPerInstanceAspect(def);
               Object aspect = def.getFactory().createPerInstance(getClassAdvisor(), instanceAdvisor);
               aspects.put(def, aspect);
            }
         }
      }
      Set defs = getClassAdvisor().getPerInstanceAspectDefinitions();
      if (defs.size() > 0)
      {
         if (aspects == null)
         {
            aspects = new WeakHashMap();
         }
         Iterator it = defs.iterator();
         while (it.hasNext())
         {
            AspectDefinition def = (AspectDefinition) it.next();
            Object aspect = def.getFactory().createPerInstance(getClassAdvisor(), instanceAdvisor);
            aspects.put(def, aspect);
         }
      }
   }
View Full Code Here

         if (instanceJpAspects.size() > 0)
         {
            joinpointAspects = new WeakHashMap();
            for (Iterator it = instanceJpAspects.keySet().iterator() ; it.hasNext() ; )
            {
               AspectDefinition def = (AspectDefinition) it.next();
               initJoinpointAspect(def, instanceJpAspects);
               Set joinpoints = (Set)instanceJpAspects.get(def);
               ia.addPerInstanceJoinpointAspect(joinpoints, def);
            }
         }
      }
     
      Map jpAspects = getClassAdvisor().getPerInstanceJoinpointAspectDefinitions();
      if (jpAspects.size() > 0)
      {
         joinpointAspects = new WeakHashMap();
         Iterator it = jpAspects.keySet().iterator();
         while (it.hasNext())
         {
            AspectDefinition def = (AspectDefinition) it.next();
            initJoinpointAspect(def, jpAspects);
         }
      }
   }
View Full Code Here

   public Object getPerInstanceAspect(String def)
   {
      Iterator it = aspects.keySet().iterator();
      while (it.hasNext())
      {
         AspectDefinition d = (AspectDefinition) it.next();
         if (d.getName().equals(def)) return aspects.get(d);
      }
      return null;
   }
View Full Code Here

   public void cleanup()
   {
      //AspectDefinitions have strong links back to us
      for(Iterator it = perInstanceAspectDefinitions.iterator() ; it.hasNext() ; )
      {
         AspectDefinition def = (AspectDefinition)it.next();
         removePerInstanceAspect(def);
         def.unregisterAdvisor(this);
      }
     
      for(Iterator it = perInstanceJoinpointAspectDefinitions.keySet().iterator() ; it.hasNext() ; )
      {
         AspectDefinition def = (AspectDefinition)it.next();
         removePerInstanceJoinpointAspect(def);
         def.unregisterAdvisor(this);
      }

      AspectDefinition[] defs = (AspectDefinition[])adviceInterceptors.keySet().toArray(new AspectDefinition[adviceInterceptors.size()]);
      for(int i = 0 ; i < defs.length ; i++)
      {
View Full Code Here

   public Object getPerVMAspect(String def)
   {
      Object aspect = perVMAspects.get(def);
      if (aspect == null)
      {
         AspectDefinition adef = aspectDefinitions.get(def);
         if (adef != null && adef.getScope() == Scope.PER_VM)
         {
            synchronized (adef)
            {
               aspect = createPerVmAspect(def, adef, null);
            }
View Full Code Here

      internalRemoveAspectDefintion(name);
   }

   protected AspectDefinition internalRemoveAspectDefintion(String name)
   {
      AspectDefinition def = aspectDefinitions.remove(name);
      if (def != null)
      {
         def.undeploy();
         if (def.getScope() == Scope.PER_VM) perVMAspects.remove(def.getName());
      }
      return def;
   }
View Full Code Here

      else
      {
         factory = new GenericAspectFactory(name, null);
         ((AspectFactoryWithClassLoader)factory).setClassLoader(loader.getClassLoader());
      }
      AspectDefinition def = new AspectDefinition(name, scope, factory);
      loader.getAspectManager().addAspectDefinition(def);
   }
View Full Code Here

         String bindingName,
         String pointcutString,
         String cflow,
         ASTCFlowExpression cflowExpression)throws Exception
   {
      AspectDefinition def = loader.getAspectManager().getAspectDefinition(aspectDefName);
      AdviceFactory factory = null;
      if (internalAdviceType == org.jboss.aop.advice.AdviceType.AROUND)
      {
         factory = new AdviceFactory(def, methodName);
      }
View Full Code Here

TOP

Related Classes of org.jboss.aop.advice.AspectDefinition

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.