Package org.jboss.aop.advice

Examples of org.jboss.aop.advice.AspectDefinition


   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)
            {
               // double check but, now, in a sync block
               aspect = perVMAspects.get(def);
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

      this.manager = manager;
   }
  
   public void addLifecycleDefinition(AspectDefinition def)
   {
      AspectDefinition old = lifecycles.put(def.getName(), def);
      if (old != null)
      {
         old.undeploy();
      }
   }
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

   }
  
   public void deployInterceptor(AspectAnnotationLoader loader, boolean isFactory, String name, Scope scope)
   {
      deployAspect(loader, isFactory, name, scope);
      AspectDefinition def = loader.getAspectManager().getAspectDefinition(name);
      ScopedInterceptorFactory factory = new ScopedInterceptorFactory(def);
      loader.getAspectManager().addInterceptorFactory(factory.getName(), factory);
   }
View Full Code Here

      if (s != null)
      {
         scope = ScopeUtil.parse(s);
         if (scope == null) throw new RuntimeException("Illegal scope attribute value: " + s);
      }
      AspectDefinition def = manager.getAspectDefinition(name);

      // if interceptor definition already exists, then just check to see if scopes are the same
      // todo deprecate <interceptor> within an advice stack
      if (def != null)
      {
         if (scope == null) scope = Scope.PER_VM;
         if (scope != def.getScope()) throw new RuntimeException("multiple definitions of <interceptor> " + name + " with different scopes is illegal");
      }
      else
      {
         AspectFactory aspectFactory;
         if (clazz != null)
         {
            aspectFactory = new GenericAspectFactory(clazz, element);
            ((AspectFactoryWithClassLoader)aspectFactory).setClassLoader(cl);
         }
         else
         {
            aspectFactory = new AspectFactoryDelegator(factory1, element);
            ((AspectFactoryWithClassLoader)aspectFactory).setClassLoader(cl);
         }
        
         def = new AspectDefinition(name, scope, aspectFactory);
         manager.addAspectDefinition(def);
      }
      InterceptorFactory factory = manager.getInterceptorFactory(name);
      if (factory == null)
      {
View Full Code Here

   {
      String name = element.getAttribute("name");
      String aspect = element.getAttribute("aspect");
      if(aspect == null || aspect.length() < 1)
         throw new RuntimeException("Aspect couldnt be found for element: "+element.getNodeName()+", typo perhaps?");
      AspectDefinition def = manager.getAspectDefinition(aspect);
      if (def == null) throw new RuntimeException("advice " + name + " cannot find aspect " + aspect);
     
      AdviceFactory factory = null;
      if (type == null)
      {
View Full Code Here

      {
         aspectFactory = new AspectFactoryDelegator(factory, element);
         ((AspectFactoryWithClassLoader)aspectFactory).setClassLoader(cl);
      }
     
      AspectDefinition def = new AspectDefinition(name, scope, aspectFactory);
      manager.addAspectDefinition(def);
      return def;
   }
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)
            {
               // double check but, now, in a sync block
               aspect = perVMAspects.get(def);
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.