Package net.sf.cglib.reflect

Examples of net.sf.cglib.reflect.FastConstructor


            throw new DeploymentException("Could not write out class bytes", e);
        } catch (URISyntaxException e) {
            throw new DeploymentException("Could not constuct URI for location of enhanced class", e);
        }
        Enhancer.registerCallbacks(serviceClass, methodInterceptors);
        FastConstructor constructor = FastClass.create(serviceClass).getConstructor(SERVICE_CONSTRUCTOR_TYPES);
        try {
            return constructor.newInstance(new Object[]{seiPortNameToFactoryMap, seiClassNameToFactoryMap});
        } catch (InvocationTargetException e) {
            throw new DeploymentException("Could not construct service instance", e.getTargetException());
        }
    }
View Full Code Here


        enhancer.setUseFactory(false);
        enhancer.setUseCache(false);
        Class serviceClass = enhancer.createClass();

        Enhancer.registerCallbacks(serviceClass, methodInterceptors);
        FastConstructor constructor = FastClass.create(serviceClass).getConstructor(SERVICE_CONSTRUCTOR_TYPES);
        try {
            return constructor.newInstance(new Object[]{seiPortNameToFactoryMap, seiClassNameToFactoryMap});
        } catch (InvocationTargetException e) {
            throw (NamingException)new NamingException("Could not construct service instance").initCause(e.getTargetException());
        }
    }
View Full Code Here

        enhancer.setUseCache(false);
        Class serviceClass = enhancer.createClass();

        Enhancer.registerCallbacks(serviceClass, methodInterceptors);

        FastConstructor constructor =
            FastClass.create(serviceClass).getConstructor(URL_SERVICE_NAME_CONSTRUCTOR);
        Object[] arguments =
            new Object[]{wsdlLocation, serviceName};

        LOG.debug("Initializing service with: " + wsdlLocation + " " + serviceName);

        try {
            return (Service)constructor.newInstance(arguments);
        } catch (InvocationTargetException e) {
            NamingException exception = new NamingException("Could not construct service proxy");
            exception.initCause(e.getTargetException());
            throw exception;
        }
View Full Code Here

      };
    }

    Class<T> classToConstruct = constructor.getDeclaringClass();
    FastClass fastClass = GuiceFastClass.create(classToConstruct);
    final FastConstructor fastConstructor
        = fastClass.getConstructor(constructor);
    return new ConstructionProxy<T>() {
      @SuppressWarnings("unchecked")
      public T newInstance(Object... arguments)
          throws InvocationTargetException {
        Objects.assertNoNulls(arguments);
        return (T) fastConstructor.newInstance(arguments);
      }
    };
  }
View Full Code Here

   * Creates a construction proxy given a class and parameter types.
   */
  <T> ConstructionProxy<T> createConstructionProxy(Class<?> clazz,
      Class[] parameterTypes) {
    FastClass fastClass = GuiceFastClass.create(clazz);
    final FastConstructor fastConstructor
        = fastClass.getConstructor(parameterTypes);
    return new ConstructionProxy<T>() {
      @SuppressWarnings("unchecked")
      public T newInstance(Object... arguments)
          throws InvocationTargetException {
        Objects.assertNoNulls(arguments);
        return (T) fastConstructor.newInstance(arguments);
      }
    };
  }
View Full Code Here

        enhancer.setUseFactory(false);
        enhancer.setUseCache(false);
        Class serviceClass = enhancer.createClass();

        Enhancer.registerCallbacks(serviceClass, methodInterceptors);
        FastConstructor constructor = FastClass.create(serviceClass).getConstructor(SERVICE_CONSTRUCTOR_TYPES);
        try {
            return constructor.newInstance(new Object[]{seiPortNameToFactoryMap, seiClassNameToFactoryMap});
        } catch (InvocationTargetException e) {
            throw (NamingException)new NamingException("Could not construct service instance").initCause(e.getTargetException());
        }
    }
View Full Code Here

        enhancer.setUseFactory(false);
        enhancer.setUseCache(false);
        Class serviceClass = enhancer.createClass();

        Enhancer.registerCallbacks(serviceClass, methodInterceptors);
        FastConstructor constructor = FastClass.create(serviceClass).getConstructor(SERVICE_CONSTRUCTOR_TYPES);
        try {
            return constructor.newInstance(new Object[]{seiPortNameToFactoryMap, seiClassNameToFactoryMap});
        } catch (InvocationTargetException e) {
            throw (NamingException)new NamingException("Could not construct service instance").initCause(e.getTargetException());
        }
    }
View Full Code Here

            String message = "Invalid assignment of expression " + i + " returning type '" + columnType +
                    "', column and parameter types mismatch";
            throw new ExprValidationException(message);
        }

        FastConstructor fctor;
        try {
            Constructor ctor = engineImportService.resolveCtor(beanEventType.getUnderlyingType(), ctorTypes);
            FastClass fastClass = FastClass.create(beanEventType.getUnderlyingType());
            fctor = fastClass.getConstructor(ctor);
        }
View Full Code Here

            String message = "Invalid assignment of expression " + i + " returning type '" + columnType +
                    "', column and parameter types mismatch";
            throw new ExprValidationException(message);
        }

        FastConstructor fctor;
        try {
            Constructor ctor = methodResolutionService.resolveCtor(beanEventType.getUnderlyingType(), ctorTypes);
            FastClass fastClass = FastClass.create(beanEventType.getUnderlyingType());
            fctor = fastClass.getConstructor(ctor);
        }
View Full Code Here

        enhancer.setUseFactory(false);
        enhancer.setUseCache(false);
        Class serviceClass = enhancer.createClass();

        Enhancer.registerCallbacks(serviceClass, methodInterceptors);
        FastConstructor constructor = FastClass.create(serviceClass).getConstructor(SERVICE_CONSTRUCTOR_TYPES);
        try {
            return constructor.newInstance(new Object[]{seiPortNameToFactoryMap, seiClassNameToFactoryMap});
        } catch (InvocationTargetException e) {
            throw (NamingException)new NamingException("Could not construct service instance").initCause(e.getTargetException());
        }
    }
View Full Code Here

TOP

Related Classes of net.sf.cglib.reflect.FastConstructor

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.