Examples of FastClass


Examples of net.sf.cglib.reflect.FastClass

  public ReflectionOptimizer getReflectionOptimizer(
      Class clazz,
          String[] getterNames,
          String[] setterNames,
          Class[] types) {
    FastClass fastClass;
    BulkBean bulkBean;
    try {
      fastClass = FastClass.create( clazz );
      bulkBean = BulkBean.create( clazz, getterNames, setterNames, types );
      if ( !clazz.isInterface() && !Modifier.isAbstract( clazz.getModifiers() ) ) {
        if ( fastClass == null ) {
          bulkBean = null;
        }
        else {
          //test out the optimizer:
          Object instance = fastClass.newInstance();
          bulkBean.setPropertyValues( instance, bulkBean.getPropertyValues( instance ) );
        }
      }
    }
    catch( Throwable t ) {
View Full Code Here

Examples of net.sf.cglib.reflect.FastClass

  public ReflectionOptimizer getReflectionOptimizer(
      Class clazz,
          String[] getterNames,
          String[] setterNames,
          Class[] types) {
    FastClass fastClass;
    BulkBean bulkBean;
    try {
      fastClass = FastClass.create( clazz );
      bulkBean = BulkBean.create( clazz, getterNames, setterNames, types );
      if ( !clazz.isInterface() && !Modifier.isAbstract( clazz.getModifiers() ) ) {
        if ( fastClass == null ) {
          bulkBean = null;
        }
        else {
          //test out the optimizer:
          Object instance = fastClass.newInstance();
          bulkBean.setPropertyValues( instance, bulkBean.getPropertyValues( instance ) );
        }
      }
    }
    catch( Throwable t ) {
View Full Code Here

Examples of net.sf.cglib.reflect.FastClass

        }
      };
    }

    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);
View Full Code Here

Examples of net.sf.cglib.reflect.FastClass

  public ReflectionOptimizer getReflectionOptimizer(
      Class clazz,
          String[] getterNames,
          String[] setterNames,
          Class[] types) {
    FastClass fastClass;
    BulkBean bulkBean;
    try {
      fastClass = FastClass.create( clazz );
      bulkBean = BulkBean.create( clazz, getterNames, setterNames, types );
      if ( !clazz.isInterface() && !Modifier.isAbstract( clazz.getModifiers() ) ) {
        if ( fastClass == null ) {
          bulkBean = null;
        }
        else {
          //test out the optimizer:
          Object instance = fastClass.newInstance();
          bulkBean.setPropertyValues( instance, bulkBean.getPropertyValues( instance ) );
        }
      }
    }
    catch( Throwable t ) {
View Full Code Here

Examples of net.sf.cglib.reflect.FastClass

  public ReflectionOptimizer getReflectionOptimizer(
      Class clazz,
          String[] getterNames,
          String[] setterNames,
          Class[] types) {
    FastClass fastClass;
    BulkBean bulkBean;
    try {
      fastClass = FastClass.create( clazz );
      bulkBean = BulkBean.create( clazz, getterNames, setterNames, types );
      if ( !clazz.isInterface() && !Modifier.isAbstract( clazz.getModifiers() ) ) {
        if ( fastClass == null ) {
          bulkBean = null;
        }
        else {
          //test out the optimizer:
          Object instance = fastClass.newInstance();
          bulkBean.setPropertyValues( instance, bulkBean.getPropertyValues( instance ) );
        }
      }
    }
    catch( Throwable t ) {
View Full Code Here

Examples of net.sf.cglib.reflect.FastClass

  /**
   * 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);
View Full Code Here

Examples of net.sf.cglib.reflect.FastClass

            return method.invoke(target, parameters);
          }
        };
      }
      else {
        FastClass fastClass = GuiceFastClass.create(method.getDeclaringClass());
        final FastMethod fastMethod = fastClass.getMethod(method);

        this.methodInvoker = new MethodInvoker() {
          public Object invoke(Object target, Object... parameters)
          throws IllegalAccessException, InvocationTargetException {
            Objects.assertNoNulls(parameters);
View Full Code Here

Examples of net.sf.cglib.reflect.FastClass

        return gbeanInvoker.invoke(objectName, args);
    }

    private ProxyInvoker[] createGBeanInvokers(Kernel kernel) {
        // build the method lookup table
        FastClass fastClass = FastClass.create(proxyType);
        ProxyInvoker[] invokers = new ProxyInvoker[fastClass.getMaxIndex() + 1];
        Method[] methods = proxyType.getMethods();
        for (Method method : methods) {
            int interfaceIndex = getSuperIndex(proxyType, method);
            if (interfaceIndex >= 0) {
                invokers[interfaceIndex] = createProxyInvoker(kernel, method);
View Full Code Here

Examples of net.sf.cglib.reflect.FastClass

    private ProxyInvoker[] createRawGBeanInvokers(RawInvoker rawInvoker, Class proxyType) {
        Map operations = rawInvoker.getOperationIndex();
        Map attributes = rawInvoker.getAttributeIndex();

        // build the method lookup table
        FastClass fastClass = FastClass.create(proxyType);
        ProxyInvoker[] invokers = new ProxyInvoker[fastClass.getMaxIndex() + 1];
        Method[] methods = proxyType.getMethods();
        for (int i = 0; i < methods.length; i++) {
            Method method = methods[i];
            int interfaceIndex = getSuperIndex(proxyType, method);
            if (interfaceIndex >= 0) {
View Full Code Here

Examples of net.sf.cglib.reflect.FastClass

            GOperationInfo operationInfo = (GOperationInfo) iterator.next();
            operationSignatures.add(new GOperationSignature(operationInfo.getName(), operationInfo.getParameterList()));
        }

        // build the method lookup table
        FastClass fastClass = FastClass.create(proxyType);
        ProxyInvoker[] invokers = new ProxyInvoker[fastClass.getMaxIndex() + 1];
        Method[] methods = proxyType.getMethods();
        for (int i = 0; i < methods.length; i++) {
            Method method = methods[i];
            int interfaceIndex = getSuperIndex(proxyType, method);
            if (interfaceIndex >= 0) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.