Package org.hornetq.api.core.management

Examples of org.hornetq.api.core.management.BridgeControl


      checkResource(ObjectNameBuilder.DEFAULT.getBridgeObjectName(name));
      String[] bridgeNames = serverControl.getBridgeNames();
      assertEquals(1, bridgeNames.length);
      assertEquals(name, bridgeNames[0]);

      BridgeControl bridgeControl = ManagementControlHelper.createBridgeControl(name, mbeanServer);
      assertEquals(name, bridgeControl.getName());
      assertTrue(bridgeControl.isStarted());

      // check that a message sent to the sourceAddress is put in the tagetQueue
      ClientProducer producer = session.createProducer(sourceAddress);
      ClientMessage message = session.createMessage(false);
      String text = RandomUtil.randomString();
View Full Code Here


      {
         Object[] bridges = server.getManagementService().getResources(BridgeControl.class);
         String[] names = new String[bridges.length];
         for (int i = 0; i < bridges.length; i++)
         {
            BridgeControl bridge = (BridgeControl)bridges[i];
            names[i] = bridge.getName();
         }

         return names;
      }
      finally
View Full Code Here

   }

   public void testStartStop() throws Exception
   {
      checkResource(ObjectNameBuilder.DEFAULT.getBridgeObjectName(bridgeConfig.getName()));
      BridgeControl bridgeControl = createBridgeControl(bridgeConfig.getName(), mbeanServer);

      // started by the server
      Assert.assertTrue(bridgeControl.isStarted());

      bridgeControl.stop();
      Assert.assertFalse(bridgeControl.isStarted());

      bridgeControl.start();
      Assert.assertTrue(bridgeControl.isStarted());
   }
View Full Code Here

   }

   public void testNotifications() throws Exception
   {
      SimpleNotificationService.Listener notifListener = new SimpleNotificationService.Listener();
      BridgeControl bridgeControl = createBridgeControl(bridgeConfig.getName(), mbeanServer);

      server_0.getManagementService().addNotificationListener(notifListener);

      Assert.assertEquals(0, notifListener.getNotifications().size());

      bridgeControl.stop();

      Assert.assertEquals(1, notifListener.getNotifications().size());
      Notification notif = notifListener.getNotifications().get(0);
      Assert.assertEquals(NotificationType.BRIDGE_STOPPED, notif.getType());
      Assert.assertEquals(bridgeControl.getName(), notif.getProperties()
                                                        .getSimpleStringProperty(new SimpleString("name"))
                                                        .toString());

      bridgeControl.start();

      Assert.assertEquals(2, notifListener.getNotifications().size());
      notif = notifListener.getNotifications().get(1);
      Assert.assertEquals(NotificationType.BRIDGE_STARTED, notif.getType());
      Assert.assertEquals(bridgeControl.getName(), notif.getProperties()
                                                        .getSimpleStringProperty(new SimpleString("name"))
                                                        .toString());
   }
View Full Code Here

   // Public --------------------------------------------------------

   public void testAttributes() throws Exception
   {
      checkResource(ObjectNameBuilder.DEFAULT.getBridgeObjectName(bridgeConfig.getName()));
      BridgeControl bridgeControl = createBridgeControl(bridgeConfig.getName(), mbeanServer);

      Assert.assertEquals(bridgeConfig.getName(), bridgeControl.getName());
      Assert.assertEquals(bridgeConfig.getDiscoveryGroupName(), bridgeControl.getDiscoveryGroupName());
      Assert.assertEquals(bridgeConfig.getQueueName(), bridgeControl.getQueueName());
      Assert.assertEquals(bridgeConfig.getForwardingAddress(), bridgeControl.getForwardingAddress());
      Assert.assertEquals(bridgeConfig.getFilterString(), bridgeControl.getFilterString());
      Assert.assertEquals(bridgeConfig.getRetryInterval(), bridgeControl.getRetryInterval());
      Assert.assertEquals(bridgeConfig.getRetryIntervalMultiplier(), bridgeControl.getRetryIntervalMultiplier());
      Assert.assertEquals(bridgeConfig.getReconnectAttempts(), bridgeControl.getReconnectAttempts());
      Assert.assertEquals(bridgeConfig.isFailoverOnServerShutdown(), bridgeControl.isFailoverOnServerShutdown());
      Assert.assertEquals(bridgeConfig.isUseDuplicateDetection(), bridgeControl.isUseDuplicateDetection());

      String[] connectorPairData = bridgeControl.getConnectorPair();
      Assert.assertEquals(bridgeConfig.getConnectorPair().a, connectorPairData[0]);
      Assert.assertEquals(bridgeConfig.getConnectorPair().b, connectorPairData[1]);

      Assert.assertTrue(bridgeControl.isStarted());
   }
View Full Code Here

      checkResource(ObjectNameBuilder.DEFAULT.getBridgeObjectName(name));
      String[] bridgeNames = serverControl.getBridgeNames();
      assertEquals(1, bridgeNames.length);
      assertEquals(name, bridgeNames[0]);

      BridgeControl bridgeControl = ManagementControlHelper.createBridgeControl(name, mbeanServer);
      assertEquals(name, bridgeControl.getName());
      assertTrue(bridgeControl.isStarted());

      // check that a message sent to the sourceAddress is put in the tagetQueue
      ClientProducer producer = session.createProducer(sourceAddress);
      ClientMessage message = session.createMessage(false);
      String text = RandomUtil.randomString();
View Full Code Here

   public synchronized void registerBridge(final Bridge bridge, final BridgeConfiguration configuration) throws Exception
   {
      bridge.setNotificationService(this);
      ObjectName objectName = objectNameBuilder.getBridgeObjectName(configuration.getName());
      BridgeControl control = new BridgeControlImpl(bridge, storageManager, configuration);
      registerInJMX(objectName, new StandardMBean(control, BridgeControl.class));
      registerInRegistry(ResourceNames.CORE_BRIDGE + configuration.getName(), control);
   }
View Full Code Here

      {
         Object[] bridges = server.getManagementService().getResources(BridgeControl.class);
         String[] names = new String[bridges.length];
         for (int i = 0; i < bridges.length; i++)
         {
            BridgeControl bridge = (BridgeControl)bridges[i];
            names[i] = bridge.getName();
         }

         return names;
      }
      finally
View Full Code Here

      checkResource(ObjectNameBuilder.DEFAULT.getBridgeObjectName(name));
      String[] bridgeNames = serverControl.getBridgeNames();
      assertEquals(1, bridgeNames.length);
      assertEquals(name, bridgeNames[0]);

      BridgeControl bridgeControl = ManagementControlHelper.createBridgeControl(name, mbeanServer);
      assertEquals(name, bridgeControl.getName());
      assertTrue(bridgeControl.isStarted());

      // check that a message sent to the sourceAddress is put in the tagetQueue
      ClientProducer producer = session.createProducer(sourceAddress);
      ClientMessage message = session.createMessage(false);
      String text = RandomUtil.randomString();
View Full Code Here

   public synchronized void registerBridge(final Bridge bridge, final BridgeConfiguration configuration) throws Exception
   {
      bridge.setNotificationService(this);
      ObjectName objectName = objectNameBuilder.getBridgeObjectName(configuration.getName());
      BridgeControl control = new BridgeControlImpl(bridge, storageManager, configuration);
      registerInJMX(objectName, new StandardMBean(control, BridgeControl.class));
      registerInRegistry(ResourceNames.CORE_BRIDGE + configuration.getName(), control);
   }
View Full Code Here

TOP

Related Classes of org.hornetq.api.core.management.BridgeControl

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.