* @param scopeType scope type
* @return true if also creates context.
*/
private int activateContexts(Class<? extends Annotation> scopeType)
{
ContextsService service = webBeansContext.getService(ContextsService.class);
Context ctx = service.getCurrentContext(scopeType);
ContextFactory contextFactory = webBeansContext.getContextFactory();
if(scopeType == RequestScoped.class)
{
if(ctx != null && !ctx.isActive())
{
contextFactory.activateContext(scopeType);
return 0;
}
else if(ctx == null)
{
contextFactory.initRequestContext(null);
return 1;
}
}
ctx = service.getCurrentContext(scopeType);
if(ctx != null && !ctx.isActive())
{
contextFactory.activateContext(scopeType);
return 0;
}