本文整理汇总了Java中org.apache.webbeans.spi.ContextsService.startContext方法的典型用法代码示例。如果您正苦于以下问题:Java ContextsService.startContext方法的具体用法?Java ContextsService.startContext怎么用?Java ContextsService.startContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.webbeans.spi.ContextsService
的用法示例。
在下文中一共展示了ContextsService.startContext方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: contextEntered
import org.apache.webbeans.spi.ContextsService; //导入方法依赖的package包/类
@Override
public void contextEntered(final ThreadContext oldContext, final ThreadContext newContext) {
final BeanContext beanContext = newContext.getBeanContext();
final WebBeansContext webBeansContext = beanContext.getModuleContext().getAppContext().getWebBeansContext();
if (webBeansContext == null) {
return;
}
final ContextsService contextsService = webBeansContext.getContextsService();
final Context requestContext = CdiAppContextsService.class.cast(contextsService).getRequestContext(false);
if (requestContext == null) {
contextsService.startContext(RequestScoped.class, CdiAppContextsService.EJB_REQUEST_EVENT);
newContext.set(DestroyContext.class, new DestroyContext(contextsService, newContext));
}
}
示例2: startSessionScope
import org.apache.webbeans.spi.ContextsService; //导入方法依赖的package包/类
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);
}
示例3: beforeStartApplication
import org.apache.webbeans.spi.ContextsService; //导入方法依赖的package包/类
public void beforeStartApplication(Object object)
{
WebBeansContext webBeansContext = getWebBeansContext();
ContextsService contextsService = webBeansContext.getContextsService();
contextsService.startContext(Singleton.class, null);
contextsService.startContext(ApplicationScoped.class, null);
}
示例4: startSingletonScope
import org.apache.webbeans.spi.ContextsService; //导入方法依赖的package包/类
private void startSingletonScope()
{
ContextsService contextsService = getContextsService();
Object mockServletContext = null;
if (isServletApiAvailable())
{
mockServletContext = OwbHelper.getMockServletContext();
}
contextsService.startContext(Singleton.class, mockServletContext);
}
示例5: startApplicationScope
import org.apache.webbeans.spi.ContextsService; //导入方法依赖的package包/类
private void startApplicationScope()
{
ContextsService contextsService = getContextsService();
Object mockServletContext = null;
if (isServletApiAvailable())
{
mockServletContext = OwbHelper.getMockServletContext();
}
contextsService.startContext(ApplicationScoped.class, mockServletContext);
}
示例6: restartContext
import org.apache.webbeans.spi.ContextsService; //导入方法依赖的package包/类
protected void restartContext(Class<? extends Annotation> scopeType)
{
ContextsService contextsService = webBeansContext.getContextsService();
contextsService.endContext(scopeType, null);
contextsService.startContext(scopeType, null);
}
示例7: startContexts
import org.apache.webbeans.spi.ContextsService; //导入方法依赖的package包/类
public static void startContexts(final ContextsService contextsService, final ServletContext servletContext, final HttpSession session) throws Exception {
contextsService.startContext(SessionScoped.class, session);
contextsService.startContext(RequestScoped.class, null);
contextsService.startContext(ConversationScoped.class, null);
}
示例8: startRequestScope
import org.apache.webbeans.spi.ContextsService; //导入方法依赖的package包/类
private void startRequestScope()
{
ContextsService contextsService = getContextsService();
contextsService.startContext(RequestScoped.class, null);
}
示例9: startConversationScope
import org.apache.webbeans.spi.ContextsService; //导入方法依赖的package包/类
private void startConversationScope()
{
ContextsService contextsService = getContextsService();
contextsService.startContext(ConversationScoped.class, null);
}