In CDI we have the Vetoed annotation[1] that vetoes the class, but we can't
use expression to represent exclude this class. This feature would useful
to many things, for example, an internationalization of payment[2] or just
have a class that should not run when is in production. In Delta Spike[3],
already there are this improvement.
[
1]http://docs.jboss.org/cdi/api/1.2/javax/enterprise/inject/Vetoed.html
[2]
public interface Payment {
void pay();
}
@Vetoed(onExpression = "instance eq brazil", interpretedBy =
PaymentInterpreter.class)
class BrazilianPayment implements Payment {
...
}
@Vetoed(onExpression = "instance eq mexico", interpretedBy =
PaymentInterpreter.class)
class MexicanPayment implements Payment {
...
}
[
3]https://deltaspike.apache.org/documentation/core.html#__exclude
--
Otávio Gonçalves de Santana
twitter:
http://twitter.com/otaviojava
site: *http://about.me/otaviojava <
http://about.me/otaviojava>*
55 (11) 98255-3513