Project JXTA

net.jxta.impl.pipe
Class WirePipeImpl

java.lang.Object
  extended bynet.jxta.impl.pipe.WirePipeImpl
All Implemented Interfaces:
EndpointListener

public class WirePipeImpl
extends Object
implements EndpointListener

This class implements the NetPipe interface.


Field Summary
static String WireName
           
static String WireServiceName
           
static String WireTagName
           
 
Constructor Summary
(package private) WirePipeImpl(PeerGroup group, PipeResolver pipeResolver)
           
 
Method Summary
(package private)  InputPipe createInputPipe(PipeAdvertisement adv, PipeMsgListener listener)
          create an InputPipe from a pipe Advertisement
(package private)  NonBlockingWireOutputPipe createOutputPipe(PipeAdvertisement adv, Set peers)
          create an OutputPipe from the pipe Advertisement giving a PeerId(s) where the corresponding InputPipe is supposed to be.
 String getServiceName()
          To support WirePipe.send(Message, Enumeration)
 String getServiceParameter()
          To support WirePipe.send(Message, Enumeration)
 void processIncomingMessage(Message message, EndpointAddress srcAddr, EndpointAddress dstAddr)
          
 int startApp(String[] arg)
          Supply arguments and starts this service if it hadn't started by itself.
 void stopApp()
          Ask this service to stop.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WireName

public static final String WireName
See Also:
Constant Field Values

WireTagName

public static final String WireTagName
See Also:
Constant Field Values

WireServiceName

public static final String WireServiceName
See Also:
Constant Field Values
Constructor Detail

WirePipeImpl

WirePipeImpl(PeerGroup group,
             PipeResolver pipeResolver)
Method Detail

getServiceParameter

public String getServiceParameter()
To support WirePipe.send(Message, Enumeration)


getServiceName

public String getServiceName()
To support WirePipe.send(Message, Enumeration)


startApp

public int startApp(String[] arg)
Supply arguments and starts this service if it hadn't started by itself. Currently this service does not expect arguments.

Parameters:
arg - A table of strings arguments.
Returns:
int status indication.

stopApp

public void stopApp()
Ask this service to stop.


createInputPipe

InputPipe createInputPipe(PipeAdvertisement adv,
                          PipeMsgListener listener)
                    throws IOException
create an InputPipe from a pipe Advertisement

Parameters:
adv - is the advertisement of the PipeServiceImpl.
listener - PipeMsgListener to receive msgs.
Returns:
InputPipe InputPipe object created
Throws:
IOException - error creating input pipe

createOutputPipe

NonBlockingWireOutputPipe createOutputPipe(PipeAdvertisement adv,
                                           Set peers)
create an OutputPipe from the pipe Advertisement giving a PeerId(s) where the corresponding InputPipe is supposed to be.

Parameters:
adv - is the advertisement of the NetPipe.
peers - is an enumeration of the PeerId of the peers where to look for the corresponding Pipes
Returns:
OuputPipe
Throws:
IOException - if none of the peers in the enumeration has the corresponding OutputPipe

processIncomingMessage

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

Specified by:
processIncomingMessage in interface EndpointListener

JXTA J2SE