Package org.jboss.aop.joinpoint

Examples of org.jboss.aop.joinpoint.FieldWriteInvocation


         FieldInvocation fi = (FieldReadInvocation)invocation;
         Interceptions.addFieldReadInterception(this.getClass(), fi.getField());
      }
      else if (invocation instanceof FieldWriteInvocation)
      {
         FieldWriteInvocation fi = (FieldWriteInvocation)invocation;
         Interceptions.addFieldWriteInterception(this.getClass(), fi.getField());
      }
     
      return invocation.invokeNext();
   }
View Full Code Here


         FieldInvocation fi = (FieldReadInvocation)invocation;
         Interceptions.addFieldReadInterception(this.getClass(), fi.getField());
      }
      else if (invocation instanceof FieldWriteInvocation)
      {
         FieldWriteInvocation fi = (FieldWriteInvocation)invocation;
         Interceptions.addFieldWriteInterception(this.getClass(), fi.getField());
      }
     
      return invocation.invokeNext();  
   }
View Full Code Here

         FieldInvocation fi = (FieldReadInvocation)invocation;
         Interceptions.addFieldReadInterception(this.getClass(), fi.getField());
      }
      else if (invocation instanceof FieldWriteInvocation)
      {
         FieldWriteInvocation fi = (FieldWriteInvocation)invocation;
         Interceptions.addFieldWriteInterception(this.getClass(), fi.getField());
      }
     
      return invocation.invokeNext();
   }
View Full Code Here

   public Object invokeWrite(Object target, int index, Object value)
   throws Throwable
   {
      Interceptor[] aspects = fieldWriteInfos[index].getInterceptors();
      if (aspects == null) aspects = new Interceptor[0];
      FieldWriteInvocation invocation;
      if (target != null)
      {
         InstanceAdvised advised = (InstanceAdvised) target;
         InstanceAdvisor advisor = advised._getInstanceAdvisor();
         if (advisor != null && advisor.hasInterceptors())
         {
            aspects = advised._getInstanceAdvisor().getInterceptors(aspects);
         }
      }
      invocation = new FieldWriteInvocation(advisedFields[index], index, value, aspects);
      invocation.setAdvisor(this);
      invocation.setTargetObject(target);
      return invocation.invokeNext();
   }
View Full Code Here

    */
   public Object invoke(Invocation invocation) throws Throwable
   {
      if (invocation instanceof FieldWriteInvocation)
      {
         FieldWriteInvocation fieldInvocation = (FieldWriteInvocation) invocation;
         Object target = fieldInvocation.getTargetObject();
         Object val = fieldInvocation.getValue();
         Field field = fieldInvocation.getField();
         field.set(target, val);
         return null;
      }
      else if (invocation instanceof FieldReadInvocation)
      {
         FieldReadInvocation fieldInvocation = (FieldReadInvocation) invocation;
         Object target = fieldInvocation.getTargetObject();
         Field field = fieldInvocation.getField();
         return field.get(target);
      }
      else if (invocation instanceof MethodInvocation)
      {
         MethodInvocation methodInvocation = (MethodInvocation) invocation;
View Full Code Here

         info.append("\n\ttype: Constructor Invocation");
         info.append("\n\tconstructor: " + ci.getConstructor());
      }
      else if (invocation instanceof FieldWriteInvocation)
      {
         FieldWriteInvocation fi = (FieldWriteInvocation)invocation;
         info.append("\n\ttype: Field Write Invocation");
         info.append("\n\tfield: " + fi.getField());
        
      }
      else if (invocation instanceof FieldReadInvocation)
      {
         FieldReadInvocation fi = (FieldReadInvocation)invocation;
         info.append("\n\ttype: Field Write Invocation");
         info.append("\n\tfield: " + fi.getField());        
      }
     
      return info.toString();
   }
View Full Code Here

   public Object invokeWrite(Object target, int index, Object value)
   throws Throwable
   {
      Interceptor[] aspects = fieldWriteInfos[index].getInterceptors();
      if (aspects == null) aspects = new Interceptor[0];
      FieldWriteInvocation invocation;
      if (target != null)
      {
         InstanceAdvised advised = (InstanceAdvised) target;
         InstanceAdvisor advisor = advised._getInstanceAdvisor();
         if (advisor != null && advisor.hasInterceptors())
         {
            aspects = advised._getInstanceAdvisor().getInterceptors(aspects);
         }
      }
      invocation = new FieldWriteInvocation(advisedFields[index], index, value, aspects);
      invocation.setAdvisor(this);
      invocation.setTargetObject(target);
      return invocation.invokeNext();
   }
View Full Code Here

    */
   public Object invoke(Invocation invocation) throws Throwable
   {
      if (invocation instanceof FieldWriteInvocation)
      {
         FieldWriteInvocation fieldInvocation = (FieldWriteInvocation) invocation;
         Object target = fieldInvocation.getTargetObject();
         Object val = fieldInvocation.getValue();
         Field field = fieldInvocation.getField();
         field.set(target, val);
         return null;
      }
      else if (invocation instanceof FieldReadInvocation)
      {
         FieldReadInvocation fieldInvocation = (FieldReadInvocation) invocation;
         Object target = fieldInvocation.getTargetObject();
         Field field = fieldInvocation.getField();
         return field.get(target);
      }
      else if (invocation instanceof MethodInvocation)
      {
         MethodInvocation methodInvocation = (MethodInvocation) invocation;
View Full Code Here

         FieldReadInvocation mi = (FieldReadInvocation) invocation;
         return p.matchesGet(mi.getAdvisor(), mi.getField());
      }
      else if (invocation instanceof FieldWriteInvocation)
      {
         FieldWriteInvocation mi = (FieldWriteInvocation) invocation;
         return p.matchesSet(mi.getAdvisor(), mi.getField());
      }
      else if (invocation instanceof MethodCalledByMethodInvocation)
      {
         MethodCalledByMethodInvocation mi = (MethodCalledByMethodInvocation) invocation;
         return p.matchesCall(mi.getAdvisor(), mi.getCallingMethod(), mi.getCalledMethod().getDeclaringClass(), mi.getCalledMethod());
      }
      else if (invocation instanceof MethodCalledByConstructorInvocation)
      {
         MethodCalledByConstructorInvocation mi = (MethodCalledByConstructorInvocation) invocation;
         return p.matchesCall(mi.getAdvisor(), mi.getCalling(), mi.getCalledMethod().getDeclaringClass(), mi.getCalledMethod());
      }
      else if (invocation instanceof ConstructorCalledByConstructorInvocation)
      {
         ConstructorCalledByConstructorInvocation mi = (ConstructorCalledByConstructorInvocation) invocation;
         return p.matchesCall(mi.getAdvisor(), mi.getCallingConstructor(), mi.getCalledConstructor().getDeclaringClass(), mi.getCalledConstructor());
      }
      else if (invocation instanceof ConstructorCalledByMethodInvocation)
      {
         ConstructorCalledByMethodInvocation mi = (ConstructorCalledByMethodInvocation) invocation;
         return p.matchesCall(mi.getAdvisor(), mi.getCallingMethod(), mi.getCalledConstructor().getDeclaringClass(), mi.getCalledConstructor());
      }
      throw new RuntimeException("UNKNOWN JOINPOINT TYPE: " + invocation.getClass().getName());
   }
View Full Code Here

   public Object invokeWrite(Object target, int index, Object value)
   throws Throwable
   {
      Interceptor[] aspects = fieldWriteInfos[index].getInterceptors();
      if (aspects == null) aspects = new Interceptor[0];
      FieldWriteInvocation invocation;
      if (target != null)
      {
         InstanceAdvised advised = (InstanceAdvised) target;
         InstanceAdvisor advisor = advised._getInstanceAdvisor();
         if (advisor != null && advisor.hasInterceptors())
         {
            aspects = advised._getInstanceAdvisor().getInterceptors(aspects);
         }
      }
      invocation = new FieldWriteInvocation(advisedFields[index], index, value, aspects);
      invocation.setAdvisor(this);
      invocation.setTargetObject(target);
      return invocation.invokeNext();
   }
View Full Code Here

TOP

Related Classes of org.jboss.aop.joinpoint.FieldWriteInvocation

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.