當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。