|
Project JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PipeService
This class defines the API to the JXTA Pipe Service.
Pipes are the core mechanism for exchanging messages between JXTA applications or services. Pipes are uniquely identified by aPipeAdvertisement
which is associated with each
pipe. Creating the advertisement of a Pipe must be done only once in the
lifetime of a Pipe. In fact, a PipeAdvertisement
represents the pipe on the JXTA network.
Several types of Pipe can be used:
PipeAdvertisement
.
WARNING: The message object used when sending a pipe message
should not be reused or modified after the
OutputPipe.send(Message)
call is made. Concurrent
modification of messages will produce unexpected result.
PipeAdvertisement
,
InputPipe
,
OutputPipe
,
Message
Field Summary | |
---|---|
static String |
PropagateType
Propagated, unsecure and unreliable type of Pipe |
static String |
UnicastSecureType
End-to-end secured unicast pipe of Pipe |
static String |
UnicastType
Unicast, unreliable and unsecure type of Pipe |
Fields inherited from interface net.jxta.platform.Module |
---|
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_OK |
Method Summary | |
---|---|
InputPipe |
createInputPipe(PipeAdvertisement adv)
Create an InputPipe from a pipe Advertisement |
InputPipe |
createInputPipe(PipeAdvertisement adv,
PipeMsgListener listener)
create an InputPipe from a pipe Advertisement |
Message |
createMessage()
Deprecated. Use new Message.Message() instead. |
OutputPipe |
createOutputPipe(PipeAdvertisement adv,
Enumeration resolvablePeers,
long timeout)
Deprecated. Use createOutputPipe(PipeAdvertisement, Set, long) instead. |
OutputPipe |
createOutputPipe(PipeAdvertisement adv,
long timeout)
Attempt to ceate an OutputPipe using the specified Pipe Advertisement. |
void |
createOutputPipe(PipeAdvertisement adv,
OutputPipeListener listener)
Attempt to ceate an OutputPipe using the specified Pipe Advertisement. |
OutputPipe |
createOutputPipe(PipeAdvertisement adv,
PeerID peerid,
long timeout)
Deprecated. Use createOutputPipe(PipeAdvertisement, Set, long) with a Collections.singleton(Object) instead. |
void |
createOutputPipe(PipeAdvertisement adv,
PeerID peerid,
OutputPipeListener listener)
Deprecated. Use createOutputPipe(PipeAdvertisement, Set, long) with a Collections.singleton(Object) instead. |
OutputPipe |
createOutputPipe(PipeAdvertisement adv,
Set resolvablePeers,
long timeout)
Attempt to ceate an OutputPipe using the specified Pipe Advertisement. |
void |
createOutputPipe(PipeAdvertisement pipeAdv,
Set resolvablePeers,
OutputPipeListener listener)
Attempt to ceate an OutputPipe using the specified Pipe Advertisement. |
OutputPipeListener |
removeOutputPipeListener(String pipeID,
OutputPipeListener listener)
Remove an OutputPipeListener previously registered with createOuputputPipe . |
Methods inherited from interface net.jxta.service.Service |
---|
getImplAdvertisement, getInterface |
Methods inherited from interface net.jxta.platform.Module |
---|
init, startApp, stopApp |
Field Detail |
---|
static final String UnicastType
static final String PropagateType
static final String UnicastSecureType
Method Detail |
---|
InputPipe createInputPipe(PipeAdvertisement adv) throws IOException
adv
- is the advertisement of the PipeService.
IOException
- error creating input pipeInputPipe createInputPipe(PipeAdvertisement adv, PipeMsgListener listener) throws IOException
adv
- is the advertisement of the PipeService.listener
- PipeMsgListener to receive msgs.
IOException
- error creating input pipeOutputPipe createOutputPipe(PipeAdvertisement adv, long timeout) throws IOException
adv
- The advertisement of the pipe being resolved.timeout
- time duration in milliseconds to wait for a successful
pipe resolution. 0
will wait indefinitely. All negative
values will cause a wait of an inplementation defined non-infinite value.
(this behaviour is deprecated and may eventually disappear).
IOException
- If the pipe cannot be created or failed to resolve
within the specified time.OutputPipe createOutputPipe(PipeAdvertisement adv, PeerID peerid, long timeout) throws IOException
createOutputPipe(PipeAdvertisement, Set, long)
with a Collections.singleton(Object)
instead.
adv
- The advertisement of the pipe being resolved.peerid
- The peer id of the peer on which on which the pipe may be
resolved. All elements of the enumeration must must be
of type PeerID
.timeout
- time duration in milliseconds to wait for a successful
pipe resolution. 0
will wait indefinitely. All negative
values will cause a wait of an inplementation defined non-infinite value.
(this behaviour is deprecated and may eventually disappear).
IOException
- If the pipe cannot be created or failed to resolve
within the specified time.OutputPipe createOutputPipe(PipeAdvertisement adv, Enumeration resolvablePeers, long timeout) throws IOException
createOutputPipe(PipeAdvertisement, Set, long)
instead.
adv
- The advertisement of the pipe being resolved.resolvablePeers
- The non-empty enumeration of peers on which the pipe may be
resolved. All elements of the enumeration must must be
of type PeerID
.timeout
- time duration in milliseconds to wait for a successful
pipe resolution. 0
will wait indefinitely. All negative
values will cause a wait of an inplementation defined non-infinite value.
(this behaviour is deprecated and may eventually disappear).
IOException
- If the pipe cannot be created or failed to resolve
within the specified time.OutputPipe createOutputPipe(PipeAdvertisement adv, Set resolvablePeers, long timeout) throws IOException
adv
- The advertisement of the pipe being resolved.resolvablePeers
- The set of peers on which the pipe may be resolved.
All elements of the set must must be of type
PeerID
. If the Set is empty then the pipe
may be resolved to any destination peer.timeout
- time duration in milliseconds to wait for a successful
pipe resolution. 0
will wait indefinitely. All negative
values will cause a wait of an inplementation defined non-infinite value.
(this behaviour is deprecated and may eventually disappear).
IOException
- If the pipe cannot be created or failed to resolve
within the specified time.void createOutputPipe(PipeAdvertisement adv, OutputPipeListener listener) throws IOException
adv
- The advertisement of the pipe being resolved.listener
- the listener to be called when the pipe is resolved.
IOException
- If the pipe cannot be created.void createOutputPipe(PipeAdvertisement adv, PeerID peerid, OutputPipeListener listener) throws IOException
createOutputPipe(PipeAdvertisement, Set, long)
with a Collections.singleton(Object)
instead.
adv
- The advertisement of the pipe being resolved.peerid
- The peer id of the peer on which on which the pipe may be
resolved. All elements of the enumeration must must be
of type PeerID
.listener
- the listener to be called when the pipe is resolved.
IOException
- If the pipe cannot be created.void createOutputPipe(PipeAdvertisement pipeAdv, Set resolvablePeers, OutputPipeListener listener) throws IOException
pipeAdv
- The advertisement of the pipe being resolved.resolvablePeers
- The set of peers on which the pipe may be resolved.
All elements of the set must must be of type
PeerID
. If the Set is empty then the pipe
may be resolved to any destination peer.listener
- the listener to be called when the pipe is resolved.
IOException
- If the pipe cannot be created.Message createMessage()
Message.Message()
instead.
OutputPipeListener removeOutputPipeListener(String pipeID, OutputPipeListener listener)
createOuputputPipe
.
pipeID
- listener to removelistener
- listener to remove
|
JXTA J2SE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |