Some of the important algorithms outlined in pseudo-code in the spec are already available to developers of extensions, e.g. BeanManager#resolve, BeanManager#resolveDecorators and BeanManager#resolveObserverMethods. However, underlying those are other algorithms which are currently not made available to the programmer without depending on specific vendors, the type assignability rules. It is of course possible to implement the algorithms by hand when needed, the spec is clear enough to do that, but the rules are subtle enough that this is error prone and not completely trivial.
Specific use case that I have in mind: I'd like to add to the CDI container's event mechanism by also delivering events to consumers which can be registered and unregistered at runtime. In order to be consistent, I'd like the consumers to conform to the same strict type rules that observer methods have. Unfortunately, there is no quick and simple way to apply these rules except for diving into Weld's source code and stealing what I need hoping that I don't inadvertently break some subtle edge case in the process.
Some of the important algorithms outlined in pseudo-code in the spec are already available to developers of extensions, e.g. BeanManager#resolve, BeanManager#resolveDecorators and BeanManager#resolveObserverMethods. However, underlying those are other algorithms which are currently not made available to the programmer without depending on specific vendors, the type assignability rules. It is of course possible to implement the algorithms by hand when needed, the spec is clear enough to do that, but the rules are subtle enough that this is error prone and not completely trivial.
Specific use case that I have in mind: I'd like to add to the CDI container's event mechanism by also delivering events to consumers which can be registered and unregistered at runtime. In order to be consistent, I'd like the consumers to conform to the same strict type rules that observer methods have. Unfortunately, there is no quick and simple way to apply these rules except for diving into Weld's source code and stealing what I need hoping that I don't inadvertently break some subtle edge case in the process.