Package org.jboss.soa.esb.listeners.lifecycle

Examples of org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController


    public static ManagedLifecycleController startController(ModelAdapter configModel, ConfigTree listenerConfig, ConfigTree gatewayConfig) throws ParamRepositoryException, SAXException, ManagedLifecycleException, ConfigurationException {
        final List<ManagedLifecycle> instances = LifecycleUtil.getListeners(listenerConfig);
        instances.addAll(LifecycleUtil.getGateways(gatewayConfig));

        ManagedLifecycleController lifecycleController = new ManagedLifecycleController(instances);

        try {
            lifecycleController.start();

            // In parallel, create a map of the contract publication info...
            ServicePublisher.addServicePublishers(lifecycleController, configModel.getServicePublishers());
        } catch (final ManagedLifecycleException mle) {
            lifecycleController = null;
View Full Code Here


                  }
                }
            }
            }

             ManagedLifecycleController controller = new ManagedLifecycleController(instances);

             // In parallel, create a map of the contract publication info...
             boolean success = false ;
             try
             {
View Full Code Here

    //     launch listener manager in a child thread
    final ConfigTree newTree = ConfigTree.fromInputStream(new FileInputStream(
        configFile));

                final List<ManagedLifecycle> instances = LifecycleUtil.getListeners(newTree) ;
                final ManagedLifecycleController controller = new ManagedLifecycleController(instances) ;
                controller.start() ;
               
    _logger.debug(" All child listeners ready");

    // JUST FOR THIS TEST:
    // Give your listener some time to process queued messages (see howMany
    // above)
    // Time allowed, and maxThreads in config file will impact how many
    // messages
    // will be processed, and how many will remain unprocessed
   
    for (int count = 0 ; count < howMany ; count++)
    {
      final String response = getMessage(10000) ;
      assertNotNull("getMessage timeout", response) ;
      assertEquals(THE_TEXT, response);
    }

    _logger.debug("going to stop");
    controller.stop();
    _logger.debug("back from stop");
  }
View Full Code Here

        executeTest("jbossesb_config_04.120.xml", "jbossesb_config_05.120.xml");
    }

    private void executeTest(final String resource1, final String resource2) throws ConfigurationException, IOException {
        Generator generator;
        ManagedLifecycleController controller1 = new ManagedLifecycleController(null);
        ManagedLifecycleController controller2 = new ManagedLifecycleController(null);

        assertEquals("Service count", 0, ServicePublisher.getServices().size());
       
        generator = new Generator(getClass().getResourceAsStream(resource1));
        ServicePublisher.addServicePublishers(controller1, generator.getModel().getServicePublishers());
View Full Code Here

    eprElement.setAttribute("driver", getDbDriver());
    eprElement.setAttribute("username", getDbUser());
    eprElement.setAttribute("password", getDbPassword());

                final List<ManagedLifecycle> instances = LifecycleUtil.getListeners(newTree) ;
                final ManagedLifecycleController controller = new ManagedLifecycleController(instances) ;
                controller.start() ;
               
    _logger.debug(" All child listeners ready");

    // JUST FOR THIS TEST:
    // Give your listener some time to process queued messages (see howMany
    // above)
    // Time allowed, and maxThreads in config file will impact how many
    // messages
    // will be processed, and how many will remain unprocessed
   
    for (int count = 0 ; count < howMany ; count++)
    {
      final String response = getMessage(10000) ;
      assertNotNull("getMessage timeout", response) ;
      assertEquals(THE_TEXT, response);
    }

    _logger.debug("going to stop");
    controller.stop();
    _logger.debug("back from stop");
  }
View Full Code Here

      message.getHeader().getCall().setMessageID(uri);
      sender.deliver(message);
    }

                final List<ManagedLifecycle> instances = LifecycleUtil.getListeners(tree) ;
                final ManagedLifecycleController controller = new ManagedLifecycleController(instances) ;
                controller.start() ;
               
    _logger.debug(" All child listeners ready");

    // JUST FOR THIS TEST:
    // Give your listener some time to process queued messages (see howMany
    // above)
    // Time allowed, and maxThreads in config file will impact how many
    // messages
    // will be processed, and how many will remain unprocessed
   
                try
                {
                    for (int count = 0 ; count < howMany ; count++)
                    {
                      final String response = getMessage(20000) ;
                      assertNotNull("getMessage timeout", response) ;
                      assertEquals(THE_TEXT, response);
                    }
                }
                finally
                {
                    _logger.debug("going to stop");
                    controller.stop() ;
                    _logger.debug("back from stop");
                }
  }
View Full Code Here

        configFile));
    final ConfigTree newTreeEPRElement = newTree.getAllChildren()[0].getFirstChild("EPR");
    newTreeEPRElement.setAttribute(ListenerTagNames.URL_TAG, tmpDirForm) ;
               
                final List<ManagedLifecycle> instances = LifecycleUtil.getListeners(newTree) ;
                final ManagedLifecycleController controller = new ManagedLifecycleController(instances) ;
                controller.start() ;
               
    _logger.debug(" All child listeners ready");

    // JUST FOR THIS TEST:
    // Give your listener some time to process queued messages (see howMany
    // above)
    // Time allowed, and maxThreads in config file will impact how many
    // messages
    // will be processed, and how many will remain unprocessed
   
    for (int count = 0 ; count < howMany ; count++)
    {
      final String response = getMessage(10000) ;
      assertNotNull("getMessage timeout", response) ;
      assertEquals(THE_TEXT, response);
    }

    _logger.debug("going to stop");
    controller.stop();
    _logger.debug("back from stop");
  }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController

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.