Package org.jboss.util.timeout

Examples of org.jboss.util.timeout.Timeout


      TT tt = new TT();
      TimeoutFactory tf = new TimeoutFactory();
      long at = System.currentTimeMillis() + 300;
      for (int i = 0; i < times; i++)
      {
         Timeout t = tf.schedule(at, (TimeoutTarget)tt);
         t.cancel();
      }
      Thread.sleep(500);
      assertEquals(0, count.get());
   }
View Full Code Here


   {
      public void run()
      {
         for (int i = 0; i < iterationCount; ++i)
         {
            Timeout timeout = factory.createTimeout(System.currentTimeMillis() + 1, instance);
            if (timeout.cancel())
               count.increment();
         }
      }
View Full Code Here

      {
         try
         {
            for (int i = 0; i < iterationCount; ++i)
            {
               Timeout timeout = factory.createTimeout(System.currentTimeMillis() + 3000000, instance);
               timeout.cancel();
            }
            count.increment();
         }
         catch (Throwable t)
         {
View Full Code Here

        
         Iterator iter = clone.iterator();
        
         while (iter.hasNext())
         {
            Timeout timeout = (Timeout)iter.next();
           
            timeout.cancel();
         }
        
         scheduledDeliveries.clear();
      }
   }
View Full Code Here

        
         // Schedule the cancel to actually occur at the specified time. Need to synchronize to
         // prevent timeout being removed before it is added.
         synchronized (scheduledDeliveries)
         {           
            Timeout timeout =
               MessagingTimeoutFactory.instance.getFactory().
                  schedule(ref.getScheduledDeliveryTime(), new DeliverRefTimeoutTarget(ref));
           
            scheduledDeliveries.add(timeout);
         }     
View Full Code Here

         Iterator iter = clone.iterator();

         while (iter.hasNext())
         {
            Timeout timeout = (Timeout)iter.next();

            timeout.cancel();
           
            if (needRemove) {
               if (timeout instanceof TimeoutExt) {
                  TimeoutExt te = (TimeoutExt)timeout;
                  DeliverRefTimeoutTarget target = (DeliverRefTimeoutTarget)te.getTimeoutTarget();
View Full Code Here

         // Schedule the cancel to actually occur at the specified time. Need to synchronize to
         // prevent timeout being removed before it is added.
         synchronized (scheduledDeliveries)
         {
            Timeout timeout =
               MessagingTimeoutFactory.instance.getFactory().
                  schedule(ref.getScheduledDeliveryTime(), new DeliverRefTimeoutTarget(ref));

            scheduledDeliveries.add(timeout);
         }
View Full Code Here

         Iterator iter = clone.iterator();

         while (iter.hasNext())
         {
            Timeout timeout = (Timeout)iter.next();

            timeout.cancel();
           
            if (needRemove) {
               if (timeout instanceof TimeoutExt) {
                  TimeoutExt te = (TimeoutExt)timeout;
                  DeliverRefTimeoutTarget target = (DeliverRefTimeoutTarget)te.getTimeoutTarget();
View Full Code Here

         // Schedule the cancel to actually occur at the specified time. Need to synchronize to
         // prevent timeout being removed before it is added.
         synchronized (scheduledDeliveries)
         {
            Timeout timeout =
               MessagingTimeoutFactory.instance.getFactory().
                  schedule(ref.getScheduledDeliveryTime(), new DeliverRefTimeoutTarget(ref));

            scheduledDeliveries.add(timeout);
         }
View Full Code Here

         Iterator iter = clone.iterator();

         while (iter.hasNext())
         {
            Timeout timeout = (Timeout)iter.next();

            timeout.cancel();
           
            if (needRemove) {
               if (timeout instanceof TimeoutExt) {
                  TimeoutExt te = (TimeoutExt)timeout;
                  DeliverRefTimeoutTarget target = (DeliverRefTimeoutTarget)te.getTimeoutTarget();
View Full Code Here

TOP

Related Classes of org.jboss.util.timeout.Timeout

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.