本文整理匯總了Java中org.springframework.context.annotation.Lazy類的典型用法代碼示例。如果您正苦於以下問題:Java Lazy類的具體用法?Java Lazy怎麽用?Java Lazy使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Lazy類屬於org.springframework.context.annotation包,在下文中一共展示了Lazy類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: velocityEngineFactoryBean
import org.springframework.context.annotation.Lazy; //導入依賴的package包/類
@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;
}
示例2: ldapSpnegoClientAction
import org.springframework.context.annotation.Lazy; //導入依賴的package包/類
@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());
}
示例3: curatorFramework
import org.springframework.context.annotation.Lazy; //導入依賴的package包/類
@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();
}
示例4: grpcMessageSender
import org.springframework.context.annotation.Lazy; //導入依賴的package包/類
@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;
}
示例5: configureSalesforceUpdateSObjectComponent
import org.springframework.context.annotation.Lazy; //導入依賴的package包/類
@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;
}
開發者ID:syndesisio,項目名稱:connectors,代碼行數:37,代碼來源:SalesforceUpdateSObjectConnectorAutoConfiguration.java
示例6: kuaidiniaoApi
import org.springframework.context.annotation.Lazy; //導入依賴的package包/類
@Bean
@Lazy
public KuaidiniaoApi kuaidiniaoApi() {
ApiCredentialConfiguration[] apiCredentialConfigurations = {
kuaidiniaoApiCredentialConfigurationProduction(),
kuaidiniaoApiCredentialConfigurationSandbox()};
ApiEndpointConfiguration[] apiEndpointConfigurations = {
kuaidiniaoApiEndpointConfigurationProduction(),
kuaidiniaoApiEndpointConfigurationSandbox()};
return new KuaidiniaoApi(apiCredentialConfigurations,
apiEndpointConfigurations);
}
示例7: chromeDriverService
import org.springframework.context.annotation.Lazy; //導入依賴的package包/類
@Bean(destroyMethod = "stop")
@Lazy
public ChromeDriverService chromeDriverService() {
System.setProperty("webdriver.chrome.driver",
"ext/chromedriver");
return createDefaultService();
}
開發者ID:PacktPublishing,項目名稱:Learning-Spring-Boot-2.0-Second-Edition,代碼行數:8,代碼來源:WebDriverAutoConfiguration.java
示例8: UaaWebSecurityConfiguration
import org.springframework.context.annotation.Lazy; //導入依賴的package包/類
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;
}
示例9: getDept2
import org.springframework.context.annotation.Lazy; //導入依賴的package包/類
@Lazy
@Bean(name="dept2")
public Department getDept2(){
Department dept2 = new Department();
dept2.setDeptNo(13456);
dept2.setDeptName("History Department");
return dept2;
}
示例10: loginFlowHandlerMappingInterceptors
import org.springframework.context.annotation.Lazy; //導入依賴的package包/類
@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();
}
示例11: eventsEntityManagerFactory
import org.springframework.context.annotation.Lazy; //導入依賴的package包/類
@Lazy
@Bean
public LocalContainerEntityManagerFactoryBean eventsEntityManagerFactory() {
final LocalContainerEntityManagerFactoryBean bean =
Beans.newHibernateEntityManagerFactoryBean(
new JpaConfigDataHolder(
jpaEventVendorAdapter(),
"jpaEventRegistryContext",
jpaEventPackagesToScan(),
dataSourceEvent()),
casProperties.getEvents().getJpa());
return bean;
}
示例12: kuaidiniaoApiEndpointConfigurationProduction
import org.springframework.context.annotation.Lazy; //導入依賴的package包/類
@Bean
@Lazy
ApiEndpointConfiguration kuaidiniaoApiEndpointConfigurationProduction() {
KuaidiniaoApiEndpointConfiguration configuration = new KuaidiniaoApiEndpointConfiguration();
configuration.setKuaidiniaoQuery(queryProduction);
configuration.setApiRequestMode(ApiRequestMode.PRODUCTION);
return configuration;
}
示例13: memcachedClient
import org.springframework.context.annotation.Lazy; //導入依賴的package包/類
@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);
}
}
示例14: googleAccountsServiceResponseBuilder
import org.springframework.context.annotation.Lazy; //導入依賴的package包/類
@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());
}
示例15: mfaTrustStorageCleaner
import org.springframework.context.annotation.Lazy; //導入依賴的package包/類
@ConditionalOnMissingBean(name = "mfaTrustStorageCleaner")
@Bean
@Lazy
public MultifactorAuthenticationTrustStorageCleaner mfaTrustStorageCleaner(
@Qualifier("mfaTrustEngine") final MultifactorAuthenticationTrustStorage storage) {
return new MultifactorAuthenticationTrustStorageCleaner(casProperties.getAuthn().getMfa().getTrusted(), storage);
}