Package org.jboss.aop.joinpoint

Examples of org.jboss.aop.joinpoint.FieldWriteInvocation


    */
   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


   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

   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

   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

/*     */   }
/*     */
/*     */   public Object fieldWrite(Invocation invocation)
/*     */     throws Throwable
/*     */   {
/* 171 */     FieldWriteInvocation fieldInvocation = (FieldWriteInvocation)invocation;
/* 172 */     Integer index = new Integer(fieldInvocation.getIndex());
/* 173 */     Object val = fieldInvocation.getValue();
/*     */
/* 175 */     if ((val instanceof Advised))
/*     */     {
/* 177 */       Advised advisedValue = (Advised)val;
/* 178 */       val = this.versionManager.makeVersioned(advisedValue);
View Full Code Here

/*  73 */       FieldReadInvocation mi = (FieldReadInvocation)invocation;
/*  74 */       return this.p.matchesGet(mi.getAdvisor(), mi.getField());
/*     */     }
/*  76 */     if ((invocation instanceof FieldWriteInvocation))
/*     */     {
/*  78 */       FieldWriteInvocation mi = (FieldWriteInvocation)invocation;
/*  79 */       return this.p.matchesSet(mi.getAdvisor(), mi.getField());
/*     */     }
/*  81 */     if ((invocation instanceof MethodCalledByMethodInvocation))
/*     */     {
/*  83 */       MethodCalledByMethodInvocation mi = (MethodCalledByMethodInvocation)invocation;
/*  84 */       return this.p.matchesCall(mi.getAdvisor(), mi.getCallingMethod(), mi.getCalledMethod().getDeclaringClass(), mi.getCalledMethod());
/*     */     }
/*  86 */     if ((invocation instanceof MethodCalledByConstructorInvocation))
/*     */     {
/*  88 */       MethodCalledByConstructorInvocation mi = (MethodCalledByConstructorInvocation)invocation;
/*  89 */       return this.p.matchesCall(mi.getAdvisor(), mi.getCalling(), mi.getCalledMethod().getDeclaringClass(), mi.getCalledMethod());
/*     */     }
/*  91 */     if ((invocation instanceof ConstructorCalledByConstructorInvocation))
/*     */     {
/*  93 */       ConstructorCalledByConstructorInvocation mi = (ConstructorCalledByConstructorInvocation)invocation;
/*  94 */       return this.p.matchesCall(mi.getAdvisor(), mi.getCallingConstructor(), mi.getCalledConstructor().getDeclaringClass(), mi.getCalledConstructor());
/*     */     }
/*  96 */     if ((invocation instanceof ConstructorCalledByMethodInvocation))
/*     */     {
/*  98 */       ConstructorCalledByMethodInvocation mi = (ConstructorCalledByMethodInvocation)invocation;
/*  99 */       return this.p.matchesCall(mi.getAdvisor(), mi.getCallingMethod(), mi.getCalledConstructor().getDeclaringClass(), mi.getCalledConstructor());
/*     */     }
/* 101 */     throw new RuntimeException("UNKNOWN JOINPOINT TYPE: " + invocation.getClass().getName());
/*     */   }
View Full Code Here

/* 1644 */       if ((advisor != null) && (advisor.hasInterceptors()))
/*      */       {
/* 1646 */         aspects = advised._getInstanceAdvisor().getInterceptors(aspects);
/*      */       }
/*      */     }
/* 1649 */     FieldWriteInvocation invocation = new FieldWriteInvocation(this.advisedFields[index], index, value, aspects);
/* 1650 */     invocation.setAdvisor(this);
/* 1651 */     invocation.setTargetObject(target);
/* 1652 */     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.