当前位置: 首页>>代码示例>>Java>>正文


Java ContextsService.startContext方法代码示例

本文整理汇总了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));
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:20,代码来源:RequestScopedThreadContextListener.java

示例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);
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:18,代码来源:OpenWebBeansContextControl.java

示例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);
}
 
开发者ID:HotswapProjects,项目名称:HotswapAgent,代码行数:8,代码来源:HAOpenWebBeansTestLifeCycle.java

示例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);
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:11,代码来源:OpenWebBeansContextControl.java

示例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);
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:11,代码来源:OpenWebBeansContextControl.java

示例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);
}
 
开发者ID:HotswapProjects,项目名称:HotswapAgent,代码行数:7,代码来源:HAAbstractUnitTest.java

示例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);
}
 
开发者ID:apache,项目名称:tomee,代码行数:6,代码来源:ScopeHelper.java

示例8: startRequestScope

import org.apache.webbeans.spi.ContextsService; //导入方法依赖的package包/类
private void startRequestScope()
{
    ContextsService contextsService = getContextsService();

    contextsService.startContext(RequestScoped.class, null);
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:7,代码来源:OpenWebBeansContextControl.java

示例9: startConversationScope

import org.apache.webbeans.spi.ContextsService; //导入方法依赖的package包/类
private void startConversationScope()
{
    ContextsService contextsService = getContextsService();

    contextsService.startContext(ConversationScoped.class, null);
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:7,代码来源:OpenWebBeansContextControl.java


注:本文中的org.apache.webbeans.spi.ContextsService.startContext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。