net.named_data.jndn
public class ThreadPoolFace extends Face
| Constructor and Description |
|---|
ThreadPoolFace(ScheduledExecutorService threadPool,
Transport transport,
Transport.ConnectionInfo connectionInfo)
Create a new ThreadPoolFace for communication with an NDN hub with the given
Transport object and connectionInfo.
|
| Modifier and Type | Method and Description |
|---|---|
void |
callLater(double delayMilliseconds,
Runnable callback)
Override to schedule in the thread pool to call callback.run() after the
given delay.
|
long |
expressInterest(Interest interest,
OnData onData,
OnTimeout onTimeout,
WireFormat wireFormat)
Submit a task to the thread pool to send the Interest through the
transport, read the entire response and call onData(interest, data).
|
expressInterest, expressInterest, expressInterest, expressInterest, expressInterest, expressInterest, expressInterest, expressInterest, expressInterest, expressInterest, expressInterest, getMaxNdnPacketSize, isLocal, makeCommandInterest, makeCommandInterest, processEvents, putData, putData, registerPrefix, registerPrefix, registerPrefix, registerPrefix, registerPrefix, registerPrefix, registerPrefix, registerPrefix, registerPrefix, registerPrefix, registerPrefix, registerPrefix, registerPrefix, registerPrefix, registerPrefix, registerPrefix, removePendingInterest, removeRegisteredPrefix, send, send, setCommandCertificateName, setCommandSigningInfo, setInterestFilter, setInterestFilter, shutdown, unsetInterestFilterpublic ThreadPoolFace(ScheduledExecutorService threadPool, Transport transport, Transport.ConnectionInfo connectionInfo)
threadPool - The thread pool used to submit method calls such as
expressInterest and the related callbacks such as onData. The thread pool
is also used to schedule the interest timeouts.transport - A Transport object used for communication. If you do not
want to call processEvents, then the transport should be an async transport
like AsyncTcpTransport, in which case the transport should use the same
ioService.connectionInfo - A Transport.ConnectionInfo to be used to connect to
the transport.public long expressInterest(Interest interest, OnData onData, OnTimeout onTimeout, WireFormat wireFormat) throws IOException
expressInterest in class Faceinterest - The Interest to send. This copies the Interest.onData - When a matching data packet is received, this calls
onData.onData(interest, data) where interest is the interest given to
expressInterest and data is the received Data object. NOTE: You must not
change the interest object - if you need to change it then make a copy.
This wraps the callback to submit it to the thread pool.onTimeout - If the interest times out according to the interest
lifetime, this calls onTimeout.onTimeout(interest) where interest is the
interest given to expressInterest. If onTimeout is null, this does not use
it. This wraps the callback to submit it to the thread pool.wireFormat - A WireFormat object used to encode the message.IOException - For I/O error in sending the interest.public void callLater(double delayMilliseconds,
Runnable callback)
Copyright © 2016. All rights reserved.