protected void start(Weld weld) { try { if (weld == null) { weld = new Weld(); } containerInstance = weld.initialize(); } catch (IllegalArgumentException e) { throw new CucumberException(START_EXCEPTION_MESSAGE, e); } }
public static void main(String[] args) { try { System.out.println("\"Hello World\" Jersey Example Weld App"); final Weld weld = new Weld(); weld.initialize(); final ResourceConfig resourceConfig = createJaxRsApp(); final HttpServer server = GrizzlyHttpServerFactory.createHttpServer(BASE_URI, resourceConfig, 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, ROOT_PATH)); Thread.currentThread().join(); } catch (IOException | InterruptedException ex) { Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex); } }
protected static void start() { weld = new Weld(); weld.initialize(); server = GrizzlyHttpServerFactory.createHttpServer(BASE_URI, createJaxRsApp(), true); }
public static void main(String[] args) throws Exception { Weld weld = new Weld(); final WeldContainer container = weld.initialize(); RequestContext requestContext= container.instance().select(RequestContext.class, UnboundLiteral.INSTANCE).get(); requestContext.activate(); final MyPojo pojo = container.instance().select(MyPojo.class).get(); Thread t = new Thread() { public void run() { RequestContext requestContext= container.instance().select(RequestContext.class, UnboundLiteral.INSTANCE).get(); requestContext.activate(); System.out.println("1" + pojo.ping()); } }; t.start(); t.join(); System.out.println("2" + pojo.ping()); weld.shutdown(); }
public static void main(String[] args) throws IOException { Weld weld = new Weld(); WeldContainer container = weld.initialize(); Application application = container.instance().select(Application.class).get(); application.run(); weld.shutdown(); }
@Override public WeldContainer initialize() { weld = super.initialize(); return weld; }
private void startWeld() { logger.debug("Starting Weld for test class " + testClass.getCanonicalName()); weld = new Weld(testClass.getCanonicalName()); weldContainer = weld.initialize(); }
@Override protected void doStart() throws Exception { weld = new Weld(); delegate = weld.initialize(); }
/** * Must be called to initialize the bean manager. */ public void initialize() { weld = new Weld(); container = weld.initialize(); beanManager = container.getBeanManager(); }
public void start() { if (weld == null) { weld = new Weld(); } if (weldContainer == null) { weldContainer = weld.initialize(); } if (contexts == null) { contexts = getContexts(); } }
Weld weld = new Weld(); WeldContainer container = weld.initialize(); World helloWorld = container.instance().select(World.class).get(); System.out.println(helloWorld.helloWorld()); weld.shutdown();
public static void main(String[] args) { try { Weld weld = new Weld(); WeldContainer container = weld.initialize(); Fabric8MQ fabric8MQ = container.instance().select(Fabric8MQ.class).get(); fabric8MQ.start(); waitUntilStop(); } catch (Throwable e) { e.printStackTrace(); LOG.error("Failed to Start Fabric8-MQ", e); } }
public static void main(String[] args) { try { Weld weld = new Weld(); WeldContainer container = weld.initialize(); AMQBroker amqBroker = container.instance().select(AMQBroker.class).get(); amqBroker.start(); waitUntilStop(); } catch (Throwable e) { e.printStackTrace(); LOG.error("Failed to Start AMQ_Broker", e); } }
public void setUp() throws Exception { // Bootstrap WELD container weld = new Weld(); WeldContainer weldContainer = weld.initialize(); beanManager = weldContainer.getBeanManager(); // Instantiate Paths used in tests for Path conversion paths = getReference(Paths.class); // Ensure URLs use the default:// scheme // fileSystemProvider.forceAsDefault(); }
private TaskServiceModule() { weld = new Weld(); this.container = weld.initialize(); this.taskService = this.container.instance().select(TaskServiceEntryPointImpl.class).get(); //Singleton.. that we need to instantiate this.container.instance().select(TaskLifeCycleEventListener.class).get(); }
public WeldJUnit4Runner(final Class<Object> klass) throws InitializationError { super(klass); this.klass = klass; this.weld = new Weld(); this.container = weld.initialize(); }
// Initialize Weld Weld theWeld = new Weld(); WeldContainer theContainer = theWeld.initialize(); // Execute the run method theContainer.instance().select(Main.class).get().run(); // Shutting down Weld again theWeld.shutdown();
public static void main(String[] args) { final Instance<Object> weldInstance = new Weld().initialize().instance(); weldInstance.select(ConsoleViewer.class).get().displayMessage(); } }
@BeforeClass public static void beforeClass() { CDITestRunner.setUp(); CDITestRunner.weld = CDITestRunner.createWeld( KieServicesInjectionTest.class.getName() ); CDITestRunner.container = CDITestRunner.weld.initialize(); }
@Before public void setUp() { final Weld weld = new Weld(); container = weld.initialize(); bus = getBeanReference(Bus.class); }