Package org.springframework.context.event

Examples of org.springframework.context.event.ContextRefreshedEvent


    }

    @Test
    public void testApplicationContextEvent() {
        ApplicationContext expected = Mockito.mock(ApplicationContext.class);
        ContextRefreshedEvent event = new ContextRefreshedEvent(expected);
        ApplicationContext actual = SpringEventReferenceCollectionAspect.getApplicationContext(event);
        assertSame("Mismatched context instances", expected, actual);
        assertNotNull("Missing extraction method mapping", SpringEventReferenceCollectionAspect.contextMethods.get(event.getClass()));
        assertFalse("Event class marked as without context", SpringEventReferenceCollectionAspect.nonContextEvents.contains(event.getClass()));
    }
View Full Code Here


    realm.setPasswordEncoder(passwordEncoder);
    saltSource = new ReflectionSaltSource();
    saltSource.setUserPropertyToUse("getUsername");
    realm.setSaltSource(saltSource);

    realm.onApplicationEvent(new ContextRefreshedEvent(testApplicationContext));
  }
View Full Code Here

    public boolean has(String name) {
        return applicationContext.containsBean(name);
    }

    public void reset() {
        applicationContext.publishEvent(new ContextRefreshedEvent(applicationContext));
    }
View Full Code Here

    // Propagate refresh to lifecycle processor first.
    getLifecycleProcessor().onRefresh();

    // Publish the final event.
    publishEvent(new ContextRefreshedEvent(this));

    // Participate in LiveBeansView MBean, if active.
    LiveBeansView.registerApplicationContext(this);
  }
View Full Code Here

    // Propagate refresh to lifecycle processor first.
    getLifecycleProcessor().onRefresh();

    // Publish the final event.
    publishEvent(new ContextRefreshedEvent(this));
  }
View Full Code Here

    // Propagate refresh to lifecycle processor first.
    getLifecycleProcessor().onRefresh();

    // Publish the final event.
    publishEvent(new ContextRefreshedEvent(this));
  }
View Full Code Here

  /**
   * Finish the refresh of this context, publishing the
   * {@link org.springframework.context.event.ContextRefreshedEvent}.
   */
  protected void finishRefresh() {
    publishEvent(new ContextRefreshedEvent(this));
  }
View Full Code Here

  private Application createWrappedApplication() {
    this.applicationContext.registerSingleton(VALIDATOR_SUPPORT_BEAN, SpringFacesValidatorSupport.class);
    this.validatorSupport = this.applicationContext.getBean(SpringFacesValidatorSupport.class);
    this.validatorSupport.setApplicationContext(this.applicationContext);
    this.validatorSupport.onApplicationEvent(new ContextRefreshedEvent(this.applicationContext));
    return this.validatorSupport.newWrapper(Application.class, this.delegateApplication);
  }
View Full Code Here

    beans.put("handler3", this.handler3);
    beans.put("handler2", this.handler2);
    beans.put("handler1", this.handler1);
    given(applicationContext.getBeansOfType(ExceptionHandler.class, true, true)).willReturn(beans);
    support.setApplicationContext(applicationContext);
    support.onApplicationEvent(new ContextRefreshedEvent(applicationContext));
    this.exceptionHandler = (SpringFacesExceptionHandler) support.newWrapper(ExceptionHandler.class, this.wrapped);
  }
View Full Code Here

  }

  @Test
  public void shouldDelegateRefresh() throws Exception {
    ApplicationContext context = mock(ApplicationContext.class);
    ContextRefreshedEvent event = new ContextRefreshedEvent(context);
    this.dispatcher.onApplicationEvent(event);
    verify(this.delegate).onRefresh(context);
  }
View Full Code Here

TOP

Related Classes of org.springframework.context.event.ContextRefreshedEvent

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.