Package rocket.generator.rebind

Examples of rocket.generator.rebind.GeneratorContext.branch()


   */
  protected void recordAliases(final Set<Alias> aliases) {
    Checker.notNull("parameter:aliases", aliases);

    final GeneratorContext context = this.getGeneratorContext();
    context.branch();
    context.info("Processing all alias (" + aliases.size() + ") tags.");

    final Iterator<Alias> iterator = aliases.iterator();
    while (iterator.hasNext()) {
      final Alias alias = iterator.next();
View Full Code Here


   */
  protected void buildAspects(final Set<Aspect> aspects) {
    Checker.notNull("parameter:aspects", aspects);

    final GeneratorContext context = this.getGeneratorContext();
    context.branch();
    context.info("Processing and verifying " + aspects.size() + " aspect(s).");

    final MethodMatcherFactory methodMatcherFactory = createMethodMatcherFactory();

    final Iterator<Aspect> iterator = aspects.iterator();
View Full Code Here

    final Iterator<Aspect> iterator = aspects.iterator();
    while (iterator.hasNext()) {
      final Aspect aspect = iterator.next();

      context.branch();
      final String advisorId = aspect.getAdvisor();
      final String targetBeanId = aspect.getTarget();
      context.debug(advisorId + "=" + targetBeanId);

      aspect.setMethodMatcher(methodMatcherFactory.create(aspect.getMethodExpression()));
View Full Code Here

    final Bean bean = this.getBean(id);
    final Type type = bean.getType();
    final MethodMatcher matcher = aspect.getMethodMatcher();

    final GeneratorContext context = this.getGeneratorContext();
    context.branch();
    context.debug("Discovering methods that match: " + matcher + " against " + type);

    final List<Method> matchedMethods = new ArrayList<Method>();
    final Type object = context.getObject();
View Full Code Here

  /**
   * Creates a factory bean for each bean that will be proxied.
   */
  protected void applyAspects() {
    final GeneratorContext context = this.getGeneratorContext();
    context.branch();
    context.info("Checking for beans with one or more aspects.");

    final Set<Bean> beans = this.filterBeansRequiringInterceptors();

    final Iterator<Bean> advisedIterator = beans.iterator();
View Full Code Here

    context.unbranch();
  }

  protected Set<Bean> filterBeansRequiringInterceptors() {
    final GeneratorContext context = this.getGeneratorContext();
    context.branch();
    context.debug("Filtering out Beans that dont have any aspects.");

    final Set<Bean> advised = new HashSet<Bean>();

    final Map<String,Bean> beans = this.getBeans();
View Full Code Here

   */
  protected void buildProxyFactoryBean(final Bean bean) {
    Checker.notNull("parameter:bean", bean);

    final GeneratorContext context = this.getGeneratorContext();
    context.branch();

    final String id = bean.getId();
    context.debug(id);

    final Type superType = this.getProxyFactoryBean();
View Full Code Here

   * Adds a new method to the bean factory being built that populates a map
   * with all the factory beans keyed by bean id.
   */
  protected void overrideBeanFactoryRegisterFactoryBeans() {
    final GeneratorContext context = this.getGeneratorContext();
    context.branch();

    final NewType beanFactory = this.getBeanFactory();
    final Method abstractMethod = beanFactory.getSuperType().getMostDerivedMethod(Constants.REGISTER_FACTORY_BEANS, Collections.<Type>emptyList());

    final NewMethod newMethod = abstractMethod.copy(beanFactory);
View Full Code Here

    newMethod.setNative(false);

    final RegisterFactoryBeansTemplatedFile body = new RegisterFactoryBeansTemplatedFile();
    newMethod.setBody(body);

    context.branch();
    context.info("Overriding " + newMethod + " to register all beans.");

    final Iterator<Bean> beansIterator = this.getBeans().values().iterator();

    while (beansIterator.hasNext()) {
View Full Code Here

    this.overrideBeanFactoryGetAliasesToBeans();
  }

  protected void overrideBeanFactoryGetAliasesToBeans() {
    final GeneratorContext context = this.getGeneratorContext();
    context.branch();

    final NewType beanFactory = this.getBeanFactory();
    final Method abstractMethod = beanFactory.getSuperType().getMostDerivedMethod(Constants.GET_ALIASES_TO_BEANS_METHOD, Collections.<Type>emptyList());

    final NewMethod newMethod = abstractMethod.copy(beanFactory);
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.