use of org.apache.webbeans.spi.ContextsService in project deltaspike by apache.
the class OpenWebBeansContextControl method startSessionScope.
private void startSessionScope() {
ContextsService contextsService = getContextsService();
Object mockSession = null;
if (isServletApiAvailable()) {
mockSession = mockSessions.get();
if (mockSession == null) {
// we simply use the ThreadName as 'sessionId'
mockSession = OwbHelper.getMockSession(Thread.currentThread().getName());
mockSessions.set(mockSession);
}
}
contextsService.startContext(SessionScoped.class, mockSession);
}
use of org.apache.webbeans.spi.ContextsService in project deltaspike by apache.
the class OpenWebBeansContextControl method startApplicationScope.
private void startApplicationScope() {
ContextsService contextsService = getContextsService();
Object mockServletContext = null;
if (isServletApiAvailable()) {
mockServletContext = OwbHelper.getMockServletContext();
}
contextsService.startContext(ApplicationScoped.class, mockServletContext);
}
use of org.apache.webbeans.spi.ContextsService in project deltaspike by apache.
the class OpenWebBeansContextControl method startRequestScope.
private void startRequestScope() {
ContextsService contextsService = getContextsService();
contextsService.startContext(RequestScoped.class, null);
}
use of org.apache.webbeans.spi.ContextsService in project deltaspike by apache.
the class OpenWebBeansContextControl method stopSingletonScope.
/*
* stop scopes
*/
private void stopSingletonScope() {
ContextsService contextsService = getContextsService();
Object mockServletContext = null;
if (isServletApiAvailable()) {
mockServletContext = OwbHelper.getMockServletContext();
}
contextsService.endContext(Singleton.class, mockServletContext);
}
use of org.apache.webbeans.spi.ContextsService in project deltaspike by apache.
the class OpenWebBeansContextControl method stopRequestScope.
private void stopRequestScope() {
ContextsService contextsService = getContextsService();
contextsService.endContext(RequestScoped.class, null);
}
Aggregations