com.ning.http.client.providers.grizzly
Class FeedableBodyGenerator.BaseFeeder

java.lang.Object
  extended by com.ning.http.client.providers.grizzly.FeedableBodyGenerator.BaseFeeder
All Implemented Interfaces:
FeedableBodyGenerator.Feeder
Direct Known Subclasses:
FeedableBodyGenerator.NonBlockingFeeder, FeedableBodyGenerator.SimpleFeeder
Enclosing class:
FeedableBodyGenerator

public abstract static class FeedableBodyGenerator.BaseFeeder
extends Object
implements FeedableBodyGenerator.Feeder

Base class for FeedableBodyGenerator.Feeder implementations. This class provides an implementation for the contract defined by the feed(org.glassfish.grizzly.Buffer, boolean) method.


Field Summary
protected  FeedableBodyGenerator feedableBodyGenerator
           
 
Constructor Summary
protected FeedableBodyGenerator.BaseFeeder(FeedableBodyGenerator feedableBodyGenerator)
           
 
Method Summary
 void feed(org.glassfish.grizzly.Buffer buffer, boolean last)
          This method will write the specified Buffer to the connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ning.http.client.providers.grizzly.FeedableBodyGenerator.Feeder
flush
 

Field Detail

feedableBodyGenerator

protected final FeedableBodyGenerator feedableBodyGenerator
Constructor Detail

FeedableBodyGenerator.BaseFeeder

protected FeedableBodyGenerator.BaseFeeder(FeedableBodyGenerator feedableBodyGenerator)
Method Detail

feed

public final void feed(org.glassfish.grizzly.Buffer buffer,
                       boolean last)
                throws IOException
This method will write the specified Buffer to the connection. Be aware that this method may block depending if data is being fed faster than it can write. How much data may be queued is dictated by FeedableBodyGenerator.setMaxPendingBytes(int). Once this threshold is exceeded, the method will block until the write queue length drops below the aforementioned threshold.

Specified by:
feed in interface FeedableBodyGenerator.Feeder
Parameters:
buffer - the Buffer to write.
last - flag indicating if this is the last buffer to send.
Throws:
IOException - if an I/O error occurs.
See Also:
FeedableBodyGenerator.setMaxPendingBytes(int)


Copyright © 2014. All Rights Reserved.