Package org.jboss.aop

Examples of org.jboss.aop.ClassAdvisor


            return (Interceptor)icptr;
         }
         else if (joinpoint instanceof FieldJoinpoint)
         {
            FieldJoinpoint field = (FieldJoinpoint) joinpoint;
            ClassAdvisor classAdvisor = (ClassAdvisor) advisor;
            return (Interceptor) classAdvisor.getFieldAspect(field, aspect);
         }
        
         return (Interceptor) aspect.getFactory().createPerJoinpoint(advisor, joinpoint);
      }
      else
View Full Code Here


      else if (joinpoint instanceof FieldJoinpoint)
      {
         FieldJoinpoint field = (FieldJoinpoint) joinpoint;
         if (Modifier.isStatic(field.getField().getModifiers()))
         {
            ClassAdvisor classAdvisor = (ClassAdvisor) advisor;
            return (Interceptor)classAdvisor.getFieldAspect(field, def);
         }

      }
      return new PerJoinpointInterceptor(def, advisor, joinpoint);
   }
View Full Code Here

         if (astCon.getClazz().isSimple())
         {
            if (!astCon.getClazz().matches(call.getClassName())) return Boolean.FALSE;
         }
         CtConstructor calledCon = call.getConstructor();
         ClassAdvisor calledAdvisor = AspectManager.instance().getTempClassAdvisor(calledCon.getDeclaringClass());
         ConstructorMatcher conMatcher = new ConstructorMatcher(calledAdvisor, calledCon, null);
         return conMatcher.matches(astCon);
      }
      catch (Exception e)
      {
View Full Code Here

            {
               continue;
            }
            // Only need a temporary advisor for resolving metadata
            CtClass ctRef = null;
            ClassAdvisor advisor = null;
            if (ref.equals(clazz.getName()))
            {
               ctRef = clazz;
               advisor = clazzAdvisor;
            }
View Full Code Here

            }
            if (!isTransformable(ctRef)) continue;

            it.addSuperClass(ctRef);

            ClassAdvisor advisor = manager.getTempClassAdvisor(ctRef);


            if (!manager.getInterceptionMarkers().shouldSkipFieldAccess(ref) && !ref.equals(clazz.getName()))
            {
               List fields = getAdvisableFields(ctRef);
View Full Code Here

      else if (joinpoint instanceof FieldJoinpoint)
      {
         FieldJoinpoint field = (FieldJoinpoint) joinpoint;
         if (Modifier.isStatic(field.getField().getModifiers()))
         {
            ClassAdvisor classAdvisor = (ClassAdvisor) advisor;
            Object aspect = classAdvisor.getFieldAspect(field, def);
            return PerVmAdvice.generateInterceptor(joinpoint, aspect, adviceName);
         }
      }
      return new PerJoinpointAdvice(adviceName, def, advisor, joinpoint);
   }
View Full Code Here

      Iterator it = fieldMap.values().iterator();
      while(it.hasNext())
      {
         DistributedFieldUpdate update = (DistributedFieldUpdate)it.next();
         ClassAdvisor advisor = (ClassAdvisor)advised._getAdvisor();
         log.trace("build field " + advisor.getAdvisedFields()[update.getFieldIndex()].getName());
         Object val = update.getNonDereferencedValue();
         if (val != null && (val instanceof VersionReference))
         {
            VersionReference ref = (VersionReference)val;
            log.trace("VersionReference.guid: " + ref.getGUID() + " for field " + advisor.getAdvisedFields()[update.getFieldIndex()].getName());
            val = manager.getObject(ref.getGUID());
            if (val == null)
            {
               DistributedState fieldVal = manager.getState(ref.getGUID());
               val = fieldVal.buildObject(manager, versionManager);
View Full Code Here

            {
               advised = (Advised)advisedRef.get();
            }
            if (advised != null)
            {
               ClassAdvisor advisor = (ClassAdvisor)advised._getAdvisor();
               Field field = advisor.getAdvisedFields()[index.intValue()];
               throw new OptimisticLockFailure("optimistic lock failure for field " + field.getName()
                                               + " of class " + field.getDeclaringClass().getName());
            }
         }
      }
View Full Code Here

   public Object invoke(org.jboss.aop.joinpoint.Invocation invocation) throws Throwable
   {
      Object target = invocation.getTargetObject();
      if (target instanceof Advised)
      {
         ClassAdvisor advisor = (ClassAdvisor)((Advised)target)._getAdvisor();
         // We will have already gone through the interceptor chain so just invoke on the
         // object.
         return advisor.invoke(invocation);
      }
      else
      {
         if (invocation instanceof MethodInvocation)
         {
View Full Code Here

      {
         Map.Entry entry = (Map.Entry) it.next();
         String classname = (String) entry.getKey();
         indenter(pw, indent);
         pw.println("<class name=\"" + classname + "\">");
         ClassAdvisor advisor = (ClassAdvisor) entry.getValue();
         outputAdvisor(indent + 1, pw, advisor, classname);
         indenter(pw, indent);
         pw.println("</class>");
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.aop.ClassAdvisor

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.