Package EDU.oswego.cs.dl.util.concurrent

Examples of EDU.oswego.cs.dl.util.concurrent.Slot.poll()


        try {
           
            if( timeout == WAIT_FOREVER_TIMEOUT ) {
                return (Packet) responseSlot.take();               
            } else if (timeout == NO_WAIT_TIMEOUT ) {
                return (Packet) responseSlot.poll(1);                               
            } else {
                return (Packet) responseSlot.poll(timeout);                               
            }
           
        } catch (InterruptedException e) {
View Full Code Here


            if( timeout == WAIT_FOREVER_TIMEOUT ) {
                return (Packet) responseSlot.take();               
            } else if (timeout == NO_WAIT_TIMEOUT ) {
                return (Packet) responseSlot.poll(1);                               
            } else {
                return (Packet) responseSlot.poll(timeout);                               
            }
           
        } catch (InterruptedException e) {
            throw new InterruptedIOException(e.getMessage());
        } finally {
View Full Code Here

                    }
                }
            });
        sender.forceDisconnect();

        assertNotNull("Should have received state change notification", disconnectEvent.poll(1000*30));
        assertFalse("Should be disconnected", sender.isTransportConnected());
        //there could ber exceptions thrown - which are valid for a force disconnect
        //so clear them so tearDown() will pass
        exceptions.clear();
    }
View Full Code Here

      MessageProducer prod = session2.createProducer(topic);
      Message m = session.createTextMessage("blah");

      prod.send(m);

      TextMessage rm = (TextMessage)slot.poll(5000);

      assertEquals("blah", rm.getText());

      // Only for JBoss Remoting > 2.0.0.Beta1
      long sleepTime = ServerInvoker.DEFAULT_TIMEOUT_PERIOD + 60000;
View Full Code Here

      // this message to the MessageCallbackHandler, and the test will fail

      Message m2 = session.createTextMessage("blah2");
      prod.send(m2);

      TextMessage rm2 = (TextMessage)slot.poll(5000);

      assertNotNull(rm2);
      assertEquals("blah2", rm2.getText());

      conn.close();
View Full Code Here

 
        TextMessage m = session.createTextMessage("message one");
 
        prod.send(m);
 
        TextMessage rm = (TextMessage)slot.poll(5000);
 
        assertEquals("message one", rm.getText());
      }
     finally
     {
View Full Code Here

        MessageProducer prod = session.createProducer(queue1);
        prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
        TextMessage m = session.createTextMessage("one");
        prod.send(m);
 
        TextMessage rm = (TextMessage)slot.poll(5000);
 
        assertEquals("one", rm.getText());
      }
     finally
     {
View Full Code Here

 
        TextMessage m = session.createTextMessage("message one");
 
        prod.send(m);
 
        TextMessage rm = (TextMessage)slot.poll(5000);
 
        assertEquals("message one", rm.getText());
      }
     finally
     {
View Full Code Here

        MessageProducer prod = session.createProducer(queue1);
        prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
        TextMessage m = session.createTextMessage("one");
        prod.send(m);
 
        TextMessage rm = (TextMessage)slot.poll(5000);
 
        assertEquals("one", rm.getText());
      }
     finally
     {
View Full Code Here

                    }
                }
            });
        sender.forceDisconnect();

        assertNotNull("Should have received state change notification", disconnectEvent.poll(1000*30));
        assertFalse("Should be disconnected", sender.isTransportConnected());
        //there could ber exceptions thrown - which are valid for a force disconnect
        //so clear them so tearDown() will pass
        exceptions.clear();
    }
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.