Is it expected that unlike @Alternate you cannot apply @Vetoed using a stereotype?
Yes, stereotype has a rather narrow scope of what can be defined on it.
Or is there a way to configure the excludes via SeContainerInitializer?
No, the exclusions are done on a per-archive basis, same as you would enablclazz.getName() + " " + UUID.randomUUID()e alternatives/interceptors via beans.xml. And in SE you either have discovery and beans.xml where you can specify it, or you use synthetic bean archive where you have full control over what gets inside, therefore you don't really need filters.
Why "plus some suffix"?
Habit I guess... just so that you don't collide with some default, even though that's extremely unlikely. The random you posted is fine, you could also go with some common suffix for all classes you register such as clazz.getName() + " _manuallyRegistered". Anything, really.
That was more a sad gibe, that addAnnotatedType(AnnotatedType<?>, String) should better also return an AnnotatedTypeConfigurator
There are use cases where registering whole AnnotatedType is preferable to just using configurator. It is actually more powerful, but far more complex.
From what I read there, the @Vetoed beans should also trigger a ProcessAnnotatedType event and I could remove the @Vetoed annotation there.
What Martin said is right, with @Vetoed you'd need to register the AT manually through BeforeBeanDiscovery.addAnnotatedType(). |