Package org.impalaframework.module.spi

Examples of org.impalaframework.module.spi.ModuleStateChangeListener


    ModuleStateHolder moduleStateHolder = facade.getModuleStateHolder();
   
    if (!initialized) {
     
      ModuleStateChangeNotifier moduleStateChangeNotifier = facade.getModuleStateChangeNotifier();
      moduleStateChangeNotifier.addListener(new ModuleStateChangeListener() {

        public void moduleStateChanged(ModuleStateHolder moduleStateHolder, ModuleStateChange change) {
          try {
            servlet.init();
          }
View Full Code Here


        ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
   
    if (!initialized) {
     
      ModuleStateChangeNotifier moduleStateChangeNotifier = facade.getModuleStateChangeNotifier();
      ModuleStateChangeListener listener = newModuleStateChangeListener(servletName);
            moduleStateChangeNotifier.addListener(listener);
      this.initialized = true;
    }
   
    ApplicationContext context = SpringModuleUtils.getModuleSpringContext(moduleStateHolder, servletName);
View Full Code Here

    }
  }

    ModuleStateChangeListener newModuleStateChangeListener(final String servletName) {
       
        ModuleStateChangeListener listener = new ModuleStateChangeListener() {

          public void moduleStateChanged(ModuleStateHolder moduleStateHolder, TransitionResult result) {
             
            if (!result.isInError()) {
                try {
View Full Code Here

        servletContext = EasyMock.createMock(ServletContext.class);
    }

    public void testNewStateChangeListenerOK() throws Exception {
       
        ModuleStateChangeListener listener = creator.newModuleStateChangeListener("myServlet");

        replayMocks();
       
        ModuleStateChange moduleStateChange = new ModuleStateChange(Transition.UNLOADED_TO_LOADED, new SimpleModuleDefinition("myModule"));
        TransitionResult transitionResult = new TransitionResult(moduleStateChange);
       
        try {
            listener.moduleStateChanged(createMock(ModuleStateHolder.class),transitionResult);
            fail();
        }
        catch (ExecutionException e) {
        }
       
View Full Code Here

        verifyMocks();
    }
   
    public void testNewStateChangeListenerException() throws Exception {
       
        ModuleStateChangeListener listener = creator.newModuleStateChangeListener("myServlet");

        replayMocks();
       
        ModuleStateChange moduleStateChange = new ModuleStateChange(Transition.UNLOADED_TO_LOADED, new SimpleModuleDefinition("myModule"));
        TransitionResult transitionResult = new TransitionResult(moduleStateChange, new RuntimeException());
       
        listener.moduleStateChanged(createMock(ModuleStateHolder.class),transitionResult);
       
        verifyMocks();
    }
View Full Code Here

        ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
   
    if (!initialized) {
     
      ModuleStateChangeNotifier moduleStateChangeNotifier = facade.getModuleStateChangeNotifier();
      ModuleStateChangeListener listener = newModuleStateChangeListener(servletName);
            moduleStateChangeNotifier.addListener(listener);
      this.initialized = true;
    }
   
    ApplicationContext context = SpringModuleUtils.getModuleSpringContext(moduleStateHolder, servletName);
View Full Code Here

    }
  }

    ModuleStateChangeListener newModuleStateChangeListener(final String servletName) {
       
        ModuleStateChangeListener listener = new ModuleStateChangeListener() {

          public void moduleStateChanged(ModuleStateHolder moduleStateHolder, TransitionResult result) {
             
            if (!result.isInError()) {
                try {
View Full Code Here

    public final void testNotify1() {
        notifier = new DefaultModuleStateChangeNotifier();
        assertNotNull(notifier.getListeners());
        assertEquals(0, notifier.getListeners().size());

        ModuleStateChangeListener listener1 = createMock(ModuleStateChangeListener.class);
        notifier.addListener(listener1);
        assertEquals(1, notifier.getListeners().size());
       
        assertTrue(notifier.removeListener(listener1));
        assertEquals(0, notifier.getListeners().size());
View Full Code Here

        ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
   
    if (!initialized) {
     
      ModuleStateChangeNotifier moduleStateChangeNotifier = facade.getModuleStateChangeNotifier();
      ModuleStateChangeListener listener = newModuleStateChangeListener(servletName);
            moduleStateChangeNotifier.addListener(listener);
      this.initialized = true;
    }
   
    ApplicationContext context = SpringModuleUtils.getModuleSpringContext(moduleStateHolder, servletName);
View Full Code Here

    }
  }

    ModuleStateChangeListener newModuleStateChangeListener(final String servletName) {
       
        ModuleStateChangeListener listener = new ModuleStateChangeListener() {

          public void moduleStateChanged(ModuleStateHolder moduleStateHolder, TransitionResult result) {
             
            if (!result.isInError()) {
                try {
View Full Code Here

TOP

Related Classes of org.impalaframework.module.spi.ModuleStateChangeListener

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.