* @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());
}