Package org.infinispan.distexec

Examples of org.infinispan.distexec.DistributedExecutionCompletionService


            Address ourAddress = manager.getAddress();

            List<Address> members = manager.getMembers();
            // If we are the only member don't even worry about sending listeners
            if (members != null && members.size() > 1) {
               DistributedExecutionCompletionService decs = new DistributedExecutionCompletionService(distExecutorService);

               if (log.isTraceEnabled()) {
                  log.tracef("Replicating cluster listener to other nodes %s for cluster listener with id %s",
                             members, generatedId);
               }
               Callable callable = new ClusterListenerReplicateCallable(generatedId, ourAddress, filter, converter);
               for (Address member : members) {
                  if (!member.equals(ourAddress)) {
                     decs.submit(member, callable);
                  }
               }

               for (int i = 0; i < members.size() - 1; ++i) {
                  try {
                     decs.take().get();
                  } catch (InterruptedException e) {
                     throw new CacheListenerException(e);
                  } catch (ExecutionException e) {
                     throw new CacheListenerException(e);
                  }
               }

               int extraCount = 0;
               // If anyone else joined since we sent these we have to send the listeners again, since they may have queried
               // before the other nodes got the new listener
               List<Address> membersAfter = manager.getMembers();
               for (Address member : membersAfter) {
                  if (!members.contains(member) && !member.equals(ourAddress)) {
                     if (log.isTraceEnabled()) {
                        log.tracef("Found additional node %s that joined during replication of cluster listener with id %s",
                                   member, generatedId);
                     }
                     extraCount++;
                     decs.submit(member, callable);
                  }
               }

               for (int i = 0; i < extraCount; ++i) {
                  try {
                     decs.take().get();
                  } catch (InterruptedException e) {
                     throw new CacheListenerException(e);
                  } catch (ExecutionException e) {
                     throw new CacheListenerException(e);
                  }
View Full Code Here


         Address ourAddress = manager.getAddress();

         List<Address> members = manager.getMembers();
         // If we are the only member don't even worry about sending listeners
         if (members.size() > 1) {
            DistributedExecutionCompletionService decs = new DistributedExecutionCompletionService(distExecutorService);

            log.tracef("Replicating cluster listener to other nodes %s for cluster listener with id %s",
                       members, generatedId);
            Callable callable = new ClusterListenerReplicateCallable(generatedId, ourAddress, filter, converter);
            for (Address member : members) {
               if (!member.equals(ourAddress)) {
                  decs.submit(member, callable);
               }
            }

            for (int i = 0; i < members.size() - 1; ++i) {
               try {
                  decs.take().get();
               } catch (InterruptedException e) {
                  throw new CacheListenerException(e);
               } catch (ExecutionException e) {
                  throw new CacheListenerException(e);
               }
            }

            int extraCount = 0;
            // If anyone else joined since we sent these we have to send the listeners again, since they may have queried
            // before the other nodes got the new listener
            List<Address> membersAfter = manager.getMembers();
            for (Address member : membersAfter) {
               if (!members.contains(member) && !member.equals(ourAddress)) {
                  log.tracef("Found additional node %s that joined during replication of cluster listener with id %s",
                             member, generatedId);
                  extraCount++;
                  decs.submit(member, callable);
               }
            }

            for (int i = 0; i < extraCount; ++i) {
               try {
                  decs.take().get();
               } catch (InterruptedException e) {
                  throw new CacheListenerException(e);
               } catch (ExecutionException e) {
                  throw new CacheListenerException(e);
               }
View Full Code Here

         Address ourAddress = manager.getAddress();

         List<Address> members = manager.getMembers();
         // If we are the only member don't even worry about sending listeners
         if (members.size() > 1) {
            DistributedExecutionCompletionService decs = new DistributedExecutionCompletionService(distExecutorService);

            log.tracef("Replicating cluster listener to other nodes %s for cluster listener with id %s",
                       members, generatedId);
            Callable callable = new ClusterListenerReplicateCallable(generatedId, ourAddress, filter, converter);
            for (Address member : members) {
               if (!member.equals(ourAddress)) {
                  decs.submit(member, callable);
               }
            }

            for (int i = 0; i < members.size() - 1; ++i) {
               try {
                  decs.take().get();
               } catch (InterruptedException e) {
                  throw new CacheListenerException(e);
               } catch (ExecutionException e) {
                  throw new CacheListenerException(e);
               }
            }

            int extraCount = 0;
            // If anyone else joined since we sent these we have to send the listeners again, since they may have queried
            // before the other nodes got the new listener
            List<Address> membersAfter = manager.getMembers();
            for (Address member : membersAfter) {
               if (!members.contains(member) && !member.equals(ourAddress)) {
                  log.tracef("Found additional node %s that joined during replication of cluster listener with id %s",
                             member, generatedId);
                  extraCount++;
                  decs.submit(member, callable);
               }
            }

            for (int i = 0; i < extraCount; ++i) {
               try {
                  decs.take().get();
               } catch (InterruptedException e) {
                  throw new CacheListenerException(e);
               } catch (ExecutionException e) {
                  throw new CacheListenerException(e);
               }
View Full Code Here

         Address ourAddress = manager.getAddress();

         List<Address> members = manager.getMembers();
         // If we are the only member don't even worry about sending listeners
         if (members != null && members.size() > 1) {
            DistributedExecutionCompletionService decs = new DistributedExecutionCompletionService(distExecutorService);

            if (log.isTraceEnabled()) {
               log.tracef("Replicating cluster listener to other nodes %s for cluster listener with id %s",
                          members, generatedId);
            }
            Callable callable = new ClusterListenerReplicateCallable(generatedId, ourAddress, filter, converter);
            for (Address member : members) {
               if (!member.equals(ourAddress)) {
                  decs.submit(member, callable);
               }
            }

            for (int i = 0; i < members.size() - 1; ++i) {
               try {
                  decs.take().get();
               } catch (InterruptedException e) {
                  throw new CacheListenerException(e);
               } catch (ExecutionException e) {
                  throw new CacheListenerException(e);
               }
            }

            int extraCount = 0;
            // If anyone else joined since we sent these we have to send the listeners again, since they may have queried
            // before the other nodes got the new listener
            List<Address> membersAfter = manager.getMembers();
            for (Address member : membersAfter) {
               if (!members.contains(member) && !member.equals(ourAddress)) {
                  if (log.isTraceEnabled()) {
                     log.tracef("Found additional node %s that joined during replication of cluster listener with id %s",
                                member, generatedId);
                  }
                  extraCount++;
                  decs.submit(member, callable);
               }
            }

            for (int i = 0; i < extraCount; ++i) {
               try {
                  decs.take().get();
               } catch (InterruptedException e) {
                  throw new CacheListenerException(e);
               } catch (ExecutionException e) {
                  throw new CacheListenerException(e);
               }
View Full Code Here

         Address ourAddress = manager.getAddress();

         List<Address> members = manager.getMembers();
         // If we are the only member don't even worry about sending listeners
         if (members != null && members.size() > 1) {
            DistributedExecutionCompletionService decs = new DistributedExecutionCompletionService(distExecutorService);

            log.tracef("Replicating cluster listener to other nodes %s for cluster listener with id %s",
                       members, generatedId);
            Callable callable = new ClusterListenerReplicateCallable(generatedId, ourAddress, filter, converter);
            for (Address member : members) {
               if (!member.equals(ourAddress)) {
                  decs.submit(member, callable);
               }
            }

            for (int i = 0; i < members.size() - 1; ++i) {
               try {
                  decs.take().get();
               } catch (InterruptedException e) {
                  throw new CacheListenerException(e);
               } catch (ExecutionException e) {
                  throw new CacheListenerException(e);
               }
            }

            int extraCount = 0;
            // If anyone else joined since we sent these we have to send the listeners again, since they may have queried
            // before the other nodes got the new listener
            List<Address> membersAfter = manager.getMembers();
            for (Address member : membersAfter) {
               if (!members.contains(member) && !member.equals(ourAddress)) {
                  log.tracef("Found additional node %s that joined during replication of cluster listener with id %s",
                             member, generatedId);
                  extraCount++;
                  decs.submit(member, callable);
               }
            }

            for (int i = 0; i < extraCount; ++i) {
               try {
                  decs.take().get();
               } catch (InterruptedException e) {
                  throw new CacheListenerException(e);
               } catch (ExecutionException e) {
                  throw new CacheListenerException(e);
               }
View Full Code Here

            Address ourAddress = manager.getAddress();

            List<Address> members = manager.getMembers();
            // If we are the only member don't even worry about sending listeners
            if (members != null && members.size() > 1) {
               DistributedExecutionCompletionService decs = new DistributedExecutionCompletionService(distExecutorService);

               if (log.isTraceEnabled()) {
                  log.tracef("Replicating cluster listener to other nodes %s for cluster listener with id %s",
                             members, generatedId);
               }
               Callable callable = new ClusterListenerReplicateCallable(generatedId, ourAddress, filter, converter);
               for (Address member : members) {
                  if (!member.equals(ourAddress)) {
                     decs.submit(member, callable);
                  }
               }

               for (int i = 0; i < members.size() - 1; ++i) {
                  try {
                     decs.take().get();
                  } catch (InterruptedException e) {
                     throw new CacheListenerException(e);
                  } catch (ExecutionException e) {
                     throw new CacheListenerException(e);
                  }
               }

               int extraCount = 0;
               // If anyone else joined since we sent these we have to send the listeners again, since they may have queried
               // before the other nodes got the new listener
               List<Address> membersAfter = manager.getMembers();
               for (Address member : membersAfter) {
                  if (!members.contains(member) && !member.equals(ourAddress)) {
                     if (log.isTraceEnabled()) {
                        log.tracef("Found additional node %s that joined during replication of cluster listener with id %s",
                                   member, generatedId);
                     }
                     extraCount++;
                     decs.submit(member, callable);
                  }
               }

               for (int i = 0; i < extraCount; ++i) {
                  try {
                     decs.take().get();
                  } catch (InterruptedException e) {
                     throw new CacheListenerException(e);
                  } catch (ExecutionException e) {
                     throw new CacheListenerException(e);
                  }
View Full Code Here

         Address ourAddress = manager.getAddress();

         List<Address> members = manager.getMembers();
         // If we are the only member don't even worry about sending listeners
         if (members != null && members.size() > 1) {
            DistributedExecutionCompletionService decs = new DistributedExecutionCompletionService(distExecutorService);

            if (log.isTraceEnabled()) {
               log.tracef("Replicating cluster listener to other nodes %s for cluster listener with id %s",
                          members, generatedId);
            }
            Callable callable = new ClusterListenerReplicateCallable(generatedId, ourAddress, filter, converter);
            for (Address member : members) {
               if (!member.equals(ourAddress)) {
                  decs.submit(member, callable);
               }
            }

            for (int i = 0; i < members.size() - 1; ++i) {
               try {
                  decs.take().get();
               } catch (InterruptedException e) {
                  throw new CacheListenerException(e);
               } catch (ExecutionException e) {
                  throw new CacheListenerException(e);
               }
            }

            int extraCount = 0;
            // If anyone else joined since we sent these we have to send the listeners again, since they may have queried
            // before the other nodes got the new listener
            List<Address> membersAfter = manager.getMembers();
            for (Address member : membersAfter) {
               if (!members.contains(member) && !member.equals(ourAddress)) {
                  if (log.isTraceEnabled()) {
                     log.tracef("Found additional node %s that joined during replication of cluster listener with id %s",
                                member, generatedId);
                  }
                  extraCount++;
                  decs.submit(member, callable);
               }
            }

            for (int i = 0; i < extraCount; ++i) {
               try {
                  decs.take().get();
               } catch (InterruptedException e) {
                  throw new CacheListenerException(e);
               } catch (ExecutionException e) {
                  throw new CacheListenerException(e);
               }
View Full Code Here

TOP

Related Classes of org.infinispan.distexec.DistributedExecutionCompletionService

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.