|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.pipe.NonBlockingWireOutputPipe
class NonBlockingWireOutputPipe
An implementation of Ouput Pipe which sends messages on the pipe
asynchronously. The send()
method for this implementation will
never block.
Constructor Summary | |
---|---|
NonBlockingWireOutputPipe(PeerGroup group,
WirePipe wire,
PipeAdvertisement pAdv,
Set<? extends ID> peers)
Create a new output pipe |
Method Summary | |
---|---|
void |
close()
close the pipe |
PipeAdvertisement |
getAdvertisement()
Gets the pipe advertisement |
String |
getName()
Gets the pipe name |
ID |
getPipeID()
Gets the pipe id |
String |
getType()
Gets the pipe type |
boolean |
isClosed()
Returns true if this pipe is closed and no longer
accepting messages to be sent. |
boolean |
send(Message message)
Send a message through the pipe WARNING: The message object used when sending a pipe message should not be reused or modified after the OutputPipe.send(Message) call is
made. |
(package private) boolean |
sendUnModified(Message msg,
WireHeader header)
Sends a message unaltered |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NonBlockingWireOutputPipe(PeerGroup group, WirePipe wire, PipeAdvertisement pAdv, Set<? extends ID> peers)
group
- The peergroup we are working in.wire
- The propagate pipe service.pAdv
- advertisement for the pipe we are supporting.peers
- the set of peers we allow this pipe to be bound to.Method Detail |
---|
public void close()
close
in interface OutputPipe
public boolean isClosed()
true
if this pipe is closed and no longer
accepting messages to be sent. The pipe should be discarded.
isClosed
in interface OutputPipe
true
if this pipe is closed, otherwise
false
.public final String getType()
getType
in interface OutputPipe
public final ID getPipeID()
getPipeID
in interface OutputPipe
public final String getName()
getName
in interface OutputPipe
public final PipeAdvertisement getAdvertisement()
getAdvertisement
in interface OutputPipe
public boolean send(Message message) throws IOException
OutputPipe.send(Message)
call is
made. Concurrent modification of messages will produce unexpected result.
send
in interface OutputPipe
message
- is the PipeMessage to be sent.
true
if the message has been sent otherwise
false
. false
. is commonly returned for
non-error related congestion, meaning that you should be able to send
the message after waiting some amount of time.
IOException
- output pipe errorboolean sendUnModified(Message msg, WireHeader header) throws IOException
msg
- the message to sendheader
- message header
IOException
- if an io error occurs
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |