|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.pipe.InputPipeImpl
class InputPipeImpl
Implements the InputPipe
interface by listening on the
endpoint for messages to service "PipeService" and a param of the Pipe ID.
Field Summary | |
---|---|
protected boolean |
closed
|
protected PipeMsgListener |
listener
|
protected PipeAdvertisement |
pipeAdv
|
protected ID |
pipeID
|
protected UnbiasedQueue |
queue
|
protected static int |
QUEUESIZE
|
protected PipeRegistrar |
registrar
|
Constructor Summary | |
---|---|
InputPipeImpl(PipeRegistrar r,
PipeAdvertisement adv,
PipeMsgListener listener)
Constructor for the InputPipeImpl object |
Method Summary | |
---|---|
void |
close()
Close the pipe. |
protected void |
finalize()
Closes 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 |
Message |
poll(int timeout)
Poll for a message from the pipe. |
void |
processIncomingMessage(Message msg,
EndpointAddress srcAddr,
EndpointAddress dstAddr)
This method is invoked by the EndpointService for each incoming message which is addressed to this listener. |
Message |
waitForMessage()
Wait (block) for a message to be received. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int QUEUESIZE
protected PipeRegistrar registrar
protected final PipeAdvertisement pipeAdv
protected final ID pipeID
protected volatile boolean closed
protected PipeMsgListener listener
protected final UnbiasedQueue queue
Constructor Detail |
---|
InputPipeImpl(PipeRegistrar r, PipeAdvertisement adv, PipeMsgListener listener) throws IOException
r
- pipe resolveradv
- pipe advertisementlistener
- listener to receive messages
IOException
- if an io error occursMethod Detail |
---|
protected void finalize() throws Throwable
finalize
in class Object
Throwable
public Message waitForMessage() throws InterruptedException
waitForMessage
in interface InputPipe
InterruptedException
- If another thread interrupted while we
were waiting for a message.public Message poll(int timeout) throws InterruptedException
poll
in interface InputPipe
timeout
- Maximum number of milliseconds to wait (block) for a
message to be received. If zero then wait indefinitely for a message.
InterruptedException
- If another thread interrupted while we
were waiting for a message.public void close()
close
in interface InputPipe
public void processIncomingMessage(Message msg, EndpointAddress srcAddr, EndpointAddress dstAddr)
processIncomingMessage
in interface EndpointListener
msg
- Incoming messagesrcAddr
- Endpoint Address of the source of the message.dstAddr
- Endpoint Address of the destination of the message.public String getType()
getType
in interface InputPipe
public ID getPipeID()
getPipeID
in interface InputPipe
public String getName()
getName
in interface InputPipe
public PipeAdvertisement getAdvertisement()
getAdvertisement
in interface InputPipe
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |