|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.ws.commons.tcpmon.core.filter.throttle.Throttle
public class Throttle
class to simulate slow connections by slowing down the system
Constructor Summary | |
---|---|
Throttle(ThrottleConfiguration config)
Constructor. |
Method Summary | |
---|---|
int |
getCurrentBytes()
get the current byte count |
int |
getTotalBytes()
how many bytes have gone past? |
void |
invoke(Stream stream)
Invoke the filter. |
boolean |
isReadOnly()
Determine whether this filter is read-only. |
void |
pump(int bytes)
log #of bytes pumped. |
void |
setCurrentBytes(int currentBytes)
set the current byte count |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Throttle(ThrottleConfiguration config)
config
- the configuration for this throttle instanceMethod Detail |
---|
public int getTotalBytes()
public void pump(int bytes)
bytes
- public boolean isReadOnly()
StreamFilter
isReadOnly
in interface StreamFilter
true
if this filter is read-onlypublic void invoke(Stream stream)
StreamFilter
Pipeline
when data is available for processing. The implementation can
modify the stream by discarding bytes from the stream and
inserting new data. If it doesn't wish to modify the stream,
it should skip the relevant parts, so that it will be processed
by the next filter in the pipeline.
An implementation is not required to process (skip or discard)
all the data available on each invocation. If after the invocation
of this method Stream.available()
is non zero, the remaining
(unprocessed) data will be available again during the next invocation
of the filter.
invoke
in interface StreamFilter
stream
- the stream to processpublic int getCurrentBytes()
public void setCurrentBytes(int currentBytes)
currentBytes
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |