Java Code Examples for org.springframework.context.annotation.ScopedProxyMode#INTERFACES
The following examples show how to use
org.springframework.context.annotation.ScopedProxyMode#INTERFACES .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OAuth2RestOperationsConfiguration.java From spring-security-oauth2-boot with Apache License 2.0 | 6 votes |
@Bean @Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES) public DefaultOAuth2ClientContext oauth2ClientContext() { DefaultOAuth2ClientContext context = new DefaultOAuth2ClientContext(new DefaultAccessTokenRequest()); Authentication principal = SecurityContextHolder.getContext().getAuthentication(); if (principal instanceof OAuth2Authentication) { OAuth2Authentication authentication = (OAuth2Authentication) principal; Object details = authentication.getDetails(); if (details instanceof OAuth2AuthenticationDetails) { OAuth2AuthenticationDetails oauthsDetails = (OAuth2AuthenticationDetails) details; String token = oauthsDetails.getTokenValue(); context.setAccessToken(new DefaultOAuth2AccessToken(token)); } } return context; }
Example 2
Source File: ServiceConfiguration.java From prebid-server-java with Apache License 2.0 | 6 votes |
@Bean @Scope(scopeName = VertxContextScope.NAME, proxyMode = ScopedProxyMode.INTERFACES) @ConditionalOnProperty(prefix = "http-client.circuit-breaker", name = "enabled", havingValue = "true") CircuitBreakerSecuredHttpClient circuitBreakerSecuredHttpClient( Vertx vertx, Metrics metrics, HttpClientProperties httpClientProperties, @Qualifier("httpClientCircuitBreakerProperties") CircuitBreakerProperties circuitBreakerProperties, Clock clock) { final HttpClient httpClient = createBasicHttpClient(vertx, httpClientProperties.getMaxPoolSize(), httpClientProperties.getConnectTimeoutMs(), httpClientProperties.getUseCompression(), httpClientProperties.getMaxRedirects(), httpClientProperties.getSsl(), httpClientProperties.getJksPath(), httpClientProperties.getJksPassword()); return new CircuitBreakerSecuredHttpClient(vertx, httpClient, metrics, circuitBreakerProperties.getOpeningThreshold(), circuitBreakerProperties.getOpeningIntervalMs(), circuitBreakerProperties.getClosingIntervalMs(), clock); }
Example 3
Source File: TemplateEngineSupplierProducer.java From portals-pluto with Apache License 2.0 | 5 votes |
@Bean @Scope(proxyMode = ScopedProxyMode.INTERFACES) public TemplateEngineSupplier getTemplateEngineSupplier(PortletConfig portletConfig, ServletContext servletContext, BeanFactory beanFactory) { TemplateEngine templateEngine = new TemplateEngine(); templateEngine.setMessageResolver(new PortletMessageResolver(portletConfig)); templateEngine.setTemplateResolver(new PortletTemplateResolver(servletContext, new SpringConfigurationSupplier(beanFactory))); return new DefaultTemplateEngineSupplier(templateEngine); }
Example 4
Source File: GitHubConfiguration.java From codeway_service with GNU General Public License v3.0 | 5 votes |
@Bean @Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES) public GitHub gitHub(ConnectionRepository repository) { Connection<GitHub> connection = repository .findPrimaryConnection(GitHub.class); return connection != null ? connection.getApi() : null; }
Example 5
Source File: FacebookConfiguration.java From OAuth-2.0-Cookbook with MIT License | 5 votes |
@Bean @ConditionalOnMissingBean(Facebook.class) @Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES) public Facebook facebook(ConnectionRepository repository) { Connection<Facebook> connection = repository .findPrimaryConnection(Facebook.class); return connection != null ? connection.getApi() : null; }
Example 6
Source File: GitHubConfiguration.java From OAuth-2.0-Cookbook with MIT License | 5 votes |
@Bean @Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES) public GitHub gitHub(ConnectionRepository repository) { Connection<GitHub> connection = repository .findPrimaryConnection(GitHub.class); return connection != null ? connection.getApi() : null; }
Example 7
Source File: JsfBeansAutoConfiguration.java From joinfaces with Apache License 2.0 | 5 votes |
@Bean("initParam") @ConditionalOnMissingBean(name = "initParam") @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode = ScopedProxyMode.INTERFACES) @SuppressWarnings("unchecked") public Map<String, String> initParameterMap() { return FacesContext.getCurrentInstance().getExternalContext().getInitParameterMap(); }
Example 8
Source File: GitHubConfiguration.java From oauth2lab with MIT License | 5 votes |
@Bean @Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES) public GitHub gitHub(ConnectionRepository repository) { Connection<GitHub> connection = repository .findPrimaryConnection(GitHub.class); return connection != null ? connection.getApi() : null; }
Example 9
Source File: JsfBeansAutoConfiguration.java From joinfaces with Apache License 2.0 | 4 votes |
@Bean("applicationScope") @ConditionalOnMissingBean(name = "applicationScope") @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode = ScopedProxyMode.INTERFACES) public Map<String, Object> applicationMap() { return FacesContext.getCurrentInstance().getExternalContext().getApplicationMap(); }
Example 10
Source File: StompWebSocketIntegrationTests.java From spring4-understanding with Apache License 2.0 | 4 votes |
@Bean @Scope(scopeName = "websocket", proxyMode = ScopedProxyMode.INTERFACES) public ScopedBean scopedBean() { return new ScopedBeanImpl("55"); }
Example 11
Source File: JsfBeansAutoConfiguration.java From joinfaces with Apache License 2.0 | 4 votes |
@Bean("headerValues") @ConditionalOnMissingBean(name = "headerValues") @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode = ScopedProxyMode.INTERFACES) public Map<String, String[]> headerValuesMap() { return FacesContext.getCurrentInstance().getExternalContext().getRequestHeaderValuesMap(); }
Example 12
Source File: JsfBeansAutoConfiguration.java From joinfaces with Apache License 2.0 | 4 votes |
@Bean("sessionScope") @ConditionalOnMissingBean(name = "sessionScope") @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode = ScopedProxyMode.INTERFACES) public Map<String, Object> sessionMap() { return FacesContext.getCurrentInstance().getExternalContext().getSessionMap(); }
Example 13
Source File: JsfBeansAutoConfiguration.java From joinfaces with Apache License 2.0 | 4 votes |
@Bean("param") @ConditionalOnMissingBean(name = "param") @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode = ScopedProxyMode.INTERFACES) public Map<String, String> requestParameterMap() { return FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap(); }
Example 14
Source File: JsfBeansAutoConfiguration.java From joinfaces with Apache License 2.0 | 4 votes |
@Bean("viewScope") @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode = ScopedProxyMode.INTERFACES) @ConditionalOnMissingBean(name = "viewScope") public Map<String, Object> viewMap() { return FacesContext.getCurrentInstance().getViewRoot().getViewMap(); }
Example 15
Source File: JDKProxyAppConfig.java From Hands-On-High-Performance-with-Spring-5 with MIT License | 4 votes |
@Bean @Scope(proxyMode=ScopedProxyMode.INTERFACES) public TransferService transferService(){ return new TransferServiceImpl(); }
Example 16
Source File: OAuth2Client.java From spring-google-openidconnect with MIT License | 4 votes |
@Bean @Scope(value = "session", proxyMode = ScopedProxyMode.INTERFACES) public OAuth2RestOperations googleOAuth2RestTemplate() { return new OAuth2RestTemplate(googleOAuth2Details(), oAuth2ClientContext); }
Example 17
Source File: EventBusConfiguration.java From vaadin4spring with Apache License 2.0 | 4 votes |
@Bean @Scope(value = VaadinUIScope.VAADIN_UI_SCOPE_NAME, proxyMode = ScopedProxyMode.INTERFACES) @EventBusProxy EventBus.UIEventBus proxiedUiEventBus() { return uiEventBus(); }
Example 18
Source File: JsfBeansAutoConfiguration.java From joinfaces with Apache License 2.0 | 4 votes |
@Bean("flowScope") @ConditionalOnMissingBean(name = "flowScope") @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode = ScopedProxyMode.INTERFACES) public Map<Object, Object> flowScope() { return FacesContext.getCurrentInstance().getApplication().getFlowHandler().getCurrentFlowScope(); }
Example 19
Source File: JsfBeansAutoConfiguration.java From joinfaces with Apache License 2.0 | 4 votes |
@Bean("cookie") @ConditionalOnMissingBean(name = "cookie") @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode = ScopedProxyMode.INTERFACES) public Map<String, Object> requestCookieMap() { return FacesContext.getCurrentInstance().getExternalContext().getRequestCookieMap(); }
Example 20
Source File: JsfBeansAutoConfiguration.java From joinfaces with Apache License 2.0 | 4 votes |
@Bean("paramValues") @ConditionalOnMissingBean(name = "paramValues") @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode = ScopedProxyMode.INTERFACES) public Map<String, String[]> requestParameterValuesMap() { return FacesContext.getCurrentInstance().getExternalContext().getRequestParameterValuesMap(); }