Package org.jboss.joinpoint.spi

Examples of org.jboss.joinpoint.spi.MethodJoinpoint


    * @return the result of the invocation
    * @throws Throwable for any error
    */
   public static Object invoke(Object object, JoinpointFactory jpf, String name, String[] paramTypes, Object[] params) throws Throwable
   {
      MethodJoinpoint joinpoint = getMethodJoinpoint(object, jpf, name, paramTypes, params);
      return joinpoint.dispatch();
   }
View Full Code Here


         else
            log.trace("Get method Joinpoint jpf=" + jpf + " target=" + object + " name=" + name + " paramTypes=()");
      }

      MethodInfo methodInfo = findMethodInfo(jpf.getClassInfo(), name, paramTypes);
      MethodJoinpoint joinpoint = jpf.getMethodJoinpoint(methodInfo);
      joinpoint.setTarget(object);
      joinpoint.setArguments(params);
      return joinpoint;
   }
View Full Code Here

         Object target = context.getTarget();
         BeanInfo info = context.getBeanInfo();
         BeanMetaData metaData = context.getBeanMetaData();
         String method = getInstallMethod(context);
         List parameters = getInstallParameters(context);
         MethodJoinpoint joinpoint = null;
         try
         {
            ClassLoader cl = Configurator.getClassLoader(metaData);
            joinpoint = configurator.getMethodJoinPoint(info, cl, method, parameters, false, true);
         }
         catch (JoinpointException ignored)
         {
            if (trace)
            {
               if (parameters == null)
                  log.trace("No " + method + " method for " + context);
               else
                  log.trace("No " + method + parameters + " method for " + context);
            }
            return;
         }
         joinpoint.setTarget(target);
         dispatchJoinPoint(context, joinpoint);
      }
View Full Code Here

         Object target = context.getTarget();
         BeanInfo info = context.getBeanInfo();
         BeanMetaData metaData = context.getBeanMetaData();
         String method = getUninstallMethod(context);
         List parameters = getUninstallParameters(context);
         MethodJoinpoint joinpoint = null;
         try
         {
            ClassLoader cl = Configurator.getClassLoader(metaData);
            joinpoint = configurator.getMethodJoinPoint(info, cl, method, parameters, false, true);
            joinpoint.setTarget(target);
            dispatchJoinPoint(context, joinpoint);
         }
         catch (JoinpointException ignored)
         {
            if (trace)
View Full Code Here

      if (lifecycle != null)
         method = lifecycle.getMethodName();
      List parameters = null;
      if (lifecycle != null)
         parameters = lifecycle.getParameters();
      MethodJoinpoint joinpoint = null;
      try
      {
         joinpoint = configurator.getMethodJoinPoint(info, cl, method, parameters, false, true);
      }
      catch (JoinpointException ignored)
      {
         return;
      }
      joinpoint.setTarget(target);
      joinpoint.dispatch();
   }
View Full Code Here

            // Describe the factory
            BeanInfo factoryInfo = config.getBeanInfo(factory.getClass());
           
            // Find the method
            MethodJoinpoint joinPoint = findMethod(trace, factoryInfo, cl, metaData.getFactoryMethod(), parameters, false, true);
            joinPoint.setTarget(factory);
            MethodInfo minfo = joinPoint.getMethodInfo();

            // Set the parameters
            if (minfo != null)
            {
               TypeInfo[] pinfos = minfo.getParameterTypes();
               Object[] params = getParameters(trace, cl, pinfos, parameters);
               joinPoint.setArguments(params);
            }
            return joinPoint;
         }
        
         String factoryClassName = metaData.getFactoryClass();
         if (factoryClassName != null)
         {
            // Get the parameters
            List parameters = metaData.getParameters();

            BeanInfo factoryInfo = config.getBeanInfo(factoryClassName, cl);

            // Find the method
            MethodJoinpoint joinPoint = findMethod(trace, factoryInfo, cl, metaData.getFactoryMethod(), parameters, true, true);
            MethodInfo minfo = joinPoint.getMethodInfo();

            // Set the parameters
            if (minfo != null)
            {
               TypeInfo[] pinfos = minfo.getParameterTypes();
               Object[] params = getParameters(trace, cl, pinfos, parameters);
               joinPoint.setArguments(params);
            }
            return joinPoint;
         }
        
         // Find the constructor
         ConstructorJoinpoint joinPoint = findConstructor(trace, info, metaData, beanMetaData);
         ConstructorInfo cinfo = joinPoint.getConstructorInfo();
        
         // Set the parameters
         if (cinfo != null)
         {
            TypeInfo[] pinfos = cinfo.getParameterTypes();
            Object[] params = getParameters(trace, cl, pinfos, metaData.getParameters());
            joinPoint.setArguments(params);
         }
         return joinPoint;
      }
     
      // Default constructor
View Full Code Here

         throw new IllegalArgumentException("Null name");

      String[] paramTypes = getParameterTypes(trace, parameters);
      MethodInfo minfo = findMethodInfo(info.getClassInfo(), name, paramTypes); // FIXME isStatic, isPublic);
      JoinpointFactory jpf = info.getJoinpointFactory();
      MethodJoinpoint joinPoint = jpf.getMethodJoinpoint(minfo);

      // Set the parameters
      if (minfo != null)
      {
         TypeInfo[] pinfos = minfo.getParameterTypes();
         Object[] params = getParameters(trace, cl, pinfos, parameters);
         joinPoint.setArguments(params);
      }
     
      return joinPoint;
   }
View Full Code Here

    * @return the result of the invocation
    * @throws Throwable for any error
    */
   public static Object invoke(Object object, JoinpointFactory jpf, String name, String[] paramTypes, Object[] params) throws Throwable
   {
      MethodJoinpoint joinpoint = getMethodJoinpoint(object, jpf, name, paramTypes, params);
      return joinpoint.dispatch();
   }
View Full Code Here

         else
            log.trace("Get method Joinpoint jpf=" + jpf + " target=" + object + " name=" + name + " paramTypes=()");
      }

      MethodInfo methodInfo = findMethodInfo(jpf.getClassInfo(), name, paramTypes);
      MethodJoinpoint joinpoint = jpf.getMethodJoinpoint(methodInfo);
      joinpoint.setTarget(object);
      joinpoint.setArguments(params);
      return joinpoint;
   }
View Full Code Here

         else
            log.trace("Get method Joinpoint jpf=" + jpf + " name=" + name + " paramTypes=()");
      }

      MethodInfo methodInfo = findMethodInfo(jpf.getClassInfo(), name, paramTypes, true, true);
      MethodJoinpoint joinpoint = jpf.getMethodJoinpoint(methodInfo);
      joinpoint.setArguments(params);
      return joinpoint;
   }
View Full Code Here

TOP

Related Classes of org.jboss.joinpoint.spi.MethodJoinpoint

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.