Java Code Examples for org.springframework.context.annotation.ScopedProxyMode#TARGET_CLASS

The following examples show how to use org.springframework.context.annotation.ScopedProxyMode#TARGET_CLASS . 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: EnableMBeanExportConfigurationTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Bean
@Lazy
@Scope(proxyMode = ScopedProxyMode.TARGET_CLASS)
public AnnotationTestBean testBean() {
	AnnotationTestBean bean = new AnnotationTestBean();
	bean.setName("TEST");
	bean.setAge(100);
	return bean;
}
 
Example 2
Source File: JsfBeansAutoConfiguration.java    From joinfaces with Apache License 2.0 5 votes vote down vote up
/**
 * Spring bean definition for the JSF {@link FacesContext}.
 *
 * @see com.sun.faces.cdi.FacesContextProducer
 * @return The current {@link FacesContext#getCurrentInstance() FacesContext}.
 */
@Bean("facesContext")
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode = ScopedProxyMode.TARGET_CLASS)
@ConditionalOnMissingBean
public FacesContext facesContext() {
	return FacesContext.getCurrentInstance();
}
 
Example 3
Source File: GatekeeperCommonConfig.java    From Gatekeeper with Apache License 2.0 5 votes vote down vote up
@Bean
@Scope(value = "request", proxyMode = ScopedProxyMode.TARGET_CLASS)
public IGatekeeperUserProfile userProfile() {
    HttpServletRequest req = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
    Principal p = req.getUserPrincipal();
    return (IGatekeeperUserProfile) p;
}
 
Example 4
Source File: EnableMBeanExportConfigurationTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Bean
@Lazy
@Scope(proxyMode = ScopedProxyMode.TARGET_CLASS)
public AnnotationTestBean testBean() {
	AnnotationTestBean bean = new AnnotationTestBean();
	bean.setName("TEST");
	bean.setAge(100);
	return bean;
}
 
Example 5
Source File: Spr10744Tests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Bean
@Scope(value = "myTestScope",  proxyMode = ScopedProxyMode.TARGET_CLASS)
@Override
public Foo foo() {
	return new Foo();
}
 
Example 6
Source File: Neo4jConfig.java    From spring4-sandbox with Apache License 2.0 4 votes vote down vote up
@Bean
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
public Session getSession() throws Exception {
	return super.getSession();
}
 
Example 7
Source File: ScopedServiceConfiguration.java    From grpc-spring-boot-starter with MIT License 4 votes vote down vote up
@Bean
@Scope(scopeName = GrpcRequestScope.GRPC_REQUEST_SCOPE_NAME, proxyMode = ScopedProxyMode.TARGET_CLASS)
RequestId requestId() {
    return new RequestId();
}
 
Example 8
Source File: RequestContextHolderTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Bean
@Scope(scopeName = "request", proxyMode = ScopedProxyMode.TARGET_CLASS)
public RequestScopedController requestScopedController() {
	return new RequestScopedController();
}
 
Example 9
Source File: Spr10744Tests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Bean
@Scope(value = "myTestScope",  proxyMode = ScopedProxyMode.TARGET_CLASS)
@Override
public Foo foo() {
	return new Foo();
}
 
Example 10
Source File: JsfBeansAutoConfiguration.java    From joinfaces with Apache License 2.0 4 votes vote down vote up
@Bean("view")
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode = ScopedProxyMode.TARGET_CLASS)
@ConditionalOnMissingBean
public UIViewRoot viewRoot() {
	return FacesContext.getCurrentInstance().getViewRoot();
}
 
Example 11
Source File: RequestContextHolderTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Bean
@Scope(scopeName = "request", proxyMode = ScopedProxyMode.TARGET_CLASS)
public RequestScopedController requestScopedController() {
	return new RequestScopedController();
}
 
Example 12
Source File: AdminfacesAutoConfiguration.java    From joinfaces with Apache License 2.0 4 votes vote down vote up
@Bean
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
public AdminSession adminSession() {
	return new AdminSession();
}
 
Example 13
Source File: BeanMethodQualificationTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Bean @Boring @Scope(value="prototype", proxyMode=ScopedProxyMode.TARGET_CLASS)
public TestBean testBean2(TestBean testBean1) {
	TestBean tb = new TestBean("boring");
	tb.setSpouse(testBean1);
	return tb;
}
 
Example 14
Source File: BeanMethodQualificationTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Bean @Qualifier("interesting") @Scope(value="prototype", proxyMode=ScopedProxyMode.TARGET_CLASS)
public TestBean testBean1() {
	return new TestBean("interesting");
}
 
Example 15
Source File: JsfBeansAutoConfiguration.java    From joinfaces with Apache License 2.0 4 votes vote down vote up
@Bean("request")
@ConditionalOnMissingBean
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode = ScopedProxyMode.TARGET_CLASS)
public Object request() {
	return FacesContext.getCurrentInstance().getExternalContext().getRequest();
}
 
Example 16
Source File: Configs.java    From verifydata with Apache License 2.0 4 votes vote down vote up
@Bean("verifyErrorMessage")
@Scope(scopeName = "request", proxyMode = ScopedProxyMode.TARGET_CLASS)
public Responses responseBody() {
    return new Responses();
}
 
Example 17
Source File: ScopesConfig.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
@Scope(scopeName = "websocket", proxyMode = ScopedProxyMode.TARGET_CLASS)
public HelloMessageGenerator websocketScopedBean() {
    return new HelloMessageGenerator();
}
 
Example 18
Source File: ScopesConfig.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
@Scope(value = WebApplicationContext.SCOPE_REQUEST, proxyMode = ScopedProxyMode.TARGET_CLASS)
public HelloMessageGenerator requestScopedBean() {
    return new HelloMessageGenerator();
}
 
Example 19
Source File: BeanMethodQualificationTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Bean @Boring @Scope(value="prototype", proxyMode=ScopedProxyMode.TARGET_CLASS)
public TestBean testBean2(TestBean testBean1) {
	TestBean tb = new TestBean("boring");
	tb.setSpouse(testBean1);
	return tb;
}
 
Example 20
Source File: JsfBeansAutoConfiguration.java    From joinfaces with Apache License 2.0 4 votes vote down vote up
@Bean("session")
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode = ScopedProxyMode.TARGET_CLASS)
@ConditionalOnMissingBean
public Object session() {
	return FacesContext.getCurrentInstance().getExternalContext().getSession(false);
}