Search in sources :

Example 21 with Weld

use of org.jboss.weld.environment.se.Weld in project jersey by jersey.

the class GrizzlyApp method start.

protected static void start() {
    weld = new Weld();
    weld.initialize();
    server = GrizzlyHttpServerFactory.createHttpServer(BASE_URI, createJaxRsApp(), true);
}
Also used : Weld(org.jboss.weld.environment.se.Weld)

Example 22 with Weld

use of org.jboss.weld.environment.se.Weld in project jersey by jersey.

the class AppScopedResourceTest method setUp.

@Override
public void setUp() throws Exception {
    weld = new Weld();
    weld.initialize();
    super.setUp();
}
Also used : Weld(org.jboss.weld.environment.se.Weld)

Example 23 with Weld

use of org.jboss.weld.environment.se.Weld in project jersey by jersey.

the class RequestScopeAlignmentTest method before.

@BeforeClass
public static void before() throws Exception {
    weld = new Weld();
    weld.initialize();
}
Also used : Weld(org.jboss.weld.environment.se.Weld) BeforeClass(org.junit.BeforeClass)

Example 24 with Weld

use of org.jboss.weld.environment.se.Weld in project jersey by jersey.

the class App method main.

public static void main(String[] args) {
    try {
        System.out.println("Jersey CDI Example App");
        final Weld weld = new Weld();
        weld.initialize();
        final HttpServer server = GrizzlyHttpServerFactory.createHttpServer(BASE_URI, createJaxRsApp(), false);
        Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {

            @Override
            public void run() {
                server.shutdownNow();
                weld.shutdown();
            }
        }));
        server.start();
        System.out.println(String.format("Application started.\nTry out %s%s\nStop the application using CTRL+C", BASE_URI, "application.wadl"));
        Thread.currentThread().join();
    } catch (IOException | InterruptedException ex) {
        Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
    }
}
Also used : HttpServer(org.glassfish.grizzly.http.server.HttpServer) IOException(java.io.IOException) Weld(org.jboss.weld.environment.se.Weld)

Example 25 with Weld

use of org.jboss.weld.environment.se.Weld in project jersey by jersey.

the class CdiTest method setUp.

@Override
public void setUp() throws Exception {
    weld = new Weld();
    weld.initialize();
    super.setUp();
}
Also used : Weld(org.jboss.weld.environment.se.Weld)

Aggregations

Weld (org.jboss.weld.environment.se.Weld)36 WeldContainer (org.jboss.weld.environment.se.WeldContainer)12 Test (org.junit.Test)9 BeforeClass (org.junit.BeforeClass)6 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 PrintStream (java.io.PrintStream)3 ArrayList (java.util.ArrayList)2 KieServicesImpl (org.drools.compiler.kie.builder.impl.KieServicesImpl)2 Before (org.junit.Before)2 File (java.io.File)1 IOException (java.io.IOException)1 URL (java.net.URL)1 URLClassLoader (java.net.URLClassLoader)1 Bean (javax.enterprise.inject.spi.Bean)1 BeanManager (javax.enterprise.inject.spi.BeanManager)1 Extension (javax.enterprise.inject.spi.Extension)1 Bus (org.apache.cxf.Bus)1 BootOptions (org.commonjava.indy.boot.BootOptions)1 BootStatus (org.commonjava.indy.boot.BootStatus)1 KieContainerImpl (org.drools.compiler.kie.builder.impl.KieContainerImpl)1