Examples of ClassPathXmlApplicationContext


Examples of org.springframework.context.support.ClassPathXmlApplicationContext

     * 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

Examples of org.springframework.context.support.ClassPathXmlApplicationContext

    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

Examples of org.springframework.context.support.ClassPathXmlApplicationContext

  private ClassPathXmlApplicationContext context;

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

Examples of org.springframework.context.support.ClassPathXmlApplicationContext

{
    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

Examples of org.springframework.context.support.ClassPathXmlApplicationContext

   *
   */
  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

Examples of org.springframework.context.support.ClassPathXmlApplicationContext

    }

    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

Examples of org.springframework.context.support.ClassPathXmlApplicationContext

        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

Examples of org.springframework.context.support.ClassPathXmlApplicationContext

        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

Examples of org.springframework.context.support.ClassPathXmlApplicationContext

        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

Examples of org.springframework.context.support.ClassPathXmlApplicationContext

        assertEquals(0, endpoint.getBindings().size());
    }
   
    protected ApplicationContext createContext()
    {
        return new ClassPathXmlApplicationContext(new String[]{
                "/org/codehaus/xfire/spring/xfire.xml",
                "/org/codehaus/xfire/spring/serviceBean.xml"});
    }
View Full Code Here
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.