Java 类org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean 实例源码

项目:spring-i18n-support    文件:SpringI18nSupportAutoConfiguration.java   
@Bean(name = "jdbcMessageSourceDao")
@ConditionalOnMissingBean
public SimpleJdbcMessageSourceDao jdbcMessageSourceDa(DataSource dataSource) {
    SimpleJdbcMessageSourceDao jdbcMessageSourceDao = new SimpleJdbcMessageSourceDao();
    jdbcMessageSourceDao.setDataSource(dataSource);
    if (hasText(getTableName())) {
        jdbcMessageSourceDao.setTable(getTableName());
    }
    if (hasText(getMessageColumnName())) {
        jdbcMessageSourceDao.setMessage(getMessageColumnName());
    }
    if (hasText(getTypeColumnName())) {
        jdbcMessageSourceDao.setType(getTypeColumnName());
    }
    if (hasText(getCodeIdColumnName())) {
        jdbcMessageSourceDao.setCodeId(getCodeIdColumnName());
    }
    if (hasText(getLangIdColumnName())) {
        jdbcMessageSourceDao.setLangId(getLangIdColumnName());
    }
    return jdbcMessageSourceDao;
}
项目:spring-security-oauth2-boot    文件:ResourceServerTokenServicesConfiguration.java   
@Bean
@ConditionalOnMissingBean({ ConnectionFactoryLocator.class,
        ResourceServerTokenServices.class })
public UserInfoTokenServices userInfoTokenServices() {
    UserInfoTokenServices services = new UserInfoTokenServices(
            this.sso.getUserInfoUri(), this.sso.getClientId());
    services.setTokenType(this.sso.getTokenType());
    services.setRestTemplate(this.restTemplate);
    if (this.authoritiesExtractor != null) {
        services.setAuthoritiesExtractor(this.authoritiesExtractor);
    }
    if (this.principalExtractor != null) {
        services.setPrincipalExtractor(this.principalExtractor);
    }
    return services;
}
项目:cas-5.1.0    文件:CasValidationConfiguration.java   
@Autowired
@Bean
@ConditionalOnMissingBean(name = "proxyValidateController")
public ProxyValidateController proxyValidateController(@Qualifier("argumentExtractor") final ArgumentExtractor argumentExtractor,
                                                       @Qualifier("defaultAuthenticationSystemSupport")
                                                       final AuthenticationSystemSupport authenticationSystemSupport) {
    final ProxyValidateController c = new ProxyValidateController();
    c.setValidationSpecification(cas20ProtocolValidationSpecification);
    c.setSuccessView(cas3ServiceSuccessView());
    c.setFailureView(cas3ServiceFailureView);
    c.setProxyHandler(proxy20Handler);
    c.setAuthenticationSystemSupport(authenticationSystemSupport);
    c.setServicesManager(servicesManager);
    c.setCentralAuthenticationService(centralAuthenticationService);
    c.setArgumentExtractor(argumentExtractor);
    c.setMultifactorTriggerSelectionStrategy(multifactorTriggerSelectionStrategy);
    c.setAuthenticationContextValidator(authenticationContextValidator);
    c.setJsonView(cas3ServiceJsonView());
    c.setAuthnContextAttribute(casProperties.getAuthn().getMfa().getAuthenticationContextAttribute());
    return c;
}
项目:spring-boot-starter-rocketmq    文件:RocketMQAutoConfiguration.java   
@Bean
@ConditionalOnClass(DefaultMQProducer.class)
@ConditionalOnMissingBean(DefaultMQProducer.class)
@ConditionalOnProperty(prefix = "spring.rocketmq", value = {"nameServer", "producer.group"})
public DefaultMQProducer mqProducer(RocketMQProperties rocketMQProperties) {

    RocketMQProperties.Producer producerConfig = rocketMQProperties.getProducer();
    String groupName = producerConfig.getGroup();
    Assert.hasText(groupName, "[spring.rocketmq.producer.group] must not be null");

    DefaultMQProducer producer = new DefaultMQProducer(producerConfig.getGroup());
    producer.setNamesrvAddr(rocketMQProperties.getNameServer());
    producer.setSendMsgTimeout(producerConfig.getSendMsgTimeout());
    producer.setRetryTimesWhenSendFailed(producerConfig.getRetryTimesWhenSendFailed());
    producer.setRetryTimesWhenSendAsyncFailed(producerConfig.getRetryTimesWhenSendAsyncFailed());
    producer.setMaxMessageSize(producerConfig.getMaxMessageSize());
    producer.setCompressMsgBodyOverHowmuch(producerConfig.getCompressMsgBodyOverHowmuch());
    producer.setRetryAnotherBrokerWhenNotStoreOK(producerConfig.isRetryAnotherBrokerWhenNotStoreOk());

    return producer;
}
项目:tensorflow    文件:TensorflowCommonProcessorConfiguration.java   
@Bean
@ConditionalOnMissingBean(name = "tensorflowInputConverter")
@SuppressWarnings("unchecked")
public TensorflowInputConverter tensorflowInputConverter() {
    return new TensorflowInputConverter() {

        @Override
        public Map<String, Object> convert(Object input, Map<String, Object> processorContext) {

            if (input instanceof Map) {
                return (Map<String, Object>) input;
            }

            throw new MessageConversionException("Unsupported input format: " + input);
        }
    };
}
项目:cas-5.1.0    文件:CasPersonDirectoryConfiguration.java   
@ConditionalOnMissingBean(name = "attributeRepositories")
@Bean
@RefreshScope
public List<IPersonAttributeDao> attributeRepositories() {
    final List<IPersonAttributeDao> list = new ArrayList<>();

    list.addAll(ldapAttributeRepositories());
    list.addAll(jdbcAttributeRepositories());
    list.addAll(jsonAttributeRepositories());
    list.addAll(groovyAttributeRepositories());
    list.addAll(grouperAttributeRepositories());
    list.addAll(stubAttributeRepositories());

    OrderComparator.sort(list);

    LOGGER.debug("Final list of attribute repositories is [{}]", list);
    return list;
}
项目:logger-spring-boot    文件:LoggerConfiguration.java   
@Bean
@ConditionalOnMissingBean(LoggerFormats.class)
public LoggerFormats loggerFormats() {
    return LoggerFormats.builder()
            .enter("#${method.name}(${method.args}): "
                    + "entered")
            .warnBefore("#${method.name}(${method.args}): "
                    + "in ${method.duration} and still running (max ${method.warn.duration})")
            .warnAfter("#${method.name}(${method.args}): "
                    + "${method.result} in ${method.duration} (max ${method.warn.duration})")
            .after("#${method.name}(${method.args}): "
                    + "${method.result} in ${method.duration}")
            .error("#${method.name}(${method.args}): "
                    + "thrown ${error.class.name}(${error.message}) "
                    + "from ${error.source.class.name}[${error.source.line}] in ${method.duration}")
            .build();
}
项目:data-tarantool-spring-boot-starter    文件:TarantoolAutoConfiguration.java   
@Bean(destroyMethod = "close")
@ConditionalOnMissingBean(name = "tarantoolClient")
public TarantoolClient tarantoolClient(
    SocketChannelProvider socketChannelProvider,
    TarantoolClientConfig config
) {
    return new TarantoolClientImpl(socketChannelProvider, config);
}
项目:cas-5.1.0    文件:CasCoreWebflowConfiguration.java   
@ConditionalOnMissingBean(name = "multifactorAuthenticationProviderSelector")
@Bean
@RefreshScope
public MultifactorAuthenticationProviderSelector multifactorAuthenticationProviderSelector() {
    final Resource script = casProperties.getAuthn().getMfa().getProviderSelectorGroovyScript();
    if (script != null) {
        return new GroovyScriptMultifactorAuthenticationProviderSelector(script);
    }

    return new RankedMultifactorAuthenticationProviderSelector();
}
项目:nakadi-producer-spring-boot-starter    文件:NakadiProducerAutoConfiguration.java   
@Bean(destroyMethod = "stop")
@ConditionalOnProperty({ "nakadi-producer.access-token-uri", "nakadi-producer.access-token-scopes" })
@ConditionalOnMissingBean(AccessTokenProvider.class)
public StupsTokenComponent accessTokenProvider(
        @Value("${nakadi-producer.access-token-uri}") URI accessTokenUri,
        @Value("${nakadi-producer.access-token-scopes}") String[] accessTokenScopes) {
    return new StupsTokenComponent(accessTokenUri, Arrays.asList(accessTokenScopes));
}
项目:mybatis-migrations-spring-boot-autoconfigure    文件:MyBatisMigrationsAutoConfiguration.java   
/**
 * CLI handler bean
 * @param springApplicationArguments for CLI args
 * @return constructed MyBatisMigrationsCliHandler bean
 */
@Bean(name = MY_BATIS_MIGRATIONS_CLI_HANDLER_BEAN)
@ConditionalOnMissingBean
public MyBatisMigrationsCliHandler myBatisMigrationsCliHandler(
        ApplicationArguments springApplicationArguments) {
    return new MyBatisMigrationsCliHandler(springApplicationArguments.getSourceArgs());
}
项目:connectors    文件:ActiveMQRespondMapConnectorAutoConfiguration.java   
@Lazy
@Bean(name = "activemq-respond-map-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public ActiveMQRespondMapComponent configureActiveMQRespondMapComponent()
        throws Exception {
    ActiveMQRespondMapComponent connector = new ActiveMQRespondMapComponent();
    connector.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, connector,
            parameters, false);
    connector.setOptions(parameters);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ConnectorCustomizer<ActiveMQRespondMapComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator
                            .evaluate(
                                    applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.activemq-respond-map.customizer",
                                    ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator
                            .evaluate(applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.activemq-respond-map.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure connector {}, with customizer {}",
                        connector, customizer);
                customizer.customize(connector);
            }
        }
    }
    return connector;
}
项目:cmeter    文件:ClickHouseExporterAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean
public ClickHouseDataSource clickHouseDataSource(Environment environment,
                                                 ClickHouseProperties clickHouseProperties) {
    return new ClickHouseDataSource(
            environment.getProperty("clickhouse.metrics.datasource.url", CLICKHOUSE_JDBC_URL),
            clickHouseProperties);
}
项目:cas-5.1.0    文件:CasSupportActionsConfiguration.java   
@RefreshScope
@ConditionalOnMissingBean(name = "sendTicketGrantingTicketAction")
@Bean
public Action sendTicketGrantingTicketAction() {
    return new SendTicketGrantingTicketAction(centralAuthenticationService, servicesManager, ticketGrantingTicketCookieGenerator,
            casProperties.getSso().isRenewedAuthn());
}
项目:FastBootWeixin    文件:WxWebConfiguration.java   
@Bean
@ConditionalOnMissingBean
public WxSessionManager wxSessionManager() {
    return new DefaultWxSessionManager(wxProperties.getServer().getSessionTimeout(),
            wxProperties.getServer().getMaxActiveLimit(),
            BeanUtils.instantiate(wxProperties.getServer().getWxSessionIdGeneratorClass()));
}
项目:cas-5.1.0    文件:CasCoreWebflowConfiguration.java   
@ConditionalOnMissingBean(name = "globalAuthenticationPolicyWebflowEventResolver")
@Bean
@RefreshScope
public CasWebflowEventResolver globalAuthenticationPolicyWebflowEventResolver() {
    return new GlobalMultifactorAuthenticationPolicyEventResolver(authenticationSystemSupport,
            centralAuthenticationService, servicesManager,
            ticketRegistrySupport, warnCookieGenerator,
            authenticationRequestServiceSelectionStrategies, selector, casProperties);
}
项目:connectors    文件:SalesforceDeleteSObjectConnectorAutoConfiguration.java   
@Lazy
@Bean(name = "salesforce-delete-sobject-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public SalesforceDeleteSObjectComponent configureSalesforceDeleteSObjectComponent()
        throws Exception {
    SalesforceDeleteSObjectComponent connector = new SalesforceDeleteSObjectComponent();
    connector.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, connector,
            parameters, false);
    connector.setOptions(parameters);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ConnectorCustomizer<SalesforceDeleteSObjectComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator
                            .evaluate(
                                    applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.salesforce-delete-sobject.customizer",
                                    ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator
                            .evaluate(applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.salesforce-delete-sobject.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure connector {}, with customizer {}",
                        connector, customizer);
                customizer.customize(connector);
            }
        }
    }
    return connector;
}
项目:mapper-boot-starter    文件:MapperAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean
public SqlSessionTemplate sqlSessionTemplate(SqlSessionFactory sqlSessionFactory) {
    ExecutorType executorType = this.properties.getExecutorType();
    if (executorType != null) {
        return new SqlSessionTemplate(sqlSessionFactory, executorType);
    } else {
        return new SqlSessionTemplate(sqlSessionFactory);
    }
}
项目:cas-5.1.0    文件:CasCoreServicesConfiguration.java   
@Autowired
@ConditionalOnMissingBean(name = "jsonServiceRegistryDao")
@Bean
public ServiceRegistryInitializer serviceRegistryInitializer(@Qualifier(BEAN_NAME_SERVICE_REGISTRY_DAO) final ServiceRegistryDao serviceRegistryDao) {
    return new ServiceRegistryInitializer(embeddedJsonServiceRegistry(eventPublisher), serviceRegistryDao, servicesManager(serviceRegistryDao),
            casProperties.getServiceRegistry().isInitFromJson());
}
项目:cas-overlay    文件:MyJdbcAuthenticationHandlers.java   
@ConditionalOnMissingBean(
        name = {"jdbcPrincipalFactory"}
)
@Bean
@RefreshScope
public PrincipalFactory jdbcPrincipalFactory() {
    return new DefaultPrincipalFactory();
}
项目:spring-cloud-gcp    文件:StorageAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean
public static Storage storage(CredentialsProvider credentialsProvider,
        GcpStorageProperties gcpStorageProperties) throws IOException {
    return StorageOptions.newBuilder()
            .setCredentials(gcpStorageProperties.getCredentials().getLocation() != null
                    ? GoogleCredentials
                            .fromStream(gcpStorageProperties.getCredentials()
                                    .getLocation().getInputStream())
                            .createScoped(gcpStorageProperties.getCredentials().getScopes())
                    : credentialsProvider.getCredentials())
            .build().getService();
}
项目:cas-5.1.0    文件:CasCoreAuditConfiguration.java   
@ConditionalOnMissingBean(name = "auditActionResolverMap")
@Bean
public Map<String, AuditActionResolver> auditActionResolverMap() {
    final Map<String, AuditActionResolver> map = new HashMap<>();

    final AuditActionResolver resolver = authenticationActionResolver();
    map.put("AUTHENTICATION_RESOLVER", resolver);
    map.put("SAVE_SERVICE_ACTION_RESOLVER", resolver);
    map.put("CHANGE_PASSWORD_ACTION_RESOLVER", resolver);

    final AuditActionResolver defResolver = new DefaultAuditActionResolver();
    map.put("DESTROY_TICKET_GRANTING_TICKET_RESOLVER", defResolver);
    map.put("DESTROY_PROXY_GRANTING_TICKET_RESOLVER", defResolver);

    final AuditActionResolver cResolver = ticketCreationActionResolver();
    map.put("CREATE_PROXY_GRANTING_TICKET_RESOLVER", cResolver);
    map.put("GRANT_SERVICE_TICKET_RESOLVER", cResolver);
    map.put("GRANT_PROXY_TICKET_RESOLVER", cResolver);
    map.put("CREATE_TICKET_GRANTING_TICKET_RESOLVER", cResolver);
    map.put("TRUSTED_AUTHENTICATION_ACTION_RESOLVER", cResolver);

    map.put("AUTHENTICATION_EVENT_ACTION_RESOLVER", new DefaultAuditActionResolver("_TRIGGERED", StringUtils.EMPTY));
    final AuditActionResolver adResolver = new DefaultAuditActionResolver();
    map.put("ADAPTIVE_RISKY_AUTHENTICATION_ACTION_RESOLVER", adResolver);

    map.put("VALIDATE_SERVICE_TICKET_RESOLVER", ticketValidationActionResolver());

    return map;
}
项目:connectors    文件:SalesforceUpdateSObjectConnectorAutoConfiguration.java   
@Lazy
@Bean(name = "salesforce-update-sobject-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public SalesforceUpdateSObjectComponent configureSalesforceUpdateSObjectComponent()
        throws Exception {
    SalesforceUpdateSObjectComponent connector = new SalesforceUpdateSObjectComponent();
    connector.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, connector,
            parameters, false);
    connector.setOptions(parameters);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ConnectorCustomizer<SalesforceUpdateSObjectComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator
                            .evaluate(
                                    applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.salesforce-update-sobject.customizer",
                                    ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator
                            .evaluate(applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.salesforce-update-sobject.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure connector {}, with customizer {}",
                        connector, customizer);
                customizer.customize(connector);
            }
        }
    }
    return connector;
}
项目:spring-cloud-netflix-zuul-websocket    文件:ZuulWebSocketConfiguration.java   
@Bean
@ConditionalOnMissingBean(ProxyWebSocketErrorHandler.class)
public ProxyWebSocketErrorHandler proxyWebSocketErrorHandler() {
    Set<ProxyWebSocketErrorHandler> handlerSet = new HashSet<>();
    handlerSet.add(new DefaultProxyWebSocketErrorHandler());
    handlerSet.add(new ReconnectErrorHandler());

    return new CompositeErrorHandler(handlerSet);
}
项目:connectors    文件:DayTradeGetConnectorAutoConfiguration.java   
@Lazy
@Bean(name = "day-trade-get-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public DayTradeGetComponent configureDayTradeGetComponent()
        throws Exception {
    DayTradeGetComponent connector = new DayTradeGetComponent();
    connector.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, connector,
            parameters, false);
    connector.setOptions(parameters);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ConnectorCustomizer<DayTradeGetComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.connector.customizer",
                            "camel.connector.day-trade-get.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.connector.customizer",
                            "camel.connector.day-trade-get.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure connector {}, with customizer {}",
                        connector, customizer);
                customizer.customize(connector);
            }
        }
    }
    return connector;
}
项目:cas-5.1.0    文件:CasCoreAuthenticationSupportConfiguration.java   
@RefreshScope
@Bean
@ConditionalOnMissingBean(name = "authenticationContextValidator")
public AuthenticationContextValidator authenticationContextValidator() {
    final String contextAttribute = casProperties.getAuthn().getMfa().getAuthenticationContextAttribute();
    final String failureMode = casProperties.getAuthn().getMfa().getGlobalFailureMode();
    final String authnAttributeName = casProperties.getAuthn().getMfa().getTrusted().getAuthenticationContextAttribute();
    return new DefaultAuthenticationContextValidator(contextAttribute, failureMode, authnAttributeName);
}
项目:cas-5.1.0    文件:CasManagementWebAppConfiguration.java   
@ConditionalOnMissingBean(name = "authorizationGenerator")
@Bean
@RefreshScope
public AuthorizationGenerator authorizationGenerator() {
    final List<String> authzAttributes = casProperties.getMgmt().getAuthzAttributes();
    if (!authzAttributes.isEmpty()) {
        if ("*".equals(authzAttributes)) {
            return new PermitAllAuthorizationGenerator();
        }
        return new FromAttributesAuthorizationGenerator(authzAttributes.toArray(new String[]{}), new String[]{});
    }
    return new SpringSecurityPropertiesAuthorizationGenerator(userProperties());
}
项目:cas-5.1.0    文件:CasCoreLogoutConfiguration.java   
@ConditionalOnMissingBean(name = "defaultSingleLogoutServiceMessageHandler")
@Bean
public SingleLogoutServiceMessageHandler defaultSingleLogoutServiceMessageHandler() {
    return new DefaultSingleLogoutServiceMessageHandler(httpClient,
            logoutBuilder(),
            servicesManager,
            singleLogoutServiceLogoutUrlBuilder(),
            casProperties.getSlo().isAsynchronous(),
            authenticationRequestServiceSelectionStrategies);
}
项目:cas-5.1.0    文件:ExternalShibbolethIdPAuthenticationServiceSelectionStrategyConfiguration.java   
@ConditionalOnMissingBean(name = "shibbolethIdPEntityIdAuthenticationServiceSelectionStrategy")
@Bean
@RefreshScope
public AuthenticationServiceSelectionStrategy shibbolethIdPEntityIdAuthenticationServiceSelectionStrategy() {
    return new ShibbolethIdPEntityIdAuthenticationServiceSelectionStrategy(webApplicationServiceFactory,
            casProperties.getAuthn().getShibIdP().getServerUrl());
}
项目:syndesis    文件:ActiveMQPublishConnectorAutoConfiguration.java   
@Lazy
@Bean(name = "activemq-publish-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public ActiveMQPublishComponent configureActiveMQPublishComponent()
        throws Exception {
    ActiveMQPublishComponent connector = new ActiveMQPublishComponent();
    connector.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, connector,
            parameters, false);
    connector.setOptions(parameters);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ConnectorCustomizer<ActiveMQPublishComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.connector.customizer",
                            "camel.connector.activemq-publish.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.connector.customizer",
                            "camel.connector.activemq-publish.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure connector {}, with customizer {}",
                        connector, customizer);
                customizer.customize(connector);
            }
        }
    }
    return connector;
}
项目:spring-batch-support    文件:SpringBatchDefaultServiceConfiguration.java   
@Bean
    @ConditionalOnMissingBean(JobRepository.class)
    public JobRepository getJobRepository() throws Exception {
        BatchConfigurer batchConfigurer = getBatchConfigurer();
        if (batchConfigurer != null) {
            return batchConfigurer.getJobRepository();
        }
        JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean();
        factory.setDataSource(dataSource);
        factory.setTransactionManager(transactionManager);
        factory.afterPropertiesSet();
//      factory.setIsolationLevelForCreate("ISOLATION_DEFAULT");
        return factory.getObject();
    }
项目:cas-5.1.0    文件:CasCoreWebflowConfiguration.java   
@ConditionalOnMissingBean(name = "registeredServiceAuthenticationPolicyWebflowEventResolver")
@Bean
@RefreshScope
public CasWebflowEventResolver registeredServiceAuthenticationPolicyWebflowEventResolver() {
    return new RegisteredServiceMultifactorAuthenticationPolicyEventResolver(authenticationSystemSupport,
            centralAuthenticationService, servicesManager,
            ticketRegistrySupport, warnCookieGenerator,
            authenticationRequestServiceSelectionStrategies, selector);
}
项目:holon-jaxrs    文件:ResteasyAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean(name = "jerseyFilterRegistration")
@ConditionalOnProperty(prefix = "holon.resteasy", name = "type", havingValue = "filter")
public FilterRegistrationBean resteasyFilterRegistration() {
    final Filter filter = new Filter30Dispatcher();
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(filter);
    registration.setUrlPatterns(Arrays.asList(this.path));
    registration.setOrder(this.resteasy.getFilter().getOrder());
    registration.setName("resteasyFilter");
    registration.setDispatcherTypes(EnumSet.allOf(DispatcherType.class));
    return registration;
}
项目:syndesis    文件:SwaggerConnectorConnectorAutoConfiguration.java   
@Lazy
@Bean(name = "swagger-operation-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public SwaggerConnectorComponent configureSwaggerConnectorComponent()
        throws Exception {
    SwaggerConnectorComponent connector = new SwaggerConnectorComponent();
    connector.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, connector,
            parameters, false);
    connector.setOptions(parameters);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ConnectorCustomizer<SwaggerConnectorComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.connector.customizer",
                            "camel.connector.swagger-operation.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.connector.customizer",
                            "camel.connector.swagger-operation.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure connector {}, with customizer {}",
                        connector, customizer);
                customizer.customize(connector);
            }
        }
    }
    return connector;
}
项目:connectors    文件:DayTradePlaceConnectorAutoConfiguration.java   
@Lazy
@Bean(name = "day-trade-place-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public DayTradePlaceComponent configureDayTradePlaceComponent()
        throws Exception {
    DayTradePlaceComponent connector = new DayTradePlaceComponent();
    connector.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, connector,
            parameters, false);
    connector.setOptions(parameters);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ConnectorCustomizer<DayTradePlaceComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.connector.customizer",
                            "camel.connector.day-trade-place.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.connector.customizer",
                            "camel.connector.day-trade-place.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure connector {}, with customizer {}",
                        connector, customizer);
                customizer.customize(connector);
            }
        }
    }
    return connector;
}
项目:cas-5.1.0    文件:CasSupportActionsConfiguration.java   
@RefreshScope
@Bean
@ConditionalOnMissingBean(name = "genericSuccessViewAction")
public Action genericSuccessViewAction() {
    return new GenericSuccessViewAction(centralAuthenticationService, servicesManager, webApplicationServiceFactory,
            casProperties.getView().getDefaultRedirectUrl());
}
项目:cas-5.1.0    文件:CasJdbcAuthenticationConfiguration.java   
@ConditionalOnMissingBean(name = "jdbcAuthenticationHandlers")
@Bean
@RefreshScope
public Collection<AuthenticationHandler> jdbcAuthenticationHandlers() {
    final Collection<AuthenticationHandler> handlers = new HashSet<>();
    final JdbcAuthenticationProperties jdbc = casProperties.getAuthn().getJdbc();
    jdbc.getBind().forEach(b -> handlers.add(bindModeSearchDatabaseAuthenticationHandler(b)));
    jdbc.getEncode().forEach(b -> handlers.add(queryAndEncodeDatabaseAuthenticationHandler(b)));
    jdbc.getQuery().forEach(b -> handlers.add(queryDatabaseAuthenticationHandler(b)));
    jdbc.getSearch().forEach(b -> handlers.add(searchModeSearchDatabaseAuthenticationHandler(b)));
    return handlers;
}
项目:cas-5.1.0    文件:CasCoreHttpConfiguration.java   
@ConditionalOnMissingBean(name = "httpClient")
@Bean
public FactoryBean<SimpleHttpClient> httpClient() {
    final SimpleHttpClientFactoryBean.DefaultHttpClient c = new SimpleHttpClientFactoryBean.DefaultHttpClient();
    c.setConnectionTimeout(casProperties.getHttpClient().getConnectionTimeout());
    c.setReadTimeout(Long.valueOf(casProperties.getHttpClient().getReadTimeout()).intValue());
    return c;
}
项目:connectors    文件:ActiveMQRespondTextConnectorAutoConfiguration.java   
@Lazy
@Bean(name = "activemq-respond-text-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public ActiveMQRespondTextComponent configureActiveMQRespondTextComponent()
        throws Exception {
    ActiveMQRespondTextComponent connector = new ActiveMQRespondTextComponent();
    connector.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, connector,
            parameters, false);
    connector.setOptions(parameters);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ConnectorCustomizer<ActiveMQRespondTextComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator
                            .evaluate(
                                    applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.activemq-respond-text.customizer",
                                    ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator
                            .evaluate(applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.activemq-respond-text.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure connector {}, with customizer {}",
                        connector, customizer);
                customizer.customize(connector);
            }
        }
    }
    return connector;
}
项目:quickfixj-spring-boot-starter    文件:QuickFixJServerEndpointAutoConfiguration.java   
@Bean
@ConditionalOnBean(name = {"serverAcceptor", "serverSessionSettings"})
@ConditionalOnClass({Acceptor.class, SessionSettings.class})
@ConditionalOnMissingBean
@ConditionalOnEnabledEndpoint("quickfixjserver")
public QuickFixJServerEndpoint quickfixjServerEndpoint(Acceptor serverAcceptor, SessionSettings serverSessionSettings) {
    return new QuickFixJServerEndpoint(serverAcceptor, serverSessionSettings);
}