Java and JBoss related stuff
RSS icon Home icon
  • CDI & Weld Extensions in Git

    Posted on May 17th, 2010 Adam Warski No comments

    Hello,

    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:

    
    @SecureBinding
    @Secure("#{loggedInUser.administrator}")
    public @interface AdministratorOnly {
    }
    
    public class SecureBean {
        @AdministratorOnly
        @Secure("#{additionalSecurityCheck}")
        public void doSecret() { ... }
    }
    

    2. Injectable ELEvaluator, which works both during a faces request and outside of one (e.g. during invocation of an MDB). Example usage:

    
    @Inject
    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! :)

    Adam

    Leave a reply