Package rocket.generator.rebind.type

Examples of rocket.generator.rebind.type.NewNestedType


   *            The bean being proxied.
   */
  protected void overrideProxyFactoryBeanCreateProxy(final Bean bean) {
    Checker.notNull("parameter:bean", bean);

    final NewNestedType proxyFactoryBean = bean.getProxyFactoryBean();
    final List<Type> objectParameterList = this.getParameterListWithOnlyObject();
    final Method method = proxyFactoryBean.getMostDerivedMethod(Constants.CREATE_PROXY, objectParameterList);

    final NewMethod newMethod = method.copy(proxyFactoryBean);
    newMethod.setAbstract(false);
    newMethod.setFinal(true);
    newMethod.setNative(false);
View Full Code Here


    }

    // start creating the factory bean...
    final Type superType = singleton ? this.getSingletonFactoryBean() : this.getPrototypeFactoryBean();
    final NewConcreteType beanFactory = this.getBeanFactory();
    final NewNestedType factoryBean = beanFactory.newNestedType();
    factoryBean.setStatic(false);
    factoryBean.setNestedName(this.escapeBeanIdToBeClassNameSafe(beanName) + Constants.FACTORY_BEAN_SUFFIX);
    factoryBean.setSuperType(superType);
    factoryBean.setVisibility(Visibility.PRIVATE);

    // add an annotation that declares the actual bean type.
    factoryBean.addMetaData(Constants.FACTORY_BEAN_OBJECT_TYPE, bean.getType().getName());

    bean.setFactoryBean(factoryBean);
    context.debug("FactoryBean: " + factoryBean.getName());

    this.addBean(bean);
  }
View Full Code Here

    context.debug("service interface: " + interfaceName);
    context.debug("async service interface: " + beanType.getName());

    final Type superType = this.getSingletonFactoryBean();
    final NewConcreteType beanFactory = this.getBeanFactory();
    final NewNestedType factoryBean = beanFactory.newNestedType();
    factoryBean.setStatic(false);
    factoryBean.setNestedName(this.escapeBeanIdToBeClassNameSafe(id) + Constants.FACTORY_BEAN_SUFFIX);
    factoryBean.setSuperType(superType);
    factoryBean.setVisibility(Visibility.PRIVATE);
    rpc.setFactoryBean(factoryBean);

    context.debug("FactoryBean: " + factoryBean.getName());

    this.addBean(rpc);
  }
View Full Code Here

    context.debug(id);

    final Type superType = this.getProxyFactoryBean();

    final NewConcreteType beanFactory = this.getBeanFactory();
    final NewNestedType proxyFactoryBean = beanFactory.newNestedType();
    proxyFactoryBean.setStatic(false);
    proxyFactoryBean.setNestedName(this.escapeBeanIdToBeClassNameSafe(id) + Constants.PROXY_FACTORY_BEAN_SUFFIX);
    proxyFactoryBean.setSuperType(superType);
    proxyFactoryBean.setVisibility(Visibility.PRIVATE);

    bean.setProxyFactoryBean(proxyFactoryBean);

    context.debug("ProxyFactoryBean superType: " + superType);

    final NewNestedType proxy = this.createProxy(bean);
    bean.setProxy(proxy);

    this.overrideProxyFactoryBeanCreateProxy(bean);
  }
View Full Code Here

    final Type targetBeanType = bean.getType();
    final String id = bean.getId();

    // sub class the target...
    final NewConcreteType beanFactory = this.getBeanFactory();
    final NewNestedType proxy = beanFactory.newNestedType();
    proxy.setStatic(false);
    proxy.setNestedName(this.escapeBeanIdToBeClassNameSafe(id) + Constants.PROXY_SUFFIX);

    if (bean instanceof Rpc) {
      proxy.addInterface(targetBeanType);
    } else {
      proxy.setSuperType(targetBeanType);
    }
    proxy.setVisibility(Visibility.PRIVATE);

    // add a no arguments constructor...
    final NewConstructor constructor = proxy.newConstructor();
    constructor.setBody(EmptyCodeBlock.INSTANCE);
    constructor.setVisibility(Visibility.PUBLIC);

    // add a field of type target bean this will be set by the
    // ProxyFactoryBean.createProxy0 method.
    final NewField field = proxy.newField();
    field.setFinal(false);
    field.setName(Constants.PROXY_TARGET_FIELD);
    field.setStatic(false);
    field.setTransient(false);
    field.setType(targetBeanType);
View Full Code Here

TOP

Related Classes of rocket.generator.rebind.type.NewNestedType

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.