Adam Warski

17 May 2010

CDI & Weld Extensions in Git

dependency injection


I’ve created a new cdiext project at github, initially with two extensions:

  1. Stackable Security Interceptors, about which I blogged here and here. Example usage:
public @interface AdministratorOnly {

public class SecureBean {
    public void doSecret() { ... }
  1. Injectable ELEvaluator, which works both during a faces request and outside of one (e.g. during invocation of an MDB). Example usage:
private ELEvaluator elEvaluator;

void someMethod() {
    // ...
    Integer result = elEvaluator.evaluate(
            "#{testParam1 + 10 + testParam2}", Integer.class, params);
    // ...

Thanks to Dan Allen for helping out with this one.

There are also some tests done using Arquillian – looks like it’s going to be a great testing tool! :)


comments powered by Disqus

Any questions?

Can’t find the answer you’re looking for?