本文整理汇总了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);
}