Package com.exelate.sample.cditest

Source Code of com.exelate.sample.cditest.MainEntryPoint

/*
* eXelate samples suite
*
* @author {@link "mailto:mottyc@exelate.com"}
*
* Copyright (C) 2012 eXelate, ALL RIGHTS RESERVED
*/

package com.exelate.sample.cditest;

import org.jboss.weld.environment.se.Weld;
import org.jboss.weld.environment.se.WeldContainer;

/**
* Sample initialization of bean container using java style
* entry point "public static void main(...)"
*
* @author mottyc
*
*/
public class MainEntryPoint {
 
  /**
   * Main entry point
   * @param args
   */
  public static void main(String[] args) {

    // Create new Weld Container
    Weld weld = new Weld();
   
    // All the components initialization and wiring is done here
    WeldContainer container = weld.initialize();
   
    // Get application instance
    // This instance will be initialized with all required components
    MyApplication app = container.instance().select(MyApplication.class).get();
   
    // Do your things
    app.doSomething();
   
    // Close container
    weld.shutdown();
  }
}
TOP

Related Classes of com.exelate.sample.cditest.MainEntryPoint

TOP
Copyright © 2018 www.massapi.com. 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.