Package org.apache.webbeans.spi

Examples of org.apache.webbeans.spi.ContextsService


        }
    }

    public static void destroySessionContext(Object session)
    {
        ContextsService contextService = getContextsService();
        contextService.endContext(SessionScoped.class, session);
    }
View Full Code Here


     */
    public static void initApplicationContext(Object parameter)
    {
        try
        {
            ContextsService contextService = getContextsService();
            contextService.startContext(ApplicationScoped.class, parameter);
        }
        catch (Exception e)
        {
            logger.error(e);
        }
View Full Code Here

     *
     * @param parameter parameter object
     */
    public static void destroyApplicationContext(Object parameter)
    {
        ContextsService contextService = getContextsService();
        contextService.endContext(ApplicationScoped.class, parameter);
    }
View Full Code Here

   
    public static void initSingletonContext(Object parameter)
    {
        try
        {
            ContextsService contextService = getContextsService();
            contextService.startContext(Singleton.class, parameter);
        }
        catch (Exception e)
        {
            logger.error(e);           
        }
View Full Code Here

        }
    }
   
    public static void destroySingletonContext(Object parameter)
    {
        ContextsService contextService = getContextsService();
        contextService.endContext(Singleton.class, parameter);
    }
View Full Code Here

    public static void initConversationContext(Object context)
    {
        try
        {
            ContextsService contextService = getContextsService();
            contextService.startContext(ConversationScoped.class, context);
        }
        catch (Exception e)
        {
            logger.error(e);           
        }
View Full Code Here

        }
    }

    public static void destroyConversationContext()
    {
        ContextsService contextService = getContextsService();
        contextService.endContext(ConversationScoped.class, null);
    }
View Full Code Here

     * @throws IllegalArgumentException if the type is not a standard context
     */
    public static Context getStandardContext(ContextTypes type) throws ContextNotActiveException
    {
        Context context = null;
        ContextsService contextService = getContextsService();
        switch (type.getCardinal())
        {
            case 0:
                context = contextService.getCurrentContext(RequestScoped.class);
                break;
   
            case 1:
                context = contextService.getCurrentContext(SessionScoped.class);
                break;
   
            case 2:
                context = contextService.getCurrentContext(ApplicationScoped.class);
                break;
   
            case 3:
                context = contextService.getCurrentContext(ConversationScoped.class);
                break;
               
            case 4:
                context = contextService.getCurrentContext(Dependent.class);
                break;

            case 5:
                context = contextService.getCurrentContext(Singleton.class);
                break;
               
            default:
                throw new IllegalArgumentException("There is no such a standard context with context id=" + type.getCardinal());
        }
View Full Code Here

    /**
     * Activate context.
     */
    public static void activateContext(Class<? extends Annotation> scopeType)
    {
        ContextsService contextService = getContextsService();
        contextService.activateContext(scopeType);
    }
View Full Code Here

    /**
     * Deactivate context.
     */
    public static void deActivateContext(Class<? extends Annotation> scopeType)
    {
        ContextsService contextService = getContextsService();
        contextService.deActivateContext(scopeType);
    }
View Full Code Here

TOP

Related Classes of org.apache.webbeans.spi.ContextsService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.