org.springframework.context.annotation.Scope.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(225)

本文整理了Java中org.springframework.context.annotation.Scope.<init>()方法的一些代码示例,展示了Scope.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Scope.<init>()方法的具体详情如下:
包路径:org.springframework.context.annotation.Scope
类名称:Scope
方法名:<init>

Scope.<init>介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-framework

@Component
@Scope(proxyMode = ScopedProxyMode.TARGET_CLASS)
static class CglibProxyWithPrivateMethod extends AbstractTestEventListener {
  @EventListener
  private void handleIt(TestEvent event) {
    collectEvent(event);
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Bean
  @Scope("prototype")
  @SuppressWarnings("rawtypes")
  public Repository genericRepo() {
    return new Repository<Object>() {
      @Override
      public String toString() {
        return "Repository<Object>";
      }
    };
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Bean
@Scope(scopeName = "prototype", proxyMode = ScopedProxyMode.TARGET_CLASS)
public Repository<String> stringRepo() {
  return new Repository<String>() {
    @Override
    public String toString() {
      return "Repository<String>";
    }
  };
}

代码示例来源:origin: spring-projects/spring-framework

@Component
@Scope(scopeName = "custom", proxyMode = ScopedProxyMode.TARGET_CLASS)
static class CustomScopeTestBean extends AbstractTestEventListener {
  @EventListener
  public void handleIt(TestEvent event) {
    collectEvent(event);
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Bean
@Scope("prototype")
public Repository<Integer> integerRepo() {
  return new Repository<Integer>() {
    @Override
    public String toString() {
      return "Repository<Integer>";
    }
  };
}

代码示例来源:origin: spring-projects/spring-framework

@Component
@Scope(proxyMode = ScopedProxyMode.INTERFACES, value = "prototype")
public static class StateImpl implements State {
  public String anyMethod() {
    return "anyMethod called";
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Bean
@Scope("prototype")
public Repository<String> stringRepo() {
  return new Repository<String>() {
    @Override
    public String toString() {
      return "Repository<String>";
    }
  };
}

代码示例来源:origin: spring-projects/spring-framework

@Component
  @Scope(value = "prototype", proxyMode = ScopedProxyMode.TARGET_CLASS)
  protected static class L2ConfigEmpty {
  }
}

代码示例来源:origin: spring-cloud-incubator/spring-cloud-alibaba

@Bean
@Scope("prototype")
@ConditionalOnClass(name = "com.netflix.hystrix.HystrixCommand")
@ConditionalOnProperty(name = "feign.hystrix.enabled", havingValue = "true")
Feign.Builder feignHystrixBuilder(BeanFactory beanFactory) {
  return FescarHystrixFeignBuilder.builder(beanFactory);
}

代码示例来源:origin: spring-projects/spring-framework

@Component
@Scope(proxyMode = ScopedProxyMode.TARGET_CLASS)
static class CglibProxyTestBean extends AbstractTestEventListener {
  @EventListener
  public void handleIt(TestEvent event) {
    collectEvent(event);
  }
}

代码示例来源:origin: spring-cloud-incubator/spring-cloud-alibaba

@Bean
@Scope("prototype")
@ConditionalOnClass(name = "com.alibaba.csp.sentinel.SphU")
@ConditionalOnProperty(name = "feign.sentinel.enabled", havingValue = "true")
Feign.Builder feignSentinelBuilder(BeanFactory beanFactory) {
  return FescarSentinelFeignBuilder.builder(beanFactory);
}

代码示例来源:origin: spring-projects/spring-framework

@Component
  @Scope("prototype")
  static class L1ConfigEmpty {
    @Component
    @Scope(value = "prototype", proxyMode = ScopedProxyMode.TARGET_CLASS)
    protected static class L2ConfigEmpty {
    }
  }
}

代码示例来源:origin: spring-cloud-incubator/spring-cloud-alibaba

@Bean
@ConditionalOnMissingBean
@Scope("prototype")
Feign.Builder feignBuilder(BeanFactory beanFactory) {
  return FescarFeignBuilder.builder(beanFactory);
}

代码示例来源:origin: spring-projects/spring-framework

@Component
  @Scope("prototype")
  static class L1ConfigEmpty {
    @Component
    @Scope(value = "prototype", proxyMode = ScopedProxyMode.TARGET_CLASS)
    protected static class L2ConfigEmpty {
    }
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Bean @Scope(proxyMode=ScopedProxyMode.INTERFACES)
  public Object invalidProxyOnPredefinedScopes() {
    return new Object();
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Component("target")
@Scope(proxyMode = ScopedProxyMode.TARGET_CLASS)
static class ProxiedCronTestBean {
  @Scheduled(cron = "*/7 * * * * ?")
  public void cron() throws IOException {
    throw new IOException("no no no");
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Bean(name = "myObjectTarget")
  @Scope(scopeName = "prototype")
  public Object myObjectTarget() {
    return new Object();
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Component
  @Scope(value = "prototype", proxyMode = ScopedProxyMode.TARGET_CLASS)
  protected static class L2ConfigEmpty {
  }
}

代码示例来源:origin: spring-cloud-incubator/spring-cloud-alibaba

@Bean
@Scope("prototype")
@ConditionalOnMissingBean
@ConditionalOnProperty(name = "feign.sentinel.enabled")
public Feign.Builder feignSentinelBuilder() {
  return SentinelFeign.builder();
}

代码示例来源:origin: spring-projects/spring-framework

@Component
@Scope(proxyMode = ScopedProxyMode.INTERFACES)
static class AnnotatedProxyTestBean extends AbstractIdentifiable implements AnnotatedSimpleService {
  @Autowired
  private EventCollector eventCollector;
  @Override
  public void handleIt(TestEvent event) {
    this.eventCollector.addEvent(this, event);
  }
}

相关文章

Scope类方法