Project JXTA

net.jxta.impl.pipe
Class UnicastInputPipeImpl

java.lang.Object
  extended bynet.jxta.impl.pipe.InputPipeImpl
      extended bynet.jxta.impl.pipe.UnicastInputPipeImpl
All Implemented Interfaces:
EndpointListener, InputPipe
Direct Known Subclasses:
SecureInputPipeImpl

class UnicastInputPipeImpl
extends 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  PipeID pipeID
           
protected  UnbiasedQueue queue
           
protected static int QUEUESIZE
           
protected  PipeRegistrar registrar
           
 
Constructor Summary
(package private) UnicastInputPipeImpl(PipeResolver r, PipeAdvertisement adv, PipeMsgListener listener)
          Constructor for the InputPipeImpl object
 
Method Summary
 void close()
          
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)
          
 void processIncomingMessage(Message msg, EndpointAddress srcAddr, EndpointAddress dstAddr)
          
 Message waitForMessage()
          
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUEUESIZE

protected static final int QUEUESIZE
See Also:
Constant Field Values

registrar

protected PipeRegistrar registrar

pipeAdv

protected PipeAdvertisement pipeAdv

pipeID

protected PipeID pipeID

closed

protected volatile boolean closed

listener

protected PipeMsgListener listener

queue

protected UnbiasedQueue queue
Constructor Detail

UnicastInputPipeImpl

UnicastInputPipeImpl(PipeResolver r,
                     PipeAdvertisement adv,
                     PipeMsgListener listener)
               throws IOException
Constructor for the InputPipeImpl object

Parameters:
r - pipe resolver
adv - pipe advertisement
listener - listener to receive messages
Method Detail

close

public void close()

Specified by:
close in interface InputPipe
Overrides:
close in class InputPipeImpl

finalize

protected void finalize()
                 throws Throwable

Closes the pipe.

Throws:
Throwable

waitForMessage

public Message waitForMessage()
                       throws InterruptedException

Specified by:
waitForMessage in interface InputPipe
Throws:
InterruptedException

poll

public Message poll(int timeout)
             throws InterruptedException

Specified by:
poll in interface InputPipe
Throws:
InterruptedException

processIncomingMessage

public void processIncomingMessage(Message msg,
                                   EndpointAddress srcAddr,
                                   EndpointAddress dstAddr)

Specified by:
processIncomingMessage in interface EndpointListener

getType

public String getType()
Gets the pipe type

Specified by:
getType in interface InputPipe
Returns:
The type

getPipeID

public ID getPipeID()
Gets the pipe id

Specified by:
getPipeID in interface InputPipe
Returns:
The type

getName

public String getName()
Gets the pipe name

Specified by:
getName in interface InputPipe
Returns:
The name

getAdvertisement

public PipeAdvertisement getAdvertisement()
Gets the pipe advertisement

Specified by:
getAdvertisement in interface InputPipe
Returns:
The advertisement

JXTA J2SE