Project JXTA

net.jxta.impl.pipe
Class PipeService

java.lang.Object
  |
  +--net.jxta.impl.pipe.PipeService

public class PipeService
extends java.lang.Object
implements net.jxta.pipe.Pipe

This class implements the NetPipe interface.


Fields inherited from interface net.jxta.pipe.Pipe
HandChecking, NonBlocking, Propagate
 
Constructor Summary
PipeService()
          Constructor: this constructor is only needed in order to create the listener thread of the NodePipe.
 
Method Summary
 void addAddresses(net.jxta.protocol.PipeAdvertisement adv, java.util.Enumeration addrs)
           
 net.jxta.pipe.InputPipe createInputPipe(net.jxta.protocol.PipeAdvertisement adv)
          Creates an InputPipe of a NetPipe.
 net.jxta.endpoint.Message createMessage()
          Creates a new Message
 net.jxta.pipe.OutputPipe createOutputPipe(net.jxta.protocol.PipeAdvertisement adv, int type, java.util.Enumeration peers, long timeout)
          create an OutputPipe from the pipe Advertisement giving a PeerId(s) where the corresponding InputPipe is supposed to be.
 net.jxta.pipe.OutputPipe createOutputPipe(net.jxta.protocol.PipeAdvertisement pipeAdv, int type, long timeout)
          Creates an OutputPipe associated to a NetPipe.
 net.jxta.document.Advertisement getAdvertisement()
          Returns the advertisement for that service.
 net.jxta.service.Service getInterface()
          Service objects are not manipulated directly to protect usage of the service.
 void init(net.jxta.peergroup.PeerGroup g, net.jxta.document.Advertisement sadv)
          Init routine
 int startApp(java.lang.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
 

Constructor Detail

PipeService

public PipeService()
Constructor: this constructor is only needed in order to create the listener thread of the NodePipe.
Method Detail

startApp

public int startApp(java.lang.String[] arg)
Supply arguments and starts this service if it hadn't started by itself. Currently this service starts by itself and does not expect arguments.
Parameters:
arg - A table of strings arguments.
Returns:
int status indication.

stopApp

public void stopApp()
Ask this service to stop. This request is currently ignored.

getInterface

public net.jxta.service.Service getInterface()
Service objects are not manipulated directly to protect usage of the service. A Service interface is returned to access the service methods.
Returns:
Service public interface of the service
Since:
JXTA 1.0

getAdvertisement

public net.jxta.document.Advertisement getAdvertisement()
Returns the advertisement for that service.
Returns:
Advertisement the advertisement.
Since:
JXTA 1.0

init

public void init(net.jxta.peergroup.PeerGroup g,
                 net.jxta.document.Advertisement sadv)
Init routine
Parameters:
myGroup - The Group associated with this service

createInputPipe

public net.jxta.pipe.InputPipe createInputPipe(net.jxta.protocol.PipeAdvertisement adv)
                                        throws java.io.IOException
Creates an InputPipe of a NetPipe.
Specified by:
createInputPipe in interface net.jxta.pipe.Pipe
Parameters:
adv - is the public advertisement of the NetPipe.
Returns:
InputPipe returns a InputPipe associated to the NetPipe.

createOutputPipe

public net.jxta.pipe.OutputPipe createOutputPipe(net.jxta.protocol.PipeAdvertisement pipeAdv,
                                                 int type,
                                                 long timeout)
                                          throws java.io.IOException
Creates an OutputPipe associated to a NetPipe.
Specified by:
createOutputPipe in interface net.jxta.pipe.Pipe
Parameters:
adv - is the public advertisement of the destination NetPipe.
type - the type of the output pipe to create
timeout - the number of milliseconds to wait during pipe creation
Returns:
OutputPipe returns an OutputPipe associated to the destination NetPipe.

createOutputPipe

public net.jxta.pipe.OutputPipe createOutputPipe(net.jxta.protocol.PipeAdvertisement adv,
                                                 int type,
                                                 java.util.Enumeration peers,
                                                 long timeout)
                                          throws java.io.IOException
create an OutputPipe from the pipe Advertisement giving a PeerId(s) where the corresponding InputPipe is supposed to be.
Specified by:
createOutputPipe in interface net.jxta.pipe.Pipe
Parameters:
adv - is the advertisement of the NetPipe.
type - is an int and contains the name of the diffusion mode for this OutputPipe.
peers - is an enumeration of the PeerId of thepeers where to look for the corresponding Pipes
timeout - the number of milliseconds to wait for during pipe creation
Returns:
OuputPipe
Throws:
java.io.IOException - if none of the peers in the enumeration has the corresponding OutputPipe

createMessage

public net.jxta.endpoint.Message createMessage()
Creates a new Message
Specified by:
createMessage in interface net.jxta.pipe.Pipe
Returns:
Message returns a newly allocated Message.

addAddresses

public void addAddresses(net.jxta.protocol.PipeAdvertisement adv,
                         java.util.Enumeration addrs)
Specified by:
addAddresses in interface net.jxta.pipe.Pipe

Project JXTA