Package org.jboss.weld.environment.se

Examples of org.jboss.weld.environment.se.Weld


               initLogging();

               boolean restarting = restartRequested;
               restartRequested = false;

               Weld weld = new ModularWeld();
               BeanManager manager = null;

               // FIXME this plugin loading scheme causes classloading issues w/weld because weld cannot load classes
               // from its own classloaders before plugins are loaded and pollute the classpath.
               // We can work around it by loading weld before we load plugins, then restarting weld, but this is SLOW.
               try {
                  WeldContainer container = weld.initialize();
                  manager = container.getBeanManager();
                  weld.shutdown();
               }
               catch (Exception e) {}

               try {
                  // TODO verify plugin API versions. only activate compatible plugins.
                  loadPlugins();
                  WeldContainer container = weld.initialize();
                  manager = container.getBeanManager();
               }
               catch (Throwable e) {
                  // Boot up with external plugins disabled.
                  System.out
                           .println("Plugin system disabled due to failure while loading one or more plugins; try removing offending plugins with \"forge remove-plugin <TAB>\".");
                  e.printStackTrace();

                  Thread.currentThread().setContextClassLoader(mainClassLoader);

                  initLogging();
                  WeldContainer container = weld.initialize();
                  manager = container.getBeanManager();
               }

               manager.fireEvent(new PreStartup());
               manager.fireEvent(new Startup(workingDir, restarting));
               manager.fireEvent(new PostStartup());
               manager.fireEvent(new AcceptUserInput());
               weld.shutdown();
            }
         });

         currentShell.start();
         try
View Full Code Here


            /**
             * Experimental stand-alone Weld-support
             */
            if (bm == null) {
                try {
                    Weld weld = new Weld();
                    ctx.bind(BEAN_MANAGER_JNDI, weld.initialize().getBeanManager());
                    return lookupBeanManager();
                } catch (NamingException e2) {
                    bm = null;
                }

View Full Code Here

     * Either use the unit test Jcr2VfsMigrationAppTest (recommended): it sets up the input and output dirs for you.
     * Or run it and fill in -i and -o correctly.
     * @param args never null
     */
    public static void main(String... args) {
        Weld weld = new Weld();
        WeldContainer weldContainer = weld.initialize();

        Jcr2VfsMigrater migrater = weldContainer.instance().select(Jcr2VfsMigrater.class).get();
        if(migrater.parseArgs(args)) {
            migrater.migrateAll();
        }

        weld.shutdown();
        System.exit(hasErrors ? -1 : 0);
    }
View Full Code Here

        private Weld weld;
        private WeldContainer weldContainer;
        private Contexts contexts;

        public void start() {
                weld = new Weld();
                weldContainer = weld.initialize();
                contexts = getContexts();
        }
View Full Code Here

*/
public class ShowcaseBundleExtractor {

    public static void main(String[] args) throws Exception {
        // First of all, init the CDI container.
        WeldContainer weldContainer = new Weld().initialize();
        CDIBeanLocator.beanManager = weldContainer.getBeanManager();

        // Mock up the app directories.
        String rootDir = System.getProperty("user.dir") + "/modules/dashboard-samples";
        Application.lookup().setBaseAppDirectory(rootDir + "/src/main/webapp");
View Full Code Here

public class CDIExampleWithInclusionTest {

    @Test
    public void testGo() {
        Weld w = new Weld();
        WeldContainer wc = w.initialize();

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        PrintStream ps = new PrintStream(baos);

        CDIExampleWithInclusion bean = wc.instance().select(CDIExampleWithInclusion.class).get();
        bean.go(ps);

        ps.close();

        String actual = new String(baos.toByteArray());
        String expected = "" +
                          "Dave: Hello, HAL. Do you read me, HAL?\n" +
                          "HAL: Dave. I read you.\n" +
                          "Dave: Open the pod bay doors, HAL.\n" +
                          "HAL: I'm sorry, Dave. I'm afraid I can't do that.\n";
        assertEquals(expected, actual);

        w.shutdown();
    }
View Full Code Here

    }


    private WeldContainer getWeldContainer() {
        if (weldContainer == null) {
            weldContainer = (new Weld()).initialize();
        }
        return weldContainer;
    }
View Full Code Here


    @Override
    public synchronized void boot()
    {
        weld = new Weld();
        weldContainer = weld.initialize();
    }
View Full Code Here

  private Class<?> clazz;
 
  public WeldJunitRunner(Class<?> testClass) throws InitializationError {
    super(testClass);
    new Weld().initialize();
    this.clazz = testClass;
  }
View Full Code Here

    public TestContainer start() {
        validateConfiguration();
        setProbeClassLoader();
        LOG.debug("starting Weld container");
        weld = new Weld();
        weldContainer = weld.initialize();
        isValid = true;
        return this;
    }
View Full Code Here

TOP

Related Classes of org.jboss.weld.environment.se.Weld

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.