Project JXTA

net.jxta.pipe
Interface OutputPipe


public interface OutputPipe

OuputPipe defines the interface for sending messages from a PipeService.

Application that want to send messages onto a Pipe must fist get an OutputPipe from the PipeService.

See Also:
PipeService, InputPipe, Message, PipeAdvertisement

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 msg)
          Send a message throught the pipe

WARNING: The message object used when sending a pipe message should not be reused or modified after the send(Message) call is made.

 

Method Detail

send

public boolean send(Message msg)
             throws IOException
Send a message throught the pipe

WARNING: The message object used when sending a pipe message should not be reused or modified after the send(Message) call is made. Concurrent modification of messages will produce unexpected result.

Parameters:
msg - is the PipeMessage to be sent.
Returns:
boolean 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.
Throws:
IOException - output pipe error

close

public void close()
close the pipe


isClosed

public boolean isClosed()
Returns true if this pipe is closed and no longer accepting messages to be sent. The pipe should be discarded.

Returns:
true if this pipe is closed, otherwise false.

getType

public String getType()
Gets the pipe type

Returns:
The type

getPipeID

public ID getPipeID()
Gets the pipe id

Returns:
The type

getName

public String getName()
Gets the pipe name

Returns:
The name

getAdvertisement

public PipeAdvertisement getAdvertisement()
Gets the pipe advertisement

Returns:
The advertisement

JXTA J2SE