@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; }
@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()); }
@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(); }
@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; }
@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; }
@Bean @Lazy public KuaidiniaoApi kuaidiniaoApi() { ApiCredentialConfiguration[] apiCredentialConfigurations = { kuaidiniaoApiCredentialConfigurationProduction(), kuaidiniaoApiCredentialConfigurationSandbox()}; ApiEndpointConfiguration[] apiEndpointConfigurations = { kuaidiniaoApiEndpointConfigurationProduction(), kuaidiniaoApiEndpointConfigurationSandbox()}; return new KuaidiniaoApi(apiCredentialConfigurations, apiEndpointConfigurations); }
@Bean(destroyMethod = "stop") @Lazy public ChromeDriverService chromeDriverService() { System.setProperty("webdriver.chrome.driver", "ext/chromedriver"); return createDefaultService(); }
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; }
@Lazy @Bean(name="dept2") public Department getDept2(){ Department dept2 = new Department(); dept2.setDeptNo(13456); dept2.setDeptName("History Department"); return dept2; }
@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(); }
@Lazy @Bean public LocalContainerEntityManagerFactoryBean eventsEntityManagerFactory() { final LocalContainerEntityManagerFactoryBean bean = Beans.newHibernateEntityManagerFactoryBean( new JpaConfigDataHolder( jpaEventVendorAdapter(), "jpaEventRegistryContext", jpaEventPackagesToScan(), dataSourceEvent()), casProperties.getEvents().getJpa()); return bean; }
@Bean @Lazy ApiEndpointConfiguration kuaidiniaoApiEndpointConfigurationProduction() { KuaidiniaoApiEndpointConfiguration configuration = new KuaidiniaoApiEndpointConfiguration(); configuration.setKuaidiniaoQuery(queryProduction); configuration.setApiRequestMode(ApiRequestMode.PRODUCTION); return configuration; }
@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); } }
@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()); }
@ConditionalOnMissingBean(name = "mfaTrustStorageCleaner") @Bean @Lazy public MultifactorAuthenticationTrustStorageCleaner mfaTrustStorageCleaner( @Qualifier("mfaTrustEngine") final MultifactorAuthenticationTrustStorage storage) { return new MultifactorAuthenticationTrustStorageCleaner(casProperties.getAuthn().getMfa().getTrusted(), storage); }
@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()); }
@Lazy @Bean public LocalContainerEntityManagerFactoryBean mfaTrustedAuthnEntityManagerFactory() { final LocalContainerEntityManagerFactoryBean bean = Beans.newHibernateEntityManagerFactoryBean( new JpaConfigDataHolder( jpaMfaTrustedAuthnVendorAdapter(), "jpaMfaTrustedAuthnContext", jpaMfaTrustedAuthnPackagesToScan(), dataSourceMfaTrustedAuthn()), casProperties.getAuthn().getMfa().getTrusted().getJpa()); return bean; }
@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; }
@Lazy @Bean public LocalContainerEntityManagerFactoryBean serviceEntityManagerFactory() { return newHibernateEntityManagerFactoryBean( new JpaConfigDataHolder( jpaServiceVendorAdapter(), "jpaServiceRegistryContext", jpaServicePackagesToScan(), dataSourceService()), casProperties.getServiceRegistry().getJpa()); }
@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; }
@Lazy @Autowired @Bean public WSFederationValidateRequestCallbackController federationValidateRequestCallbackController( @Qualifier("wsFederationRelyingPartyTokenProducer") final WSFederationRelyingPartyTokenProducer wsFederationRelyingPartyTokenProducer) { return new WSFederationValidateRequestCallbackController(servicesManager, webApplicationServiceFactory, casProperties, wsFederationRelyingPartyTokenProducer, wsFederationAuthenticationServiceSelectionStrategy(), httpClient, securityTokenTicketFactory, ticketRegistry, ticketGrantingTicketCookieGenerator, ticketRegistrySupport); }
@Lazy @Bean public LocalContainerEntityManagerFactoryBean ticketEntityManagerFactory() { return Beans.newHibernateEntityManagerFactoryBean( new JpaConfigDataHolder( Beans.newHibernateJpaVendorAdapter(casProperties.getJdbc()), "jpaTicketRegistryContext", ticketPackagesToScan(), dataSourceTicket()), casProperties.getTicket().getRegistry().getJpa()); }
@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; }
@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; }
@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; }
@ConditionalOnMissingBean(name = "defaultProxyTicketFactory") @RefreshScope @Bean @Lazy public ProxyTicketFactory defaultProxyTicketFactory() { final boolean onlyTrackMostRecentSession = casProperties.getTicket().getTgt().isOnlyTrackMostRecentSession(); return new DefaultProxyTicketFactory(proxyTicketExpirationPolicy(), uniqueIdGeneratorsMap, protocolTicketCipherExecutor(), onlyTrackMostRecentSession); }
@ConditionalOnMissingBean(name = "defaultServiceTicketFactory") @Bean @Lazy public ServiceTicketFactory defaultServiceTicketFactory() { final boolean onlyTrackMostRecentSession = casProperties.getTicket().getTgt().isOnlyTrackMostRecentSession(); return new DefaultServiceTicketFactory(serviceTicketExpirationPolicy(), uniqueIdGeneratorsMap, onlyTrackMostRecentSession, protocolTicketCipherExecutor()); }
@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; }
@Autowired public TransformationServiceImpl( TransformationDao transformationDao, PluginService pluginService, @Lazy CsarDao csarDao, ArtifactService artifactService ) { this.transformationDao = transformationDao; this.pluginService = pluginService; this.csarDao = csarDao; this.artifactService = artifactService; }
@Bean @Lazy ApiCredentialConfiguration kuaidiniaoApiCredentialConfigurationSandbox() { KuaidiniaoApiCredentialConfiguration configuration = new KuaidiniaoApiCredentialConfiguration(); configuration.setAppKey(appKeySandbox); configuration.setEbusinessId(ebusinessIdSandbox); configuration.setApiRequestMode(ApiRequestMode.SANDBOX); return configuration; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }