Package org.infinispan.remoting.transport.jgroups

Examples of org.infinispan.remoting.transport.jgroups.JGroupsAddress


      String cacheName = EmbeddedCacheManager.DEFAULT_CACHE_NAME;
      ImmortalCacheEntry entry1 = (ImmortalCacheEntry) TestInternalCacheEntryFactory.create("key", "value", System.currentTimeMillis() - 1000, -1, System.currentTimeMillis(), -1);
      Collection<InternalCacheEntry> state = new ArrayList<InternalCacheEntry>();
      state.add(entry1);
      Address a1 = new JGroupsAddress(UUID.randomUUID());
      Address a2 = new JGroupsAddress(UUID.randomUUID());
      Address a3 = new JGroupsAddress(UUID.randomUUID());
      List<Address> oldAddresses = new ArrayList<Address>();
      oldAddresses.add(a1);
      oldAddresses.add(a2);
      DefaultConsistentHashFactory chf = new DefaultConsistentHashFactory();
      DefaultConsistentHash oldCh = chf.create(new MurmurHash3(), 2, 3, oldAddresses);
View Full Code Here


      gtx.setAddress((Address) address);
      return gtx;
   }

   private JGroupsAddress unmarshallJGroupsAddress(ObjectInput in) throws IOException, ClassNotFoundException {
      JGroupsAddress address = new JGroupsAddress();
      address.readExternal(in);
      return address;
   }
View Full Code Here

    * The serialVersionUID
    */
   private static final long serialVersionUID = 2400716389425727329L;

   public void writeExternal(Object subject, ObjectOutput output) throws IOException {
      JGroupsAddress address = (JGroupsAddress) subject;
      address.writeExternal(output);
   }
View Full Code Here

      address.writeExternal(output);
   }

   public Object createExternal(Class<?> subjectType, ObjectInput input, Creator defaultCreator)
         throws IOException, ClassNotFoundException {
      return new JGroupsAddress();
   }
View Full Code Here

      return new JGroupsAddress();
   }

   public void readExternal(Object subject, ObjectInput input) throws IOException,
                                                                      ClassNotFoundException {
      JGroupsAddress address = (JGroupsAddress) subject;
      address.readExternal(input);
   }
View Full Code Here

    }

    private static org.jgroups.Address toJGroupsAddress(Address address) {
        if (address == null) return null;
        if (address instanceof JGroupsAddress) {
            JGroupsAddress jgroupsAddress = (JGroupsAddress) address;
            return jgroupsAddress.getJGroupsAddress();
        }
        throw new IllegalArgumentException(address.toString());
    }
View Full Code Here

   public void tearDown() {
      cm.stop();
   }

   public void testJGroupsAddressMarshalling() throws Exception {
      JGroupsAddress address = new JGroupsAddress(new IpAddress(12345));
      marshallAndAssertEquality(address);
   }
View Full Code Here

      JGroupsAddress address = new JGroupsAddress(new IpAddress(12345));
      marshallAndAssertEquality(address);
   }

   public void testGlobalTransactionMarshalling() throws Exception {
      JGroupsAddress jGroupsAddress = new JGroupsAddress(new IpAddress(12345));
      GlobalTransaction gtx = gtf.newGlobalTransaction(jGroupsAddress, false);
      marshallAndAssertEquality(gtx);
   }
View Full Code Here

   public void testListMarshalling() throws Exception {
      List<GlobalTransaction> l1 = new ArrayList<GlobalTransaction>();
      List<GlobalTransaction> l2 = new LinkedList<GlobalTransaction>();
      for (int i = 0; i < 10; i++) {
         JGroupsAddress jGroupsAddress = new JGroupsAddress(new IpAddress(1000 * i));
         GlobalTransaction gtx = gtf.newGlobalTransaction(jGroupsAddress, false);
         l1.add(gtx);
         l2.add(gtx);
      }
      marshallAndAssertEquality(l1);
View Full Code Here

      Map<Integer, GlobalTransaction> m1 = new HashMap<Integer, GlobalTransaction>();
      Map<Integer, GlobalTransaction> m2 = new TreeMap<Integer, GlobalTransaction>();
      Map<Integer, GlobalTransaction> m3 = new HashMap<Integer, GlobalTransaction>();
      Map<Integer, GlobalTransaction> m4 = new FastCopyHashMap<Integer, GlobalTransaction>();
      for (int i = 0; i < 10; i++) {
         JGroupsAddress jGroupsAddress = new JGroupsAddress(new IpAddress(1000 * i));
         GlobalTransaction gtx = gtf.newGlobalTransaction(jGroupsAddress, false);
         m1.put(1000 * i, gtx);
         m2.put(1000 * i, gtx);
         m4.put(1000 * i, gtx);
      }
View Full Code Here

TOP

Related Classes of org.infinispan.remoting.transport.jgroups.JGroupsAddress

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.