Package org.jboss.cache.aop.test

Examples of org.jboss.cache.aop.test.IdObject


      p.setName("Ben");
      Address add = new Address();
      add.setCity("Taipei");
      p.setAddress(add);
      List  lang = new ArrayList();
      IdObject id1 = new IdObject("1");
      lang.add(id1);
      p.setLanguages(lang);
      cache_.putObject("/test/ben", p);

      Thread t1 = new Thread()
      {
         Transaction tx;

         public void run()
         {
            UserTransaction tx = null;
            List lang = null;
            IdObject id2 = new IdObject("2");
            IdObject id3 = new IdObject("3");
            try {
               Person ben = (Person)cache_.getObject("/test/ben");
               lang = ben.getLanguages();

               tx = getTransaction();
               tx.begin();
               lang.add(id2);
               lang.add(id3);
               lang.remove(0);
               TestingUtil.sleepThread(1000);
               tx.commit();
            }
            catch(RollbackException rollback) {
               try {
                  tx = getTransaction();
                  tx.begin();
                  lang.add(id2);
                  lang.add(id3);
                  lang.remove(0);
                  tx.commit();
               } catch (Exception ex)
               {
                  t1_ex = ex;
               }
            }
            catch (Exception ex) {
               t1_ex = ex;
            }
         }
      };

      Thread t2 = new Thread()
      {
         Transaction tx;

         public void run()
         {
            List lang = null;
            UserTransaction tx = null;
            IdObject id1 = null;
            try {
               Person ben = (Person)cache1_.getObject("/test/ben");
               lang = ben.getLanguages();

               tx = getTransaction();
               tx.begin();
               id1 = new IdObject("2");
               lang.add(id1);
               TestingUtil.sleepThread(1000);
               tx.commit();
            }
            catch(RollbackException rollback) {
View Full Code Here


    * that overrides the hashCode().
    */
   public void testRecuriveMapKey()
   {
      try {
         IdObject id = new IdObject("1");
         ValueObject value = new ValueObject(id, 3.0f);
         cachedMap.put(id, value);
      } // try
      catch (Exception x) {
         x.printStackTrace();
View Full Code Here

TOP

Related Classes of org.jboss.cache.aop.test.IdObject

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.