Though about this as well, but is there a real use case for this?
For a client proxy you might want to unwrap the current contextual instance . So maybe we should define two interfaces, something like WeldClientProxy extends WeldConstruct?
Hmm, as means to obtain metadata? Isn't it easier to just use BeanManager.getBeans() ?
For this you would need a correct bean type which is not always that easy to obtain.
Martin Kouba
added a comment - Though about this as well, but is there a real use case for this?
For a client proxy you might want to unwrap the current contextual instance . So maybe we should define two interfaces, something like WeldClientProxy extends WeldConstruct ?
Hmm, as means to obtain metadata? Isn't it easier to just use BeanManager.getBeans() ?
For this you would need a correct bean type which is not always that easy to obtain.
add possibility to distinguish client proxies (contextual reference) and intercepted subclasses (contextual instances)
Though about this as well, but is there a real use case for this?
allow to obtain javax.enterprise.inject.spi.Bean<T> for client proxies
Hmm, as means to obtain metadata? Isn't it easier to just use BeanManager.getBeans() ?
Matěj Novotný
added a comment - add possibility to distinguish client proxies (contextual reference) and intercepted subclasses (contextual instances)
Though about this as well, but is there a real use case for this?
allow to obtain javax.enterprise.inject.spi.Bean<T> for client proxies
Hmm, as means to obtain metadata? Isn't it easier to just use BeanManager.getBeans() ?
add possibility to distinguish client proxies (contextual reference) and intercepted subclasses (contextual instances)
allow to obtain javax.enterprise.inject.spi.Bean<T> for client proxies
Martin Kouba
added a comment - - edited Two more "features" come to my mind:
add possibility to distinguish client proxies (contextual reference) and intercepted subclasses (contextual instances)
allow to obtain javax.enterprise.inject.spi.Bean<T> for client proxies
Ok, any particular thoughts on how to do that?
I was thinking of adding an empty (marker) interface to API which all our proxies would implement. Therefore anyone having a dependency on API could do a simple check such as object instanceof WeldProxyMarkerInterface.
Furthermore, we could also provide a simple interface with boolean method for this check.
Matěj Novotný
added a comment - Ok, any particular thoughts on how to do that?
I was thinking of adding an empty (marker) interface to API which all our proxies would implement. Therefore anyone having a dependency on API could do a simple check such as
object instanceof WeldProxyMarkerInterface .
Furthermore, we could also provide a simple interface with boolean method for this check.
For a client proxy you might want to unwrap the current contextual instance
. So maybe we should define two interfaces, something like WeldClientProxy extends WeldConstruct?
For this you would need a correct bean type which is not always that easy to obtain.