Package org.mokai.impl.camel

Examples of org.mokai.impl.camel.CamelRoutingEngine.addConnection()


    try {
      Connector connector = mock(Connector.class);

      // create a connector service
      routingEngine.addConnection("test", connector);

      // try to create another connector service with the same id
      routingEngine.addConnection("test", connector);
    } finally {
      routingEngine.shutdown();
View Full Code Here


      // create a connector service
      routingEngine.addConnection("test", connector);

      // try to create another connector service with the same id
      routingEngine.addConnection("test", connector);
    } finally {
      routingEngine.shutdown();
    }
  }
View Full Code Here

    try {
      Processor connection = new MockServiceableConnector().withStartWaitTime(5000);
      Connector application = new MockServiceableConnector().withStartWaitTime(5000);

      routingEngine.addConnection("test", connection);
      routingEngine.addApplication("test", application);

      long startTime = new Date().getTime();
      routingEngine.start();
      long endTime = new Date().getTime();
View Full Code Here

      routingEngine.setMessageStore(messageStore);
      routingEngine.start();

      // create the connection
      MockProcessor processor = new MockProcessor();
      ConnectorService connection = routingEngine.addConnection("1", processor);
      connection.addAcceptor(new MockAcceptor());
      connection.start();

      // create the application
      MockConnector receiver = new MockConnector();
View Full Code Here

      application.addAcceptor(new MockAcceptor());
      application.start();

      // create the connection
      MockConnector receiver = new MockConnector();
      ConnectorService connection = routingEngine.addConnection("1", receiver);
      connection.start();

      // send the message
      receiver.produceMessage(new Message());
View Full Code Here

      routingEngine.setMessageStore(messageStore);
      routingEngine.start();

      // create the processor
      MockProcessor processor = new MockProcessor();
      ConnectorService processorService = routingEngine.addConnection("1", processor);
      processorService.addAcceptor(new Acceptor() {

        @Override
        public boolean accepts(Message message) {
          return false;
View Full Code Here

      routingEngine.setMessageStore(messageStore);
      routingEngine.start();

      // create the processor
      MockProcessor processor = new MockProcessor();
      ConnectorService processorService = routingEngine.addConnection("1", processor);
      processorService.addAcceptor(new Acceptor() {

        @Override
        public boolean accepts(Message message) {
          return false;
View Full Code Here

      Processor applicationProcessor = mock(Processor.class);

      when(connectionProcessor.supports(any(Message.class))).thenReturn(true);
      when(applicationProcessor.supports(any(Message.class))).thenReturn(true);

      ConnectorService connectionService = routingEngine.addConnection("1", connectionProcessor);
      ConnectorService applicationService = routingEngine.addApplication("1", applicationProcessor);

      Acceptor acceptor = new Acceptor() {

        @Override
View Full Code Here

      routingEngine.start();

      Connector connector = mock(Connector.class);

      // create a connector service
      ConnectorService cs1 = routingEngine.addConnection("test1", connector).withPriority(2000);
      cs1.start();

      // check that the connector service was created successfully
      Assert.assertNotNull(cs1);
      Assert.assertEquals(Service.State.STARTED, cs1.getState());
View Full Code Here

      // check that there is only one connector
      List<ConnectorService> connectorServices = routingEngine.getConnections();
      Assert.assertEquals(1, connectorServices.size());

      // create a second and third connector
      ConnectorService cs2 = routingEngine.addConnection("test2", connector).withPriority(0);
      cs2.start();

      ConnectorService cs3 = routingEngine.addConnection("test3", connector).withPriority(1000);
      cs3.start();
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.