Package org.hornetq.api.core.management

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


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

   public void testNodes() throws Exception
   {
      ClusterConnectionControl clusterConnectionControl_0 = createManagementControl(clusterConnectionConfig_0.getName());
      Assert.assertTrue(clusterConnectionControl_0.isStarted());
      Map<String, String> nodes = clusterConnectionControl_0.getNodes();
      Assert.assertEquals(0, nodes.size());

      server_1.start();
      long start = System.currentTimeMillis();

      while (true)
      {
         nodes = clusterConnectionControl_0.getNodes();

         if (nodes.size() != 1 && System.currentTimeMillis() - start < 30000)
         {
            Thread.sleep(500);
         }
View Full Code Here


   public synchronized void registerCluster(final ClusterConnection cluster,
                                            final ClusterConnectionConfiguration configuration) throws Exception
   {
      ObjectName objectName = objectNameBuilder.getClusterConnectionObjectName(configuration.getName());
      ClusterConnectionControl control = new ClusterConnectionControlImpl(cluster, storageManager, configuration);
      registerInJMX(objectName, new StandardMBean(control, ClusterConnectionControl.class));
      registerInRegistry(ResourceNames.CORE_CLUSTER_CONNECTION + configuration.getName(), control);
   }
View Full Code Here

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

   public void testNodes() throws Exception
   {
      ClusterConnectionControl clusterConnectionControl_0 = createManagementControl(clusterConnectionConfig_0.getName());
      Assert.assertTrue(clusterConnectionControl_0.isStarted());
      Map<String, String> nodes = clusterConnectionControl_0.getNodes();
      Assert.assertEquals(0, nodes.size());

      server_1.start();
      long start = System.currentTimeMillis();

      while (true)
      {
         nodes = clusterConnectionControl_0.getNodes();

         if (nodes.size() != 1 && System.currentTimeMillis() - start < 30000)
         {
            Thread.sleep(500);
         }
View Full Code Here

   {
      ClientSessionFactory sf = locator.createSessionFactory();
      session = sf.createSession(false, true, true);
      session.start();

      return new ClusterConnectionControl()
      {
         private final CoreMessagingProxy proxy = new CoreMessagingProxy(session,
                                                                         ResourceNames.CORE_CLUSTER_CONNECTION + name);

         public Object[] getStaticConnectors()
View Full Code Here

   public synchronized void registerCluster(final ClusterConnection cluster,
                                            final ClusterConnectionConfiguration configuration) throws Exception
   {
      ObjectName objectName = objectNameBuilder.getClusterConnectionObjectName(configuration.getName());
      ClusterConnectionControl control = new ClusterConnectionControlImpl(cluster, storageManager, configuration);
      registerInJMX(objectName, new StandardMBean(control, ClusterConnectionControl.class));
      registerInRegistry(ResourceNames.CORE_CLUSTER_CONNECTION + configuration.getName(), control);
   }
View Full Code Here

   public synchronized void registerCluster(final ClusterConnection cluster,
                                            final ClusterConnectionConfiguration configuration) throws Exception
   {
      ObjectName objectName = objectNameBuilder.getClusterConnectionObjectName(configuration.getName());
      ClusterConnectionControl control = new ClusterConnectionControlImpl(cluster, storageManager, configuration);
      registerInJMX(objectName, new StandardMBean(control, ClusterConnectionControl.class));
      registerInRegistry(ResourceNames.CORE_CLUSTER_CONNECTION + configuration.getName(), control);
   }
View Full Code Here

   public synchronized void registerCluster(final ClusterConnection cluster,
                                            final ClusterConnectionConfiguration configuration) throws Exception
   {
      ObjectName objectName = objectNameBuilder.getClusterConnectionObjectName(configuration.getName());
      ClusterConnectionControl control = new ClusterConnectionControlImpl(cluster, storageManager, configuration);
      registerInJMX(objectName, new StandardMBean(control, ClusterConnectionControl.class));
      registerInRegistry(ResourceNames.CORE_CLUSTER_CONNECTION + configuration.getName(), control);
   }
View Full Code Here

    }

    @Override
    protected void handleReadAttribute(String attributeName, OperationContext context, ModelNode operation) throws OperationFailedException {
        if (NODE_ID.equals(attributeName)) {
            ClusterConnectionControl control = getHornetQComponentControl(context, operation, false);
            context.getResult().set(control.getNodeID());
        } else {
            unsupportedAttribute(attributeName);
        }
    }
View Full Code Here

    }

    @Override
    protected Object handleOperation(String operationName, OperationContext context, ModelNode operation) throws OperationFailedException {
        if (GET_STATIC_CONNECTORS_AS_JSON.equals(operationName)) {
            ClusterConnectionControl control = getHornetQComponentControl(context, operation, false);
            try {
                context.getResult().set(control.getStaticConnectorsAsJSON());
            } catch (Exception e) {
                context.getFailureDescription().set(e.getLocalizedMessage());
            }
        } else if (GET_NODES.equals(operationName)) {
            ClusterConnectionControl control = getHornetQComponentControl(context, operation, false);
            try {
                Map<String, String> nodes = control.getNodes();
                final ModelNode result = context.getResult();
                result.setEmptyObject();
                for (Map.Entry<String, String> entry : nodes.entrySet()) {
                    result.get(entry.getKey()).set(entry.getValue());
                }
View Full Code Here

   public synchronized void registerCluster(final ClusterConnection cluster,
                                            final ClusterConnectionConfiguration configuration) throws Exception
   {
      ObjectName objectName = objectNameBuilder.getClusterConnectionObjectName(configuration.getName());
      ClusterConnectionControl control = new ClusterConnectionControlImpl(cluster, storageManager, configuration);
      registerInJMX(objectName, new StandardMBean(control, ClusterConnectionControl.class));
      registerInRegistry(ResourceNames.CORE_CLUSTER_CONNECTION + configuration.getName(), control);
   }
View Full Code Here

TOP

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

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.