Package org.jboss.aop

Examples of org.jboss.aop.AspectManager


      {
         throw new RuntimeException("Could not load " + AspectManager.class.getSimpleName()
               + " with definitions from XML as file " + FILENAME_EJB3_INTERCEPTORS_AOP + " could not be found");
      }
      AspectXmlLoader.deployXML(url);
      AspectManager manager = AspectManager.instance();
      Advisor advisor = new ClassAdvisor(ProxyEqualityTestCaseBase.class, manager);
      ProxyEqualityTestCaseBase.advisor = advisor;
   }
View Full Code Here


  
   private void checkInstanceAdvisor(Advisor advisor)
   {
      if (advisor instanceof InstanceProxyContainer)
      {
         AspectManager manager = advisor.getManager();
         instanceAdvisorDomainName = manager.getManagerFQN();
      }
   }
View Full Code Here

   public static boolean matchesTypedef(CtClass clazz, ClassExpression classExpr, Advisor advisor)
   {
      String original = classExpr.getOriginal();
      String typedefName = original.substring("$typedef{".length(), original.lastIndexOf("}"));
      AspectManager manager = (advisor != null) ? advisor.getManager() : AspectManager.instance();
      Typedef typedef = manager.getTypedef(typedefName);
      if (typedef == null) return false;
      return typedef.matches(advisor, clazz);
   }
View Full Code Here

   public static boolean matchesTypedef(Class<?> clazz, ClassExpression classExpr, Advisor advisor)
   {
      String original = classExpr.getOriginal();
      String typedefName = original.substring("$typedef{".length(), original.lastIndexOf("}"));
      AspectManager manager = (advisor != null) ? advisor.getManager() : AspectManager.instance();
      Typedef typedef = manager.getTypedef(typedefName);
      if (typedef == null) return false;
      return typedef.matches(advisor, clazz);
   }
View Full Code Here

   private byte[] weaveRemoteTestRunner(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException
   {
      try
      {
         AspectManager manager = AspectManager.instance();
         ClassPool pool = manager.registerClassLoader(loader);
         CtClass remoteTestRunner = pool.get(MAIN_CLASS.replace('/', '.'));
         remoteTestRunner.defrost();

         CtMethod originalMain = remoteTestRunner.getMethod("main", "([Ljava/lang/String;)V");
         System.out.println("-----> Found CtMethod " + (originalMain != null));
View Full Code Here

      return new Boolean(val || ((Boolean) orChild.jjtAccept(this, Boolean.FALSE)).booleanValue());
   }

   public Object visit(ASTCFlow node, Object data)
   {
      AspectManager manager = null;
      if (invocation.getAdvisor() == null)
         manager = AspectManager.instance();
      else
         manager = invocation.getAdvisor().getManager();
      CFlowStack cflow = manager.getCFlowStack(node.getPointcutName());
     
      //Use the current advisor to guess the classloader
      ClassLoader cl = invocation.getAdvisor().getClassLoader();
      if (cl == null)
      {
         //Fall back to context classloader if null
         cl = SecurityActions.getContextClassLoader();
      }
     
      if (cflow != null) return new Boolean(cflow.matches(getStack(), cl));

      DynamicCFlow dcflow = manager.getDynamicCFlow(node.getPointcutName(), cl);
      return new Boolean(dcflow.shouldExecute(invocation));
   }
View Full Code Here

         throw new IllegalStateException("No aspect manager configured");
   }
  
   public void deploy(VFSDeploymentUnit unit) throws DeploymentException
   {
      AspectManager manager = getCorrectManager(unit);
      unit.addAttachment(AspectManager.class, manager);
     
      List<VirtualFile> files = unit.getMetaDataFiles(null, AOP_DD_SUFFIX);

      if (isAopArchiveOrFolder(unit))
View Full Code Here

  
   public void undeploy(VFSDeploymentUnit unit)
   {
      try
      {
         AspectManager manager = unit.getAttachment(AspectManager.class);

         List<VirtualFile> files = unit.getMetaDataFiles(null, AOP_DD_SUFFIX);
  
         if (isAopArchiveOrFolder(unit))
         {
View Full Code Here

         throw new RuntimeException("Could not find Bean Implementation class \"" + beanClassName + "\" in the "
               + ClassLoader.class.getSimpleName() + " for " + this);
      }

      // Set Advisor
      AspectManager aspectManager = AspectManager.instance(this.getClassLoader());
      Advisor advisor = new ProxyTestClassAdvisor(this, aspectManager);
      this.setAdvisor(advisor);
   }
View Full Code Here

            generatedClass= generatedJoinPointClassCache.get(infoAdviceString);
        
         else
         {
            //We need to do all the work again
            AspectManager manager = AspectManager.instance();
            ClassPool pool = manager.findClassPool(classloader);
            ProtectionDomain pd = advisorClass.getProtectionDomain();
            generatedClass = generateJoinpointClass(pool, info, classloader, pd);
            generatedJoinPointClassCache.put(infoAdviceString, generatedClass);
         }
         Object obj = generatedClass.createJoinPointInstance(classloader, info);
View Full Code Here

TOP

Related Classes of org.jboss.aop.AspectManager

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.