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


Java ConversationScoped类代码示例

本文整理汇总了Java中javax.enterprise.context.ConversationScoped的典型用法代码示例。如果您正苦于以下问题:Java ConversationScoped类的具体用法?Java ConversationScoped怎么用?Java ConversationScoped使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ConversationScoped类属于javax.enterprise.context包,在下文中一共展示了ConversationScoped类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startAsynchronous

import javax.enterprise.context.ConversationScoped; //导入依赖的package包/类
/**
 * Does actually not work
 */
@Override
@Asynchronous
public void startAsynchronous(final IWorkflowListener listener)
{
	try
	{
		CdiContextAwareRunnable runnable = new CdiContextAwareRunnable(this.newWorkflowRunnable(listener));
		// runnable.addContext(RequestScoped.class);
		runnable.addContext(SessionScoped.class);
		// runnable.addContext(ApplicationScoped.class);
		runnable.addContext(ConversationScoped.class);

		runnable.run();
	}
	catch (WorkflowException e)
	{
		LOG.error(e.getMessage(), e);
	}
}
 
开发者ID:sebfz1,项目名称:wicket-quickstart-cdi-async,代码行数:23,代码来源:WorkflowBean.java

示例2: isPassivatingScope

import javax.enterprise.context.ConversationScoped; //导入依赖的package包/类
public boolean isPassivatingScope() {
    final CdiEjbBean<?> bean = get(CdiEjbBean.class);
    if (bean == null) {
        return true;
    }

    if (ConversationScoped.class == bean.getScope()) {
        try {
            return !bean.getWebBeansContext().getConversationManager().getConversationBeanReference().isTransient();
        } catch (final RuntimeException re) { // conversation not found for instance so act as @RequestScoped
            return false;
        }
    }

    return true;
}
 
开发者ID:apache,项目名称:tomee,代码行数:17,代码来源:BeanContext.java

示例3: startConversation

import javax.enterprise.context.ConversationScoped; //导入依赖的package包/类
@Before
public void startConversation() {
    final WebBeansContext webBeansContext = WebBeansContext.currentInstance();
    webBeansContext.registerService(ConversationService.class, new ConversationService() {
        @Override
        public String getConversationId() {
            return "conversation-test";
        }

        @Override
        public String generateConversationId() {
            return "cid_1";
        }
    });
    webBeansContext.getService(ContextsService.class).startContext(ConversationScoped.class, null);
}
 
开发者ID:apache,项目名称:tomee,代码行数:17,代码来源:StatefulConversationScopedTOMEE1138Test.java

示例4: startContexts

import javax.enterprise.context.ConversationScoped; //导入依赖的package包/类
@Override
public void startContexts()
{
    wrapped.startContexts();

    if (isManualScopeHandling())
    {
        for (ExternalContainer externalContainer : CdiTestRunner.getActiveExternalContainers())
        {
            externalContainer.startScope(Singleton.class);
            externalContainer.startScope(ApplicationScoped.class);
            externalContainer.startScope(RequestScoped.class);
            externalContainer.startScope(SessionScoped.class);
            externalContainer.startScope(ConversationScoped.class);
        }
    }
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:18,代码来源:ContextControlDecorator.java

示例5: stopContexts

import javax.enterprise.context.ConversationScoped; //导入依赖的package包/类
@Override
public void stopContexts()
{
    if (isManualScopeHandling())
    {
        for (ExternalContainer externalContainer : CdiTestRunner.getActiveExternalContainers())
        {
            externalContainer.stopScope(ConversationScoped.class);
            externalContainer.stopScope(SessionScoped.class);
            externalContainer.stopScope(RequestScoped.class);
            externalContainer.stopScope(ApplicationScoped.class);
            externalContainer.stopScope(Singleton.class);
        }
    }

    wrapped.stopContexts();
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:18,代码来源:ContextControlDecorator.java

示例6: startContext

import javax.enterprise.context.ConversationScoped; //导入依赖的package包/类
@Override
public void startContext(Class<? extends Annotation> scopeClass)
{
    if (scopeClass.isAssignableFrom(ApplicationScoped.class))
    {
        startApplicationScope();
    }
    else if (scopeClass.isAssignableFrom(SessionScoped.class))
    {
        startSessionScope();
    }
    else if (scopeClass.isAssignableFrom(RequestScoped.class))
    {
        startRequestScope();
    }
    else if (scopeClass.isAssignableFrom(ConversationScoped.class))
    {
        startConversationScope();
    }
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:21,代码来源:OpenWebBeansContextControl.java

示例7: stopContext

import javax.enterprise.context.ConversationScoped; //导入依赖的package包/类
public void stopContext(Class<? extends Annotation> scopeClass)
{
    if (scopeClass.isAssignableFrom(ApplicationScoped.class))
    {
        stopApplicationScope();
    }
    else if (scopeClass.isAssignableFrom(SessionScoped.class))
    {
        stopSessionScope();
    }
    else if (scopeClass.isAssignableFrom(RequestScoped.class))
    {
        stopRequestScope();
    }
    else if (scopeClass.isAssignableFrom(ConversationScoped.class))
    {
        stopConversationScope();
    }
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:20,代码来源:OpenWebBeansContextControl.java

示例8: startContext

import javax.enterprise.context.ConversationScoped; //导入依赖的package包/类
@Override
public void startContext(Class<? extends Annotation> scopeClass)
{
    if (scopeClass.isAssignableFrom(ApplicationScoped.class))
    {
        startApplicationScope();
    }
    else if (scopeClass.isAssignableFrom(SessionScoped.class))
    {
        startSessionScope();
    }
    else if (scopeClass.isAssignableFrom(RequestScoped.class))
    {
        startRequestScope();
    }
    else if (scopeClass.isAssignableFrom(ConversationScoped.class))
    {
        startConversationScope(null);
    }
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:21,代码来源:WeldContextControl.java

示例9: stopContext

import javax.enterprise.context.ConversationScoped; //导入依赖的package包/类
@Override
public void stopContext(Class<? extends Annotation> scopeClass)
{
    if (scopeClass.isAssignableFrom(ApplicationScoped.class))
    {
        stopApplicationScope();
    }
    else if (scopeClass.isAssignableFrom(SessionScoped.class))
    {
        stopSessionScope();
    }
    else if (scopeClass.isAssignableFrom(RequestScoped.class))
    {
        stopRequestScope();
    }
    else if (scopeClass.isAssignableFrom(ConversationScoped.class))
    {
        stopConversationScope();
    }
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:21,代码来源:WeldContextControl.java

示例10: createDeployment

import javax.enterprise.context.ConversationScoped; //导入依赖的package包/类
@Deployment
public static WebArchive createDeployment() {
    String url = SimpleGetApi.class.getName() + "/mp-rest/url=http://localhost:8080";
    String url2 = MyConversationScopedApi.class.getName() + "/mp-rest/url=http://localhost:8080";
    String scope = SimpleGetApi.class.getName() + "/mp-rest/scope=" + ConversationScoped.class.getName();
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class)
        .addClasses(SimpleGetApi.class, MyConversationScopedApi.class)
        .addAsManifestResource(new StringAsset(url + "\n" + scope + "\n" + url2), "microprofile-config.properties")
        .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
    return ShrinkWrap.create(WebArchive.class)
        .addAsLibrary(jar)
        .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
}
 
开发者ID:eclipse,项目名称:microprofile-rest-client,代码行数:14,代码来源:HasConversationScopeTest.java

示例11: cdiScopeAnnotationsConfigurer

import javax.enterprise.context.ConversationScoped; //导入依赖的package包/类
@Bean
@ConditionalOnProperty(value = "jsf.scope-configurer.cdi.enabled", havingValue = "true", matchIfMissing = true)
public static BeanFactoryPostProcessor cdiScopeAnnotationsConfigurer(Environment environment) {
	CustomScopeAnnotationConfigurer scopeAnnotationConfigurer = new CustomScopeAnnotationConfigurer();

	scopeAnnotationConfigurer.setOrder(environment.getProperty("jsf.scope-configurer.cdi.order", Integer.class, Ordered.LOWEST_PRECEDENCE));

	scopeAnnotationConfigurer.addMapping(RequestScoped.class, WebApplicationContext.SCOPE_REQUEST);
	scopeAnnotationConfigurer.addMapping(SessionScoped.class, WebApplicationContext.SCOPE_SESSION);
	scopeAnnotationConfigurer.addMapping(ConversationScoped.class, WebApplicationContext.SCOPE_SESSION);
	scopeAnnotationConfigurer.addMapping(ApplicationScoped.class, WebApplicationContext.SCOPE_APPLICATION);

	return scopeAnnotationConfigurer;
}
 
开发者ID:joinfaces,项目名称:joinfaces,代码行数:15,代码来源:CdiScopeAnnotationsAutoConfiguration.java

示例12: produce

import javax.enterprise.context.ConversationScoped; //导入依赖的package包/类
@ExtensionManaged
@Produces
@ConversationScoped
public EntityManager produce() 
{
     EntityManager entityManager = entityManagerFactory.createEntityManager();
     // .. do somthing with entity manager
     return entityManager;
 
}
 
开发者ID:Inspiredsoft,项目名称:parco,代码行数:11,代码来源:EntityManagerProducer.java

示例13: getEntityManagerFactory

import javax.enterprise.context.ConversationScoped; //导入依赖的package包/类
@Produces
@ConversationScoped
@PersistenceUnit
@Default
public EntityManagerFactory getEntityManagerFactory() {
    return emf;
}
 
开发者ID:intuit,项目名称:Tank,代码行数:8,代码来源:EntityManagerProducer.java

示例14: create

import javax.enterprise.context.ConversationScoped; //导入依赖的package包/类
@Produces
@Main
@ConversationScoped
public EntityManager create()
{
    return this.emfA.createEntityManager();
}
 
开发者ID:Contourdynamics,项目名称:smartcommunication,代码行数:8,代码来源:EntityManagerProducer.java

示例15: getCurrentItem

import javax.enterprise.context.ConversationScoped; //导入依赖的package包/类
/**
 * Produces the selected item for the current context
 * @return 
 */
@Produces @SelectedItem @Named("selectedItem") @ConversationScoped
public Item getCurrentItem() {
    if(item == null) {
        item = new Item();
    }
    return item;
}
 
开发者ID:rcuprak,项目名称:actionbazaar,代码行数:12,代码来源:ItemController.java


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