public synchronized void connect() throws IOException { this.connected = true; super.connect(); }
@Override public synchronized void disconnect() { this.connected = false; super.disconnect(); }
@Override public synchronized void connect() throws IOException { //do nothing, happens in the socket sender itself queue.open(); setConnected(true); }
public synchronized DataSender getSender(long timeout) { long start = System.currentTimeMillis(); while ( true ) { if (!isOpen)throw new IllegalStateException("Queue is closed"); DataSender sender = null; if (notinuse.size() == 0 && inuse.size() < limit) { sender = parent.getNewDataSender(); } else if (notinuse.size() > 0) { sender = notinuse.remove(0); } if (sender != null) { inuse.add(sender); return sender; }//end if long delta = System.currentTimeMillis() - start; if ( delta > timeout && timeout>0) return null; else { try { wait(Math.max(timeout - delta,1)); }catch (InterruptedException x){} }//end if } }
public DataSender getSender() { return queue.getSender(getTimeout()); }
public DataSender getSender() { return queue.getSender(getMaxWait()); }
@Override public synchronized void disconnect() { queue.close(); setConnected(false); }
public synchronized DataSender getSender(long timeout) { long start = System.currentTimeMillis(); while ( true ) { if (!isOpen)throw new IllegalStateException("Queue is closed"); DataSender sender = null; if (notinuse.size() == 0 && inuse.size() < limit) { sender = parent.getNewDataSender(); } else if (notinuse.size() > 0) { sender = notinuse.remove(0); } if (sender != null) { inuse.add(sender); return sender; }//end if long delta = System.currentTimeMillis() - start; if ( delta > timeout && timeout>0) return null; else { try { wait(Math.max(timeout - delta,1)); }catch (InterruptedException x){} }//end if } }
public DataSender getSender() { return queue.getSender(getTimeout()); }
public DataSender getSender() { return queue.getSender(getMaxWait()); }
@Override public synchronized void disconnect() { queue.close(); setConnected(false); }
public synchronized DataSender getSender(long timeout) { long start = System.currentTimeMillis(); while ( true ) { if (!isOpen)throw new IllegalStateException("Queue is closed"); DataSender sender = null; if (notinuse.size() == 0 && inuse.size() < limit) { sender = parent.getNewDataSender(); } else if (notinuse.size() > 0) { sender = (DataSender) notinuse.remove(0); } if (sender != null) { inuse.add(sender); return sender; }//end if long delta = System.currentTimeMillis() - start; if ( delta > timeout && timeout>0) return null; else { try { wait(Math.max(timeout - delta,1)); }catch (InterruptedException x){} }//end if } }
public synchronized void disconnect() { this.connected = false; super.disconnect(); }
@Override public synchronized void connect() throws IOException { this.connected = true; super.connect(); }
@Override public synchronized void disconnect() { queue.close(); setConnected(false); }
public synchronized DataSender getSender(long timeout) { long start = System.currentTimeMillis(); while ( true ) { if (!isOpen)throw new IllegalStateException(sm.getString("pooledSender.closed.queue")); DataSender sender = null; if (notinuse.size() == 0 && inuse.size() < limit) { sender = parent.getNewDataSender(); } else if (notinuse.size() > 0) { sender = notinuse.remove(0); } if (sender != null) { inuse.add(sender); return sender; }//end if long delta = System.currentTimeMillis() - start; if ( delta > timeout && timeout>0) return null; else { try { wait(Math.max(timeout - delta,1)); }catch (InterruptedException x){} }//end if } }
@Override public synchronized void disconnect() { this.connected = false; super.disconnect(); }
@Override public synchronized void connect() throws IOException { this.connected = true; super.connect(); }
public synchronized void connect() throws IOException { //do nothing, happens in the socket sender itself queue.open(); setConnected(true); }
@Override public synchronized void connect() throws IOException { //do nothing, happens in the socket sender itself queue.open(); setConnected(true); }