Hm, I'd say that getScopes() should be enough. You could use isContextActive() + getContext() to obtain the context without ContextNotActiveException and eventually test with instanceof WeldAlterableContext.