Example usage for org.apache.wicket.cdi CdiConfiguration CdiConfiguration

List of usage examples for org.apache.wicket.cdi CdiConfiguration CdiConfiguration

Introduction

In this page you can find the example usage for org.apache.wicket.cdi CdiConfiguration CdiConfiguration.

Prototype

public CdiConfiguration(BeanManager beanManager) 

Source Link

Document

Constructor

Usage

From source file:cz.muni.exceptions.web.AbstractExceptionsTest.java

License:Apache License

@Before
public void setUp() throws NamingException {
    tester = new WicketTester(getWebApplication());
    new CdiConfiguration(beanManager).configure(tester.getApplication());
}

From source file:eu.uqasar.web.UQasar.java

License:Apache License

/**
 *
 *///  w w w  . j  av  a2  s .com
private void configureCDIInjecttion() {
    BeanManager manager = null;
    InitialContext ic = null;
    try {
        ic = new InitialContext();
        // Standard JNDI binding
        manager = (BeanManager) ic.lookup("java:comp/BeanManager");
    } catch (NameNotFoundException e) {
        if (ic == null) {
            throw new RuntimeException("No InitialContext");
        }

        // Weld/Tomcat
        try {
            manager = (BeanManager) ic.lookup("java:comp/env/BeanManager");
        } catch (NamingException e1) {
            // JBoss 5/6 (maybe obsolete in Weld 1.0+)
            try {
                manager = (BeanManager) ic.lookup("java:app/BeanManager");
            } catch (NamingException e2) {
                throw new RuntimeException("Could not find Bean Manager", e2);
            }
        }
    } catch (NamingException e) {
        throw new RuntimeException("Could not find Bean Manager", e);
    }

    new CdiConfiguration(manager).configure(this);
}

From source file:org.jnotary.client.web.WicketApplication.java

License:Open Source License

@Override
public void init() {
    super.init();
    // Get BeanManager.
    BeanManager bm;// w ww.  j av  a 2s  .c o m
    try {
        bm = (BeanManager) new InitialContext().lookup("java:comp/BeanManager");
    } catch (NamingException e) {
        throw new IllegalStateException("Unable to obtain CDI BeanManager", e);
    }
    // Configure CDI, disabling Conversations as we aren't using them
    new CdiConfiguration(bm).configure(this);

    uploadFolder = new Folder(System.getProperty("java.io.tmpdir"), "wicket-uploads");
    // Ensure folder exists
    uploadFolder.mkdirs();

    getApplicationSettings().setUploadProgressUpdatesEnabled(true);

}

From source file:org.jnotary.service.web.WicketApplication.java

License:Open Source License

@Override
public void init() {
    super.init();
    // Get BeanManager.
    BeanManager bm;/*w w w  .ja v  a 2  s  .  c o m*/
    try {
        bm = (BeanManager) new InitialContext().lookup("java:comp/BeanManager");
    } catch (NamingException e) {
        throw new IllegalStateException("Unable to obtain CDI BeanManager", e);
    }

    // Configure CDI, disabling Conversations as we aren't using them
    new CdiConfiguration(bm).configure(this);
}