Examples of ApplicationContext


Examples of org.milyn.container.ApplicationContext

                    if(resultSetScope == ResultSetScope.EXECUTION) {
                        beanContext.addBean(resultSetBeanId, statementExec.executeUnjoinedQuery(connection), source);
                    } else {
                        List<Map<String, Object>> resultMap;
                        // Cached in the application context...
                        ApplicationContext appContext = executionContext.getContext();
                        ResultSetContextObject rsContextObj = ResultSetContextObject.getInstance(rsAppContextKey, appContext);

                        if(rsContextObj.hasExpired()) {
                            synchronized (rsContextObj) {
                                if(rsContextObj.hasExpired()) {
View Full Code Here

Examples of org.springframework.context.ApplicationContext

   
    public void onApplicationEvent(ApplicationEvent applicationEvent)
    {
        if (applicationEvent instanceof ContextRefreshedEvent) {
            ContextRefreshedEvent initEvent = (ContextRefreshedEvent) applicationEvent;
            ApplicationContext context = initEvent.getApplicationContext();
            if (context != null) {
                configureMappings(context.getBeansOfType(Controller.class));
                configureInterceptors(context.getBeansOfType(HandlerInterceptor.class));
                configureRequestHandlers(context);
                configureValidators(context);
            }
        }
    }
View Full Code Here

Examples of org.springframework.context.ApplicationContext

    }

    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.ApplicationContext

        extends AbstractXFireSpringTest
{
    public void testServiceFactory()
            throws Exception
    {
        ApplicationContext appContext = getContext();
       
        appContext.getBean("xfire.xmlbeansServiceFactory");
    }
View Full Code Here

Examples of org.springframework.context.ApplicationContext

        extends AbstractXFireSpringTest
{
    public void testSpringIntegration()
            throws Exception
    {
        ApplicationContext appContext = getContext();
       
        assertNotNull(appContext.getBean("xfire.serviceFactory"));
        assertNotNull(appContext.getBean("echo"));
       
        ServiceBean service = (ServiceBean) appContext.getBean("echoService");
        assertNotNull(service);
       
        assertNotNull(service.getXFireService());
       
        ServiceRegistry reg = (ServiceRegistry) appContext.getBean("xfire.serviceRegistry");
        assertTrue(reg.hasService(service.getXFireService().getSimpleName()));
       
        assertNotNull(service.getInHandlers());
    }
View Full Code Here

Examples of org.springframework.context.ApplicationContext

   
    public void onApplicationEvent(ApplicationEvent applicationEvent)
    {
        if (applicationEvent instanceof ContextRefreshedEvent) {
            ContextRefreshedEvent initEvent = (ContextRefreshedEvent) applicationEvent;
            ApplicationContext context = initEvent.getApplicationContext();
            if (context != null) {
                configureMappings(context.getBeansOfType(Controller.class));
                configureInterceptors(context.getBeansOfType(HandlerInterceptor.class));
                configureRequestHandlers(context);
                configureValidators(context);
            }
        }
    }
View Full Code Here

Examples of org.springframework.context.ApplicationContext

   
   
    List<FacetHandler<?>> fConf=null;
   
    Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
    ApplicationContext appCtx=null;
    try{
      appCtx=new FileSystemXmlApplicationContext("file:"+fConfFile.getAbsolutePath());
      fConf =  (List<FacetHandler<?>>)appCtx.getBean("handlers");
    }
    catch(Exception e){
      throw new BuildException(e.getMessage(),e);
    }
   
View Full Code Here

Examples of org.springframework.context.ApplicationContext

      "classpath:net/sourceforge/squirrel_sql/client/update/gui/installer/event/net.sourceforge.squirrel_sql.client.update.gui.installer.event.applicationContext.xml",
      "classpath:net/sourceforge/squirrel_sql/client/update/gui/installer/util/net.sourceforge.squirrel_sql.client.update.gui.installer.util.applicationContext.xml",
      "classpath:net/sourceforge/squirrel_sql/client/update/util/net.sourceforge.squirrel_sql.client.update.util.applicationContext.xml"
    };
       
    ApplicationContext ctx = new ClassPathXmlApplicationContext(appCtx);
    return (PreLaunchHelper)ctx.getBean(PreLaunchHelper.class.getName());
  }
View Full Code Here

Examples of org.springframework.context.ApplicationContext

@Test
public class ReconfigProcessorTest {

  public void testGetDefinition() {
    ApplicationContext factory = new ClassPathXmlApplicationContext("/context.xml");
    // two user provider
    assertNotNull((UserDaoProvider) factory.getBean("userDaoProvider"));

    assertNotNull((UserLdapProvider) factory.getBean("userLdapProvider"));

    // userService
    UserService userService = (UserService) factory.getBean("userService");

    assertNotNull(userService);

    assertNotNull(userService.getSomeMap());

    assertEquals(userService.getProvider().getClass(), UserDaoProvider.class);

    // userLdapService
    UserService userLdapService = (UserService) factory.getBean("userLdapService");

    assertNotNull(userLdapService);

    assertEquals(UserLdapProvider.class, userLdapService.getProvider().getClass());
  }
View Full Code Here

Examples of org.springframework.context.ApplicationContext

    assertEquals(UserLdapProvider.class, userLdapService.getProvider().getClass());
  }

  public void testOverride() {
    ApplicationContext factory = new ClassPathXmlApplicationContext("/context-config.xml");
    // userService
    UserService userService = (UserService) factory.getBean("userService");

    assertNotNull(userService);

    // unmerged map
    assertNotNull(userService.getSomeMap());

    assertEquals(1, userService.getSomeMap().size());

    assertEquals(userService.getSomeMap().get("string"), "override string");

    // merged list
    assertEquals(userService.getSomeList().size(), 3);

    // change class
    UserLdapProvider ldapProvider = (UserLdapProvider) factory.getBean("userLdapProvider");
    assertTrue(ldapProvider instanceof AdvancedUserLdapProvider);

    UserService userLdapService = (UserService) factory.getBean("userLdapService");
    assertNotNull(userLdapService);

    assertEquals(AdvancedUserLdapProvider.class, userLdapService.getProvider().getClass());

  }
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.