Project JXTA

net.jxta.impl.pipe
Class PipeInterface

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

public class PipeInterface
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
PipeInterface(PipeService theRealThing)
          The only authorized constructor.
 
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 advertisment for that service.
 net.jxta.service.Service getInterface()
          returns an interface object that permits to use this service without having access to the real object.
 void init(net.jxta.peergroup.PeerGroup pg, net.jxta.document.Advertisement a)
          Initialize the application FIXME: This is meaningless for the interface object; it is there only to satisfy the requirements of the interface that we implement.
 int startApp(java.lang.String[] arg)
          This is here for temporary class hierarchy reasons.
 void stopApp()
          This is here for temporary class hierarchy reasons.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PipeInterface

public PipeInterface(PipeService theRealThing)
The only authorized constructor.
Method Detail

getInterface

public net.jxta.service.Service getInterface()
returns an interface object that permits to use this service without having access to the real object. Since THIS is already such an object, it returns itself. FIXME: it is kind of absurd to have this method part of the interface but we do not want to define two levels of Service interface just for that.
Returns:
Resolver An interface object that implements this service and nothing more.

getAdvertisement

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

init

public void init(net.jxta.peergroup.PeerGroup pg,
                 net.jxta.document.Advertisement a)
Initialize the application FIXME: This is meaningless for the interface object; it is there only to satisfy the requirements of the interface that we implement. Ultimately, the API should define two levels of interfaces: one for the real service implementation and one for the interface object. Right now it feels a bit heavy to so that since the only different between the two would be init() and may-be getName().
Parameters:
g - PeerGroup this application is started from
Since:
JXTA 1.0

startApp

public int startApp(java.lang.String[] arg)
This is here for temporary class hierarchy reasons. it is ALWAYS ignored. By definition, the interface object protects the real object's start/stop methods from being called
Parameters:
arg - A table of strings arguments.
Returns:
int status indication.

stopApp

public void stopApp()
This is here for temporary class hierarchy reasons. it is ALWAYS ignored. By definition, the interface object protects the real object's start/stop methods from being called This request is currently ignored.

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 output pipe to create
timeout - the number of milliseconds to wait while creation of the pipe
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 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