Package org.springframework.context.support

Examples of org.springframework.context.support.ClassPathXmlApplicationContext


        if (StringUtils.hasText(startupContextPath)) {
            if (logger.isInfoEnabled()) {
                logger.info("Loading startup context from classpath resource [" + startupContextPath + "]");
            }

            return new ClassPathXmlApplicationContext(startupContextPath);
        } else {
            return null;
        }
    }
View Full Code Here


     * which the application context will be loaded.
     *
     * @return The main application context, never null.
     */
    private ApplicationContext loadRootApplicationContext(String[] configLocations, MessageSource messageSource) {
        final ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(configLocations, false);

        if (splashScreen instanceof MonitoringSplashScreen) {
            final ProgressMonitor tracker = ((MonitoringSplashScreen) splashScreen).getProgressMonitor();

            applicationContext.addBeanFactoryPostProcessor(
                    new ProgressMonitoringBeanFactoryPostProcessor(tracker, messageSource));

        }
       
        applicationContext.refresh();

        return applicationContext;
    }
View Full Code Here

    public static ApplicationContext getApplicationContext() {
        if (Application.isLoaded())
            ctx = Application.instance().getApplicationContext();
        else
            ctx = new ClassPathXmlApplicationContext(new String[]{APP_CONTEXT});
        return ctx;
    }
View Full Code Here

  private ClassPathXmlApplicationContext context;

  @Before
  public void setUp() throws Exception {
    context = new ClassPathXmlApplicationContext("applicationContext.xml");
  }
View Full Code Here

{
    private SoapClient client;


    public HelloClient(String beanName) {
        BeanFactory factory = new ClassPathXmlApplicationContext("hello_client_config.xml");
        client = (SoapClient) factory.getBean(beanName);
        client.addInFaultDetailsHandler(new ExceptionReader());
    }
View Full Code Here

   *
   */
  public static void main(String[] pArgs) throws Exception {

    //load spring application context
    ClassPathXmlApplicationContext context =
      new ClassPathXmlApplicationContext(
          ApplicationConstants.CORE_SPRING_CONFIG_FILE);
   
    //load dispatcher from spring
    Dispatcher dispatcher = (Dispatcher) context.getBean("Dispatcher");

    //configure an download job filter
    DownloadJobFilter filter = new DownloadJobFilter();
    filter.setAllowedHostNames(new String[] {".*"});
    filter.setMaxRecursionDepth(1);
    filter.setSaveToDisk(new String[] {
        ".*jpg",
        ".*png",
        ".*gif"});
   
    //add the filter to the dispatcher
    dispatcher.addJobFilter(filter);   
   
    //create an job factory
    DownloadJobFactory jobFactory = (DownloadJobFactory)
      context.getBean("JobFactory");
   
    //create an initial job
    UrlDownloadJob job = jobFactory.createDownloadJob();
    job.setUrl(new URL("http://itsucks.sourceforge.net/"));
    job.setSavePath(new File("/tmp/crawl")); //change this for windows
View Full Code Here

    }

    public void testSpringIntegration()
            throws Exception
    {
        ApplicationContext appContext = new ClassPathXmlApplicationContext(new String[]{
            "/org/codehaus/xfire/spring/xfire.xml",
            "/org/codehaus/xfire/spring/remoting/exporterTest.xml"});

        assertNotNull(appContext.getBean("xfire.serviceFactory"));
        assertNotNull(appContext.getBean("echo"));
        XFireExporter exporter = (XFireExporter) appContext.getBean("/Echo");
        assertNotNull(exporter);
        BeanNameUrlHandlerMapping handlerMapping = new BeanNameUrlHandlerMapping();
        handlerMapping.setApplicationContext(appContext);
        HttpServletRequest request = getRequest();
View Full Code Here

        assertTrue(reg.hasService("EchoImpl"));
    }

    protected ApplicationContext createContext()
    {
        return new ClassPathXmlApplicationContext(new String[] {
                "/org/codehaus/xfire/spring/xfire.xml",
                "/org/codehaus/xfire/spring/remoting/handlerMapping.xml"
        });
    }
View Full Code Here

        assertEquals("bleh", response);
    }
   
    protected ApplicationContext createContext()
    {
        return new ClassPathXmlApplicationContext(new String[] {
                "/org/codehaus/xfire/spring/xfire.xml",
                "/org/codehaus/xfire/spring/remoting/exporterTest.xml",
                "/org/codehaus/xfire/spring/remoting/proxyFactoryTest.xml" });
    }
View Full Code Here

        appContext.getBean("xfire.xmlbeansServiceFactory");
    }

    protected ApplicationContext createContext()
    {
        return new ClassPathXmlApplicationContext(new String[]{
                "/org/codehaus/xfire/spring/xfire.xml",
                "/org/codehaus/xfire/spring/xfireXmlBeans.xml"});
    }
View Full Code Here

TOP

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

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.