Examples of ClusterManager


Examples of org.neo4j.kernel.ha.zookeeper.ClusterManager

        return toReturn;
    }

    private static String getMasterServerInCluster( String from )
    {
        ClusterManager clusterManager = new ClusterManager( from );
        Pair<String, Integer> masterServer = null;
        try
        {
            clusterManager.waitForSyncConnected();
            Machine master = clusterManager.getMaster();
            masterServer = master.getServer();
            if ( masterServer != null )
            {
                int backupPort = clusterManager.getBackupPort( master.getMachineId() );
                return String.format( ServerAddressFormat,
                        masterServer.first(), backupPort );
            }
            throw new ComException(
                    "Master couldn't be found from cluster managed by " + from );
        }
        finally
        {
            clusterManager.shutdown();
        }
    }
View Full Code Here

Examples of org.vertx.java.core.spi.cluster.ClusterManager

   * @param vertx The current Vert.x instance.
   * @return The Vert.x Hazelcast instance if Vert.x is clustered.
   */
  static HazelcastInstance getHazelcastInstance(Vertx vertx) {
    VertxInternal vertxInternal = (VertxInternal) vertx;
    ClusterManager clusterManager = vertxInternal.clusterManager();
    if (clusterManager != null) {
      Class<?> clazz = clusterManager.getClass();
      Field field;
      try {
        field = clazz.getDeclaredField("hazelcast");
        field.setAccessible(true);
        return HazelcastInstance.class.cast(field.get(clusterManager));
View Full Code Here

Examples of org.xmlBlaster.engine.cluster.ClusterManager

    * See useCluster() to check if clustering is switched on
    * First checks if ClusterManager is loaded already and if its state is ready.
    * @return
    */
   public final boolean isClusterManagerReady() {
      ClusterManager cm = this.clusterManager;
      return (cm != null && cm.isReady());
   }
View Full Code Here

Examples of org.xmlBlaster.engine.cluster.ClusterManager

      if (this.clusterManager == null) {
         if (!useCluster())
            return null;
         synchronized(this) {
            if (this.clusterManager == null) {
               this.clusterManager = new ClusterManager(this, sessionInfo);
               this.ME = "Global" + getLogPrefixDashed();
            }
         }
      }
      return this.clusterManager;
View Full Code Here

Examples of org.xmlBlaster.engine.cluster.ClusterManager

   public void tearDown() {
      serverScope.shutdown();
   }

   public void testParseConnectQos() {
      ClusterManager m = new ClusterManager(serverScope, null);

      try {
         m.init(serverScope, null);
         String xml =
            "<clusternode id='avalon'>"
          + "<connect><qos>"
          + "<address type='SOCKET'>"
          + "   socket://:7501"
View Full Code Here

Examples of org.xmlBlaster.engine.cluster.ClusterManager

         fail(e.toString());
      }
   }

   public void testParseConnectQosAttribute() {
      ClusterManager m = new ClusterManager(serverScope, null);

      try {
         m.init(serverScope, null);

         String xml =
              "<clusternode id='avalon'>" + "<connect><qos>"
            + "<address type='SOCKET'>"
            + "   socket://:7501"
View Full Code Here

Examples of org.xmlBlaster.engine.cluster.ClusterManager

         fail(e.toString());
      }
   }

   public void testParse() {
      ClusterManager m = new ClusterManager(serverScope, null);

      try {
         m.init(serverScope, null);

         String xml =
            "<clusternode id='heron.mycomp.com'> <!-- original xml markup -->\n" +
            "   <connect><qos>\n" +
            "     <address type='IOR'>IOR:09456087000</address>\n" +
View Full Code Here

Examples of org.xmlBlaster.engine.cluster.ClusterManager

         fail(e.toString());
      }
   }
  
   public void testParseState() {
      ClusterManager m = new ClusterManager(serverScope, null);

      try {
         m.init(serverScope, null);
 
         String xml =
         "<clusternode id='heron.mycomp.com'>\n" +
         "   <master stratum='1' refid='frodo' type='DomainPlugin' version='2.0' acceptDefault='false' acceptOtherDefault='true'>\n" +
         "     My own rule\n" +
View Full Code Here

Examples of org.xmlBlaster.engine.cluster.ClusterManager

               if (this.runlevelSet == null) this.runlevelSet = new TreeSet();
               this.runlevelSet.add(event);
            }
            else if (isConnectionStateEvent(event)) {
               // client/[subjectId]/session/[publicSessionId]/event/connectionState
               ClusterManager clusterManager = requestBroker.getServerScope().getClusterManager();
               if (clusterManager == null) {
                  log.warning("Configuration of '" + event + "' is ignored, no cluster manager available");
                  continue;
               }
               if (!clusterManager.isReady()) {
                  log.warning("Configuration of '" + event + "' is ignored, cluster manager is not ready");
                  continue;
               }
               int index = event.lastIndexOf("/event/");
               if (index == -1) {
                  log.warning("Configuration of '" + event + "' is ignored, wrong syntax");
                  continue;
               }
               // strip "event/connectionState"
               String name = event.substring(0, index);
               ClusterNode[] nodes = clusterManager.getClusterNodes();
               for (int ic=0; ic<nodes.length; ic++) {
                  ClusterNode node = nodes[ic];
                  SessionName destination = node.getSessionName();
                  if (destination != null && destination.matchRelativeName(name)) {
                     node.registerConnectionListener(this);
View Full Code Here

Examples of org.xmlBlaster.engine.cluster.ClusterManager

            buf.append("\n   ").append("</session>");
         }
         buf.append("\n  ").append("</client>");
      }

      ClusterManager clusterManager = g.getClusterManagerNoEx();
      if (clusterManager != null && clusterManager.isReady()) {
         ClusterNode[] nodes = clusterManager.getClusterNodes();
         for (int ic = 0; ic < nodes.length; ic++) {
            ClusterNode node = nodes[ic];
            SessionName destination = node.getRemoteSessionName();
            if (destination == null)
               continue;
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.