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 . These examples are extracted from open source projects. 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
@Bean
@Lazy
@Scope(proxyMode = ScopedProxyMode.TARGET_CLASS)
public AnnotationTestBean testBean() {
	AnnotationTestBean bean = new AnnotationTestBean();
	bean.setName("TEST");
	bean.setAge(100);
	return bean;
}
 
Example 2
/**
 * 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
@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
@Bean
@Lazy
@Scope(proxyMode = ScopedProxyMode.TARGET_CLASS)
public AnnotationTestBean testBean() {
	AnnotationTestBean bean = new AnnotationTestBean();
	bean.setName("TEST");
	bean.setAge(100);
	return bean;
}
 
Example 5
@Bean("session")
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode = ScopedProxyMode.TARGET_CLASS)
@ConditionalOnMissingBean
public Object session() {
	return FacesContext.getCurrentInstance().getExternalContext().getSession(false);
}
 
Example 6
@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 7
Source Project: tutorials   File: ScopesConfig.java    License: 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 8
Source Project: tutorials   File: ScopesConfig.java    License: MIT License 4 votes vote down vote up
@Bean
@Scope(scopeName = "websocket", proxyMode = ScopedProxyMode.TARGET_CLASS)
public HelloMessageGenerator websocketScopedBean() {
    return new HelloMessageGenerator();
}
 
Example 9
Source Project: verifydata   File: Configs.java    License: 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 10
@Bean("request")
@ConditionalOnMissingBean
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode = ScopedProxyMode.TARGET_CLASS)
public Object request() {
	return FacesContext.getCurrentInstance().getExternalContext().getRequest();
}
 
Example 11
@Bean @Qualifier("interesting") @Scope(value="prototype", proxyMode=ScopedProxyMode.TARGET_CLASS)
public TestBean testBean1() {
	return new TestBean("interesting");
}
 
Example 12
@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 13
Source Project: java-technology-stack   File: Spr10744Tests.java    License: MIT License 4 votes vote down vote up
@Bean
@Scope(value = "myTestScope",  proxyMode = ScopedProxyMode.TARGET_CLASS)
@Override
public Foo foo() {
	return new Foo();
}
 
Example 14
@Bean
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
public AdminSession adminSession() {
	return new AdminSession();
}
 
Example 15
@Bean
@Scope(scopeName = "request", proxyMode = ScopedProxyMode.TARGET_CLASS)
public RequestScopedController requestScopedController() {
	return new RequestScopedController();
}
 
Example 16
@Bean("view")
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode = ScopedProxyMode.TARGET_CLASS)
@ConditionalOnMissingBean
public UIViewRoot viewRoot() {
	return FacesContext.getCurrentInstance().getViewRoot();
}
 
Example 17
@Bean
@Scope(value = "myTestScope",  proxyMode = ScopedProxyMode.TARGET_CLASS)
@Override
public Foo foo() {
	return new Foo();
}
 
Example 18
@Bean
@Scope(scopeName = "request", proxyMode = ScopedProxyMode.TARGET_CLASS)
public RequestScopedController requestScopedController() {
	return new RequestScopedController();
}
 
Example 19
@Bean
@Scope(scopeName = GrpcRequestScope.GRPC_REQUEST_SCOPE_NAME, proxyMode = ScopedProxyMode.TARGET_CLASS)
RequestId requestId() {
    return new RequestId();
}
 
Example 20
Source Project: spring4-sandbox   File: Neo4jConfig.java    License: 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();
}