Java Code Examples for org.springframework.context.annotation.Lazy

The following are top voted examples for showing how to use org.springframework.context.annotation.Lazy. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: cas-5.1.0   File: CoreSamlConfiguration.java   View source code 7 votes vote down vote up
@Lazy
@Bean(name = "shibboleth.VelocityEngine")
public VelocityEngineFactoryBean velocityEngineFactoryBean() {
    final VelocityEngineFactoryBean bean = new VelocityEngineFactoryBean();

    final Properties properties = new Properties();
    properties.put(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, SLF4JLogChute.class.getName());
    properties.put(RuntimeConstants.INPUT_ENCODING, StandardCharsets.UTF_8.name());
    properties.put(RuntimeConstants.OUTPUT_ENCODING, StandardCharsets.UTF_8.name());
    properties.put(RuntimeConstants.ENCODING_DEFAULT, StandardCharsets.UTF_8.name());
    properties.put(RuntimeConstants.RESOURCE_LOADER, "file, classpath, string");
    properties.put(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, FileUtils.getTempDirectory().getAbsolutePath());
    properties.put(RuntimeConstants.FILE_RESOURCE_LOADER_CACHE, Boolean.FALSE);
    properties.put("classpath.resource.loader.class", ClasspathResourceLoader.class.getName());
    properties.put("string.resource.loader.class", StringResourceLoader.class.getName());
    properties.put("file.resource.loader.class", FileResourceLoader.class.getName());
    bean.setOverrideLogging(false);
    bean.setVelocityProperties(properties);
    return bean;
}
 
Example 2
Project: cas-5.1.0   File: SpnegoWebflowActionsConfiguration.java   View source code 6 votes vote down vote up
@Lazy
@Bean
@RefreshScope
public Action ldapSpnegoClientAction() {
    final SpnegoProperties spnegoProperties = casProperties.getAuthn().getSpnego();
    final ConnectionFactory connectionFactory = Beans.newLdaptivePooledConnectionFactory(spnegoProperties.getLdap());
    final SearchFilter filter = Beans.newLdaptiveSearchFilter(spnegoProperties.getLdap().getSearchFilter(),
            "host", Collections.emptyList());

    final SearchRequest searchRequest = Beans.newLdaptiveSearchRequest(spnegoProperties.getLdap().getBaseDn(), filter);
    return new LdapSpnegoKnownClientSystemsFilterAction(spnegoProperties.getIpsToCheckPattern(), 
            spnegoProperties.getAlternativeRemoteHostAttribute(),
            spnegoProperties.getDnsTimeout(), 
            connectionFactory, 
            searchRequest, 
            spnegoProperties.getSpnegoAttributeName());
}
 
Example 3
Project: jigsaw-payment   File: HelloClientConfig.java   View source code 6 votes vote down vote up
@Bean(initMethod = "start", destroyMethod = "close")
@Lazy(false)
public CuratorFramework curatorFramework() {
    CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory
            .builder();
    int sessionTimeoutMs = Integer.parseInt(env.getProperty(
            "rpc.client.zookeeper.session.timeout.ms", "5000"));
    int connectionTimeoutMs = Integer.parseInt(env.getProperty(
            "rpc.client.zookeeper.connection.timeout.ms", "5000"));
    builder.connectString(
            env.getProperty("rpc.client.zookeeper.connect.string"))
            .sessionTimeoutMs(sessionTimeoutMs)
            .connectionTimeoutMs(connectionTimeoutMs)
           
            .retryPolicy(this.retryPolicy());
            //.aclProvider(this.aclProvider()).authorization(this.authInfo());
    return builder.build();
}
 
Example 4
Project: incubator-servicecomb-saga   File: OmegaSpringConfig.java   View source code 6 votes vote down vote up
@Bean
MessageSender grpcMessageSender(
    @Value("${alpha.cluster.address}") String[] addresses,
    @Value("${omega.connection.reconnectDelay:3000}") int reconnectDelay,
    ServiceConfig serviceConfig,
    @Lazy MessageHandler handler) {

  MessageFormat messageFormat = new KryoMessageFormat();
  MessageSender sender = new LoadBalancedClusterMessageSender(
      addresses,
      messageFormat,
      messageFormat,
      serviceConfig,
      handler,
      reconnectDelay);

  sender.onConnected();
  Runtime.getRuntime().addShutdownHook(new Thread(() -> {
    sender.onDisconnected();
    sender.close();
  }));

  return sender;
}
 
Example 5
Project: connectors   File: SalesforceUpdateSObjectConnectorAutoConfiguration.java   View source code 5 votes vote down vote up
@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;
}
 
Example 6
Project: minlia-iot-xapi   File: KuaidiniaoConfiguration.java   View source code 5 votes vote down vote up
@Bean
@Lazy
public KuaidiniaoApi kuaidiniaoApi() {
  ApiCredentialConfiguration[] apiCredentialConfigurations = {
      kuaidiniaoApiCredentialConfigurationProduction(),
      kuaidiniaoApiCredentialConfigurationSandbox()};
  ApiEndpointConfiguration[] apiEndpointConfigurations = {
      kuaidiniaoApiEndpointConfigurationProduction(),
      kuaidiniaoApiEndpointConfigurationSandbox()};
  return new KuaidiniaoApi(apiCredentialConfigurations,
      apiEndpointConfigurations);
}
 
Example 7
Project: Learning-Spring-Boot-2.0-Second-Edition   File: WebDriverAutoConfiguration.java   View source code 5 votes vote down vote up
@Bean(destroyMethod = "stop")
@Lazy
public ChromeDriverService chromeDriverService() {
	System.setProperty("webdriver.chrome.driver",
		"ext/chromedriver");
	return createDefaultService();
}
 
Example 8
Project: xm-uaa   File: UaaWebSecurityConfiguration.java   View source code 5 votes vote down vote up
public UaaWebSecurityConfiguration(UserDetailsService userDetailsService,
    AuthenticationManagerBuilder authenticationManagerBuilder,
    @Qualifier("authenticationProviderResolver") AuthenticationProviderResolver authenticationProviderResolver,
    @Lazy PasswordEncoder passwordEncoder) {
    this.userDetailsService = userDetailsService;
    this.authenticationManagerBuilder = authenticationManagerBuilder;
    this.authenticationProviderResolver = authenticationProviderResolver;
    this.passwordEncoder = passwordEncoder;
}
 
Example 9
Project: Spring-5.0-Cookbook   File: BeanConfig.java   View source code 5 votes vote down vote up
@Lazy
@Bean(name="dept2")
public Department getDept2(){
	Department dept2 = new Department();
	dept2.setDeptNo(13456);
	dept2.setDeptName("History Department");
	return dept2;
}
 
Example 10
Project: Spring-5.0-Cookbook   File: SpringContextConfig.java   View source code 5 votes vote down vote up
@Lazy
@Bean(name="dept2")
public Department getDept2(){
	Department dept2 = new Department();
	dept2.setDeptNo(13456);
	dept2.setDeptName("History Department");
	return dept2;
}
 
Example 11
Project: cas-5.1.0   File: CasWebflowContextConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Bean
public Object[] loginFlowHandlerMappingInterceptors() {
    final List interceptors = new ArrayList<>();
    interceptors.add(localeChangeInterceptor());
    if (this.applicationContext.containsBean("authenticationThrottle")) {
        interceptors.add(this.applicationContext.getBean("authenticationThrottle", HandlerInterceptor.class));
    }
    return interceptors.toArray();
}
 
Example 12
Project: cas-5.1.0   File: JpaEventsConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Bean
public LocalContainerEntityManagerFactoryBean eventsEntityManagerFactory() {
    final LocalContainerEntityManagerFactoryBean bean =
            Beans.newHibernateEntityManagerFactoryBean(
                    new JpaConfigDataHolder(
                            jpaEventVendorAdapter(),
                            "jpaEventRegistryContext",
                            jpaEventPackagesToScan(),
                            dataSourceEvent()),
                    casProperties.getEvents().getJpa());

    return bean;
}
 
Example 13
Project: minlia-iot-xapi   File: KuaidiniaoConfiguration.java   View source code 5 votes vote down vote up
@Bean
@Lazy
ApiEndpointConfiguration kuaidiniaoApiEndpointConfigurationProduction() {
  KuaidiniaoApiEndpointConfiguration configuration = new KuaidiniaoApiEndpointConfiguration();
  configuration.setKuaidiniaoQuery(queryProduction);
  configuration.setApiRequestMode(ApiRequestMode.PRODUCTION);
  return configuration;
}
 
Example 14
Project: cas-5.1.0   File: MemcachedTicketRegistryConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Bean
public MemcachedClientFactoryBean memcachedClient() {
    try {
        final MemcachedClientFactoryBean bean = new MemcachedClientFactoryBean();
        bean.setServers(casProperties.getTicket().getRegistry().getMemcached().getServers());
        bean.setLocatorType(ConnectionFactoryBuilder.Locator.valueOf(casProperties.getTicket().getRegistry().getMemcached().getLocatorType()));
        bean.setTranscoder(kryoTranscoder());
        bean.setFailureMode(FailureMode.valueOf(casProperties.getTicket().getRegistry().getMemcached().getFailureMode()));
        bean.setHashAlg(DefaultHashAlgorithm.valueOf(casProperties.getTicket().getRegistry().getMemcached().getHashAlgorithm()));
        return bean;
    } catch (final Exception e) {
        throw Throwables.propagate(e);
    }
}
 
Example 15
Project: cas-5.1.0   File: SamlGoogleAppsConfiguration.java   View source code 5 votes vote down vote up
@ConditionalOnMissingBean(name = "googleAccountsServiceResponseBuilder")
@Bean
@Lazy
public ResponseBuilder googleAccountsServiceResponseBuilder() {
    final GoogleAppsProperties gApps = casProperties.getGoogleApps();
    return new GoogleAccountsServiceResponseBuilder(
            gApps.getPrivateKeyLocation(),
            gApps.getPublicKeyLocation(),
            gApps.getKeyAlgorithm(),
            servicesManager,
            googleSaml20ObjectBuilder(),
            casProperties.getSamlCore().getSkewAllowance(),
            casProperties.getServer().getPrefix());
}
 
Example 16
Project: cas-5.1.0   File: MultifactorAuthnTrustConfiguration.java   View source code 5 votes vote down vote up
@ConditionalOnMissingBean(name = "mfaTrustStorageCleaner")
@Bean
@Lazy
public MultifactorAuthenticationTrustStorageCleaner mfaTrustStorageCleaner(
        @Qualifier("mfaTrustEngine") final MultifactorAuthenticationTrustStorage storage) {
    return new MultifactorAuthenticationTrustStorageCleaner(casProperties.getAuthn().getMfa().getTrusted(), storage);
}
 
Example 17
Project: cas-5.1.0   File: CasSupportJdbcAuditConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Bean
public LocalContainerEntityManagerFactoryBean inspektrAuditEntityManagerFactory() {
    return Beans.newHibernateEntityManagerFactoryBean(
            new JpaConfigDataHolder(
                    Beans.newHibernateJpaVendorAdapter(casProperties.getJdbc()),
                    "jpaInspektrAuditContext",
                    new String[]{"org.apereo.cas.audit.entity"},
                    inspektrAuditTrailDataSource()),
            casProperties.getAudit().getJdbc());
}
 
Example 18
Project: cas-5.1.0   File: JdbcMultifactorAuthnTrustConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Bean
public LocalContainerEntityManagerFactoryBean mfaTrustedAuthnEntityManagerFactory() {
    final LocalContainerEntityManagerFactoryBean bean =
            Beans.newHibernateEntityManagerFactoryBean(
                    new JpaConfigDataHolder(
                            jpaMfaTrustedAuthnVendorAdapter(),
                            "jpaMfaTrustedAuthnContext",
                            jpaMfaTrustedAuthnPackagesToScan(),
                            dataSourceMfaTrustedAuthn()),
                    casProperties.getAuthn().getMfa().getTrusted().getJpa());

    return bean;
}
 
Example 19
Project: connectors   File: SalesforceUpsertSObjectConnectorAutoConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Bean(name = "salesforce-upsert-sobject-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public SalesforceUpsertSObjectComponent configureSalesforceUpsertSObjectComponent()
        throws Exception {
    SalesforceUpsertSObjectComponent connector = new SalesforceUpsertSObjectComponent();
    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<SalesforceUpsertSObjectComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator
                            .evaluate(
                                    applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.salesforce-upsert-sobject.customizer",
                                    ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator
                            .evaluate(applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.salesforce-upsert-sobject.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure connector {}, with customizer {}",
                        connector, customizer);
                customizer.customize(connector);
            }
        }
    }
    return connector;
}
 
Example 20
Project: cas-5.1.0   File: JpaServiceRegistryConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Bean
public LocalContainerEntityManagerFactoryBean serviceEntityManagerFactory() {
    return newHibernateEntityManagerFactoryBean(
            new JpaConfigDataHolder(
                    jpaServiceVendorAdapter(),
                    "jpaServiceRegistryContext",
                    jpaServicePackagesToScan(),
                    dataSourceService()),
            casProperties.getServiceRegistry().getJpa());
}
 
Example 21
Project: connectors   File: TradeInsightSellConnectorAutoConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Bean(name = "trade-insight-sell-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public TradeInsightSellComponent configureTradeInsightSellComponent()
        throws Exception {
    TradeInsightSellComponent connector = new TradeInsightSellComponent();
    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<TradeInsightSellComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator
                            .evaluate(
                                    applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.trade-insight-sell.customizer",
                                    ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator
                            .evaluate(applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.trade-insight-sell.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure connector {}, with customizer {}",
                        connector, customizer);
                customizer.customize(connector);
            }
        }
    }
    return connector;
}
 
Example 22
Project: cas-5.1.0   File: CoreWsSecurityIdentityProviderConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Autowired
@Bean
public WSFederationValidateRequestCallbackController federationValidateRequestCallbackController(
        @Qualifier("wsFederationRelyingPartyTokenProducer")
        final WSFederationRelyingPartyTokenProducer wsFederationRelyingPartyTokenProducer) {
    return new WSFederationValidateRequestCallbackController(servicesManager,
            webApplicationServiceFactory, casProperties, wsFederationRelyingPartyTokenProducer,
            wsFederationAuthenticationServiceSelectionStrategy(),
            httpClient, securityTokenTicketFactory, ticketRegistry, ticketGrantingTicketCookieGenerator,
            ticketRegistrySupport);
}
 
Example 23
Project: cas-5.1.0   File: JpaTicketRegistryConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Bean
public LocalContainerEntityManagerFactoryBean ticketEntityManagerFactory() {
    return Beans.newHibernateEntityManagerFactoryBean(
            new JpaConfigDataHolder(
                    Beans.newHibernateJpaVendorAdapter(casProperties.getJdbc()),
                    "jpaTicketRegistryContext",
                    ticketPackagesToScan(),
                    dataSourceTicket()),
            casProperties.getTicket().getRegistry().getJpa());
}
 
Example 24
Project: cas-5.1.0   File: EhcacheTicketRegistryConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Bean
public EhCacheManagerFactoryBean cacheManager() {
    final EhcacheProperties cache = casProperties.getTicket().getRegistry().getEhcache();
    final EhCacheManagerFactoryBean bean = new EhCacheManagerFactoryBean();
    bean.setConfigLocation(cache.getConfigLocation());
    bean.setShared(cache.isShared());
    bean.setCacheManagerName(cache.getCacheManagerName());
    return bean;
}
 
Example 25
Project: cas-5.1.0   File: EhcacheTicketRegistryConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Autowired
@Bean
public EhCacheFactoryBean ehcacheTicketsCache(@Qualifier("cacheManager") final CacheManager manager) {
    final EhcacheProperties ehcacheProperties = casProperties.getTicket().getRegistry().getEhcache();
    final EhCacheFactoryBean bean = new EhCacheFactoryBean();
    bean.setCacheName(ehcacheProperties.getCacheName());
    bean.setCacheEventListeners(Collections.singleton(ticketRMISynchronousCacheReplicator()));
    bean.setTimeToIdle(ehcacheProperties.getCacheTimeToIdle());
    bean.setTimeToLive(ehcacheProperties.getCacheTimeToLive());

    bean.setCacheManager(manager);
    bean.setBootstrapCacheLoader(ticketCacheBootstrapCacheLoader());
    bean.setDiskExpiryThreadIntervalSeconds(ehcacheProperties.getDiskExpiryThreadIntervalSeconds());

    bean.setEternal(ehcacheProperties.isEternal());
    bean.setMaxEntriesLocalHeap(ehcacheProperties.getMaxElementsInMemory());
    bean.setMaxEntriesInCache(ehcacheProperties.getMaxElementsInCache());
    bean.setMaxEntriesLocalDisk(ehcacheProperties.getMaxElementsOnDisk());
    bean.setMemoryStoreEvictionPolicy(ehcacheProperties.getMemoryStoreEvictionPolicy());

    final PersistenceConfiguration c = new PersistenceConfiguration();
    c.strategy(ehcacheProperties.getPersistence());
    c.setSynchronousWrites(ehcacheProperties.isSynchronousWrites());
    bean.persistence(c);

    return bean;
}
 
Example 26
Project: connectors   File: HttpPostConnectorAutoConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Bean(name = "http-post-connector-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public HttpPostComponent configureHttpPostComponent() throws Exception {
    HttpPostComponent connector = new HttpPostComponent();
    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<HttpPostComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator
                            .evaluate(
                                    applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.http-post-connector.customizer",
                                    ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator
                            .evaluate(applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.http-post-connector.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure connector {}, with customizer {}",
                        connector, customizer);
                customizer.customize(connector);
            }
        }
    }
    return connector;
}
 
Example 27
Project: cas-5.1.0   File: CasCoreTicketsConfiguration.java   View source code 5 votes vote down vote up
@ConditionalOnMissingBean(name = "defaultProxyTicketFactory")
@RefreshScope
@Bean
@Lazy
public ProxyTicketFactory defaultProxyTicketFactory() {
    final boolean onlyTrackMostRecentSession = casProperties.getTicket().getTgt().isOnlyTrackMostRecentSession();
    return new DefaultProxyTicketFactory(proxyTicketExpirationPolicy(),
            uniqueIdGeneratorsMap,
            protocolTicketCipherExecutor(),
            onlyTrackMostRecentSession);
}
 
Example 28
Project: cas-5.1.0   File: CasCoreTicketsConfiguration.java   View source code 5 votes vote down vote up
@ConditionalOnMissingBean(name = "defaultServiceTicketFactory")
@Bean
@Lazy
public ServiceTicketFactory defaultServiceTicketFactory() {
    final boolean onlyTrackMostRecentSession = casProperties.getTicket().getTgt().isOnlyTrackMostRecentSession();
    return new DefaultServiceTicketFactory(serviceTicketExpirationPolicy(),
            uniqueIdGeneratorsMap,
            onlyTrackMostRecentSession,
            protocolTicketCipherExecutor());
}
 
Example 29
Project: connectors   File: SalesforceDeleteSObjectWithIdConnectorAutoConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Bean(name = "salesforce-delete-sobject-with-id-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public SalesforceDeleteSObjectWithIdComponent configureSalesforceDeleteSObjectWithIdComponent()
        throws Exception {
    SalesforceDeleteSObjectWithIdComponent connector = new SalesforceDeleteSObjectWithIdComponent();
    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<SalesforceDeleteSObjectWithIdComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator
                            .evaluate(
                                    applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.salesforce-delete-sobject-with-id.customizer",
                                    ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator
                            .evaluate(applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.salesforce-delete-sobject-with-id.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure connector {}, with customizer {}",
                        connector, customizer);
                customizer.customize(connector);
            }
        }
    }
    return connector;
}
 
Example 30
Project: TOSCAna   File: TransformationServiceImpl.java   View source code 5 votes vote down vote up
@Autowired
public TransformationServiceImpl(
    TransformationDao transformationDao,
    PluginService pluginService,
    @Lazy CsarDao csarDao,
    ArtifactService artifactService
) {
    this.transformationDao = transformationDao;
    this.pluginService = pluginService;
    this.csarDao = csarDao;
    this.artifactService = artifactService;
}
 
Example 31
Project: minlia-iot-xapi   File: KuaidiniaoConfiguration.java   View source code 5 votes vote down vote up
@Bean
@Lazy
ApiCredentialConfiguration kuaidiniaoApiCredentialConfigurationSandbox() {
  KuaidiniaoApiCredentialConfiguration configuration = new KuaidiniaoApiCredentialConfiguration();
  configuration.setAppKey(appKeySandbox);
  configuration.setEbusinessId(ebusinessIdSandbox);
  configuration.setApiRequestMode(ApiRequestMode.SANDBOX);
  return configuration;
}
 
Example 32
Project: syndesis   File: TradeInsightTopConnectorAutoConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Bean(name = "trade-insight-top-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public TradeInsightTopComponent configureTradeInsightTopComponent()
        throws Exception {
    TradeInsightTopComponent connector = new TradeInsightTopComponent();
    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<TradeInsightTopComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.connector.customizer",
                            "camel.connector.trade-insight-top.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.connector.customizer",
                            "camel.connector.trade-insight-top.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure connector {}, with customizer {}",
                        connector, customizer);
                customizer.customize(connector);
            }
        }
    }
    return connector;
}
 
Example 33
Project: syndesis   File: TradeInsightSellConnectorAutoConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Bean(name = "trade-insight-sell-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public TradeInsightSellComponent configureTradeInsightSellComponent()
        throws Exception {
    TradeInsightSellComponent connector = new TradeInsightSellComponent();
    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<TradeInsightSellComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator
                            .evaluate(
                                    applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.trade-insight-sell.customizer",
                                    ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator
                            .evaluate(applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.trade-insight-sell.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure connector {}, with customizer {}",
                        connector, customizer);
                customizer.customize(connector);
            }
        }
    }
    return connector;
}
 
Example 34
Project: syndesis   File: TradeInsightBuyConnectorAutoConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Bean(name = "trade-insight-buy-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public TradeInsightBuyComponent configureTradeInsightBuyComponent()
        throws Exception {
    TradeInsightBuyComponent connector = new TradeInsightBuyComponent();
    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<TradeInsightBuyComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.connector.customizer",
                            "camel.connector.trade-insight-buy.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.connector.customizer",
                            "camel.connector.trade-insight-buy.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure connector {}, with customizer {}",
                        connector, customizer);
                customizer.customize(connector);
            }
        }
    }
    return connector;
}
 
Example 35
Project: connectors   File: SqlStoredStartConnectorConnectorAutoConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Bean(name = "sql-stored-start-connector-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public SqlStoredStartConnectorComponent configureSqlStoredStartConnectorComponent()
        throws Exception {
    SqlStoredStartConnectorComponent connector = new SqlStoredStartConnectorComponent();
    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<SqlStoredStartConnectorComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator
                            .evaluate(
                                    applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.sql-stored-start-connector.customizer",
                                    ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator
                            .evaluate(applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.sql-stored-start-connector.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure connector {}, with customizer {}",
                        connector, customizer);
                customizer.customize(connector);
            }
        }
    }
    return connector;
}
 
Example 36
Project: syndesis   File: HttpGetConnectorAutoConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Bean(name = "http-get-connector-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public HttpGetComponent configureHttpGetComponent() throws Exception {
    HttpGetComponent connector = new HttpGetComponent();
    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<HttpGetComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator
                            .evaluate(
                                    applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.http-get-connector.customizer",
                                    ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator
                            .evaluate(applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.http-get-connector.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure connector {}, with customizer {}",
                        connector, customizer);
                customizer.customize(connector);
            }
        }
    }
    return connector;
}
 
Example 37
Project: connectors   File: DayTradeGetConnectorAutoConfiguration.java   View source code 5 votes vote down vote up
@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;
}
 
Example 38
Project: syndesis   File: SwaggerConnectorConnectorAutoConfiguration.java   View source code 5 votes vote down vote up
@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;
}
 
Example 39
Project: connectors   File: SqlStoredConnectorConnectorAutoConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Bean(name = "sql-stored-connector-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public SqlStoredConnectorComponent configureSqlStoredConnectorComponent()
        throws Exception {
    SqlStoredConnectorComponent connector = new SqlStoredConnectorComponent();
    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<SqlStoredConnectorComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator
                            .evaluate(
                                    applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.sql-stored-connector.customizer",
                                    ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator
                            .evaluate(applicationContext.getEnvironment(),
                                    "camel.connector.customizer",
                                    "camel.connector.sql-stored-connector.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure connector {}, with customizer {}",
                        connector, customizer);
                customizer.customize(connector);
            }
        }
    }
    return connector;
}
 
Example 40
Project: syndesis   File: ActiveMQRequestConnectorAutoConfiguration.java   View source code 5 votes vote down vote up
@Lazy
@Bean(name = "activemq-request-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public ActiveMQRequestComponent configureActiveMQRequestComponent()
        throws Exception {
    ActiveMQRequestComponent connector = new ActiveMQRequestComponent();
    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<ActiveMQRequestComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.connector.customizer",
                            "camel.connector.activemq-request.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.connector.customizer",
                            "camel.connector.activemq-request.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure connector {}, with customizer {}",
                        connector, customizer);
                customizer.customize(connector);
            }
        }
    }
    return connector;
}