Package org.jboss.joinpoint.spi

Examples of org.jboss.joinpoint.spi.MethodJoinpoint


      return invoke(bean, name, (String[]) null, null);
   }

   public Object invoke(Object bean, String name, String[] paramTypes, Object[] params) throws Throwable
   {
      MethodJoinpoint joinpoint = Config.getMethodJoinpoint(bean, getJoinpointFactory(), name, paramTypes, params);
      return joinpoint.dispatch();
   }
View Full Code Here


      return invokeStatic(name, (String[]) null, null);
   }

   public Object invokeStatic(String name, String[] paramTypes, Object[] params) throws Throwable
   {
      MethodJoinpoint joinpoint = Config.getStaticMethodJoinpoint(getJoinpointFactory(), name, paramTypes, params);
      return joinpoint.dispatch();
   }
View Full Code Here

         KernelConfigurator configurator = kernel.getConfigurator();

         Object target = context.getTarget();
         BeanInfo info = context.getBeanInfo();
         BeanMetaData metaData = context.getBeanMetaData();
         MethodJoinpoint joinpoint = invokeInstallLifecycle(trace, context, configurator, target, info, metaData, false);
         if (joinpoint != null)
            dispatchJoinPoint(context, joinpoint);
      }
      else if (trace)
         log.trace("Ignoring " + getDefaultInstallMethod() + " lifecycle invocation.");
View Full Code Here

      String method = getInstallMethod(context);
      List<ParameterMetaData> parameters = getInstallParameters(context);
      ClassLoader cl = Configurator.getClassLoader(metaData);
      try
      {
         MethodJoinpoint joinpoint;
         if (unget)
            joinpoint = configurator.ungetMethodJoinPoint(info, cl, method, parameters, false, true);
         else
            joinpoint = configurator.getMethodJoinPoint(info, cl, method, parameters, false, true);
         joinpoint.setTarget(target);
         return joinpoint;
      }
      catch (JoinpointException ignored)
      {
         if (trace)
View Full Code Here

      if (isInstallInvocationIgnored(context) == false)
      {
         try
         {
            MethodJoinpoint joinpoint = invokeInstallLifecycle(trace, context, configurator, target, info, metaData, true);
            joinpoint.setTarget(target);
            cleanupJoinPoint(context, joinpoint);
         }
         catch (Throwable ignored)
         {
         }
      }

      if (isUninstallInvocationIgnored(context) == false)
      {
         String method = getUninstallMethod(context);
         List<ParameterMetaData> parameters = getUninstallParameters(context);
         MethodJoinpoint joinpoint;
         try
         {
            ClassLoader cl = Configurator.getClassLoader(metaData);
            try
            {
               joinpoint = configurator.getMethodJoinPoint(info, cl, method, parameters, false, true);
               joinpoint.setTarget(target);
               dispatchJoinPoint(context, joinpoint);
            }
            finally
            {
               joinpoint = configurator.ungetMethodJoinPoint(info, cl, method, parameters, false, true);
               joinpoint.setTarget(target);
               cleanupJoinPoint(context, joinpoint);
            }
         }
         catch (JoinpointException ignored)
         {
View Full Code Here

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

            // Get the parameters
            List<ParameterMetaData> parameters = metaData.getParameters();
            // Describe the factory
            BeanInfo factoryInfo = config.getBeanInfo(factory.getClass());
            // Find the method
            MethodJoinpoint joinPoint = handleMethod(trace, factoryInfo, cl, metaData.getFactoryMethod(), parameters, false, true, unget);
            joinPoint.setTarget(factory);
            return joinPoint;
         }

         String factoryClassName = metaData.getFactoryClass();
         if (factoryClassName != null)
         {
            // Get the parameters
            List<ParameterMetaData> parameters = metaData.getParameters();
            BeanInfo factoryInfo = config.getBeanInfo(factoryClassName, cl);
            // Find the method
            return handleMethod(trace, factoryInfo, cl, metaData.getFactoryMethod(), parameters, true, true, unget);
         }

         // Find the constructor
         ConstructorJoinpoint joinPoint = findConstructor(trace, info, metaData, object);
         ConstructorInfo cinfo = joinPoint.getConstructorInfo();
         // Set the parameters
         if (cinfo != null)
         {
            TypeInfo[] pinfos = cinfo.getParameterTypes();
            Object[] params = handleParameters(trace, cl, pinfos, metaData.getParameters(), unget);
            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, isStatic, isPublic);
      JoinpointFactory jpf = info.getJoinpointFactory();
      MethodJoinpoint joinPoint = jpf.getMethodJoinpoint(minfo);

      // Set the parameters
      if (minfo != null)
      {
         TypeInfo[] pinfos = minfo.getParameterTypes();
         Object[] params = handleParameters(trace, cl, pinfos, parameters, unget);
         joinPoint.setArguments(params);
      }

      return joinPoint;
   }
View Full Code Here

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

         Object target = context.getTarget();
         BeanInfo info = context.getBeanInfo();
         BeanMetaData metaData = context.getBeanMetaData();
         String method = getInstallMethod(context);
         List<ParameterMetaData> parameters = getInstallParameters(context);
         MethodJoinpoint joinpoint;
         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);
      }
      else if (trace)
         log.trace("Ignoring " + getDefaultInstallMethod() + " lifecycle invocation.");
   }
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.