Hi!
I grabed a lot of info this week and now like to hear what you think of the
following approach.
Currently our plugin API (org.apache.webbeans.plugins.OpenWebBeansPlugin) has a
lot functions which have simply been taken from our original internal
implementation and changed to be iterable over all registered plugins.
Since about 2 month, the JSR-299 spec contains a lot of SPI interfaces itself,
and while they most times don't force us to change our internal architecture,
it sometimes would make more sense to strongly adopt it.
So I e.g. ask myself if it would be a good idea to completely rewrite our
plugin API and only check if the plugin provides functionality for a specific
use case and return the proper spi interface if it likes to handle it.
e.g. instead of
public void isManagedBean(Class<?> clazz) throws WebBeansConfigurationException;
public Object injectResource(Type type, Annotation[] annotations);
we may also define a
Producer<T> handleProduction(Class<T> clazz); (maybe we need additional
parameters)
If a certain plugin likes to handle the clazz, it returns the Producer for it.
E.g. if the clazz is a @Stateful session bean, the EjbPlugin will return a
EjbBeanProducerImpl or something.
I'm not sure if you can follow my thoughts, but I hope you get the direction.
It's basically about moving the plugin API to a higher abstraction level and
not dealing with as much implementation details as we currently do.
wdyt?
LieGrue,
strub