Package org.springframework.context.support

Examples of org.springframework.context.support.GenericXmlApplicationContext


  /**
   * @param args
   */
  public static void main(String[] args) {

    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.load("classpath:mybatis-app-context.xml");
    ctx.refresh();
   
    System.out.println("App context initialized successfully");       

    UserService userService = ctx.getBean("userService", UserService.class);
   
    AppUser appUser = userService.findByUserName("clarence");
   
    System.out.println("User name: " + appUser.getUserName());
  }
View Full Code Here


  /**
   * @param args
   */
  public static void main(String[] args) {

    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.load("classpath:jpa-app-context.xml");
    ctx.refresh();
   
    System.out.println("App context initialized successfully");
   
    CategoryService categoryService = ctx.getBean("categoryService", CategoryService.class);
   
    List<Category> categories = categoryService.findAllParentCategory();
   
    for (Category category: categories) {
      System.out.println("Category id: " + category.getCategoryId());
View Full Code Here

  /**
   * @param args
   */
  public static void main(String[] args) {

    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.load("classpath:jpa-app-context.xml");
    ctx.refresh();
   
    System.out.println("App context initialized successfully");
   
    EntryAuditService entryAuditService = ctx.getBean("entryAuditService", EntryAuditService.class);
 
    List<Entry> entries = entryAuditService.findAuditById(1l);
   
    for (Entry entry: entries) {
      System.out.println(entry);
View Full Code Here

  /**
   * @param args
   */
  public static void main(String[] args) {

    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.load("classpath:jpa-app-context.xml");
    ctx.refresh();
   
    System.out.println("App context initialized successfully");
   
    CommentService commentService = ctx.getBean("commentService", CommentService.class);
   
    List<Comment> comments = commentService.findByEntryId(1l);
   
    System.out.println("No of comments: " + comments.size());
   
View Full Code Here

  /**
   * @param args
   */
  public static void main(String[] args) {

    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.load("classpath:jpa-app-context.xml");
    ctx.refresh();
   
    System.out.println("App context initialized successfully");
   
    EntryService entryService = ctx.getBean("entryService", EntryService.class);
   
    List<Entry> entries = entryService.findByCategoryId("Spring");
   
    for (Entry entry: entries) {
      System.out.println(entry);
View Full Code Here

  /**
   * @param args
   */
  public static void main(String[] args) {

    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.load("classpath:mybatis-app-context.xml");
    ctx.refresh();
   
    System.out.println("App context initialized successfully");   
   
    EntryService entryService = ctx.getBean("entryService", EntryService.class);
   
    List<Entry> entries = entryService.findAll();
   
    //System.err.println("Size: " + entries.size());
    for (Entry entry: entries) System.out.println("Entry: " + entry);
View Full Code Here

  /**
   * @param args
   */
  public static void main(String[] args) {

    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.load("classpath:mybatis-app-context.xml");
    ctx.refresh();
   
    System.out.println("App context initialized successfully");   
   
    EntryService entryService = ctx.getBean("entryService", EntryService.class);
   
    List<Entry> entries = entryService.findByCategoryId("Spring");
   
    for (Entry entry: entries) {
      System.out.println(entry);
View Full Code Here

*/
public class SupportXmlTests {

  @Test
  public void testContainerSetup() throws Exception {
    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(
        "/org/springframework/data/keyvalue/redis/support/collections/container.xml");

    RedisList list = ctx.getBean("non-existing", RedisList.class);
    RedisProperties props = ctx.getBean("props", RedisProperties.class);
    Map map = ctx.getBean("map", Map.class);
  }
View Full Code Here

  private GenericXmlApplicationContext ctx;

  @Before
  public void setUp() {
    ctx = new GenericXmlApplicationContext("/org/springframework/data/keyvalue/redis/pe.xml");
  }
View Full Code Here

    private ApplicationContext applicationContext;

    @Override
    public Promise<String> deploy(String springTemplate) {
        Resource templateResource = new ByteArrayResource(springTemplate.getBytes());
        GenericXmlApplicationContext appContext = new GenericXmlApplicationContext();
        appContext.setParent(applicationContext);
        appContext.load(templateResource);
        appContext.refresh();
        ApplicationStack applicationStack = appContext.getBean("applicationStack", ApplicationStack.class);
        applicationStack.deploy();
        return applicationStack.getUrl();
    }
View Full Code Here

TOP

Related Classes of org.springframework.context.support.GenericXmlApplicationContext

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.