View Javadoc

1   /*
2    * The contents of this file are subject to the terms 
3    * of the Common Development and Distribution License 
4    * (the "License").  You may not use this file except 
5    * in compliance with the License.
6    * 
7    * You can obtain a copy of the license at 
8    * http://www.sun.com/cddl/cddl.html. 
9    * See the License for the specific language governing 
10   * permissions and limitations under the License.
11   * 
12   * When distributing Covered Code, include this CDDL 
13   * HEADER in each file and include the License file at 
14   * license.txt.  If applicable, add the following below 
15   * this CDDL HEADER, with the fields enclosed by brackets 
16   * "[]" replaced with your own identifying information: 
17   * Portions Copyright [yyyy] [name of copyright owner]
18   * 
19   * Portions Copyright 2004 eBay, Inc.
20   */
21  package com.ebay.carad.os.vitalsigns.util;
22  
23  import org.springframework.context.ApplicationContext;
24  import org.springframework.context.support.FileSystemXmlApplicationContext;
25  
26  /***
27   * Used for starting the dashboard using a Spring loaded context.
28   * TODO : usage instructions
29   * 
30   * @author Jeremy Thomerson
31   * @version $Id$
32   */
33  public class SpringBootstrapper {
34  
35  	public static void main(String[] args) {
36          if (args.length != 2) {
37              System.out.println("must supply two arguments to this class:");
38              System.out.println("1 - file path to config xml file");
39              System.out.println("2 - bean name of IDashboardAgent to run");
40          }
41  		ApplicationContext context = new FileSystemXmlApplicationContext(args[0]);
42  		Runnable bean = (Runnable) context.getBean(args[1]);
43  		bean.run();
44  	}
45  
46  }