private pipecreated
advertisement back, where the remove side resolves back.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
nameSpace
protected static final String nameSpace
- See Also:
- Constant Field Values
credTag
protected static final String credTag
- See Also:
- Constant Field Values
reqPipeTag
protected static final String reqPipeTag
- See Also:
- Constant Field Values
remPeerTag
protected static final String remPeerTag
- See Also:
- Constant Field Values
remPipeTag
protected static final String remPipeTag
- See Also:
- Constant Field Values
closeTag
protected static final String closeTag
- See Also:
- Constant Field Values
reliableTag
protected static final String reliableTag
- See Also:
- Constant Field Values
myCredentialDoc
protected StructuredDocument myCredentialDoc
JxtaServerPipe
public JxtaServerPipe(PeerGroup group,
PipeAdvertisement pipeadv)
throws IOException
- Default constructor for the JxtaServerPipe
backlog default of 50
timeout defaults to 60 seconds, i.e. blocking.
- Parameters:
group
- JXTA PeerGrouppipeadv
- PipeAdvertisement on which pipe requests are accepted
- Throws:
IOException
- if an I/O error occurs
JxtaServerPipe
public JxtaServerPipe(PeerGroup group,
PipeAdvertisement pipeadv,
int backlog,
int timeout)
throws IOException
- Constructor for the JxtaServerPipe
- Parameters:
group
- JXTA PeerGrouppipeadv
- PipeAdvertisement on which pipe requests are acceptedbacklog
- the maximum length of the queue.timeout
- the specified timeout, in milliseconds
- Throws:
IOException
- if an I/O error occurs
JxtaServerPipe
public JxtaServerPipe(PeerGroup group,
PipeAdvertisement pipeadv,
int backlog)
throws IOException
- Constructor for the JxtaServerPipe object
- Parameters:
group
- JXTA PeerGrouppipeadv
- PipeAdvertisement on which pipe requests are acceptedbacklog
- the maximum length of the queue.
- Throws:
IOException
- if an I/O error occurs
bind
public void bind(PeerGroup group,
PipeAdvertisement pipeadv)
throws IOException
- Binds the
JxtaServerPipe
to a specific pipe advertisement
- Parameters:
group
- JXTA PeerGrouppipeadv
- PipeAdvertisement on which pipe requests are accepted
- Throws:
IOException
- if an I/O error occurs
bind
public void bind(PeerGroup group,
PipeAdvertisement pipeadv,
int backlog)
throws IOException
- Binds the
JxtaServerPipe
to a specific pipe advertisement
- Parameters:
group
- JXTA PeerGrouppipeadv
- PipeAdvertisement on which pipe requests are acceptedbacklog
- the maximum length of the queue.
- Throws:
IOException
- if an I/O error occurs
accept
public JxtaBiDiPipe accept()
throws IOException
- Listens for a connection to be made to this socket and accepts
it. The method blocks until a connection is made.
- Returns:
- JxtaBiDiPipe
- Throws:
IOException
- if an I/O error occurs
getGroup
public PeerGroup getGroup()
- Gets the group associated with this JxtaServerPipe
- Returns:
- The group value
getPipeAdv
public PipeAdvertisement getPipeAdv()
- Gets the PipeAdvertisement associated with this JxtaServerPipe
- Returns:
- The pipeAdv value
close
public void close()
throws IOException
- Closes this JxtaServerPipe (closes the underlying input pipe).
- Throws:
IOException
- if an I/O error occurs
getPipeTimeout
public int getPipeTimeout()
throws IOException
- Gets the Timeout attribute of the JxtaServerPipe
- Returns:
- The soTimeout value
- Throws:
IOException
- if an I/O error occurs
setPipeTimeout
public void setPipeTimeout(int timeout)
throws SocketException
- Sets the Timeout attribute of the JxtaServerPipe
a timeout of 0 blocks forever, by default this JxtaServerPipe's
timeout is set to 60000 ms
- Parameters:
timeout
- The new soTimeout value
- Throws:
IOException
- if an I/O error occurs
SocketException
isClosed
public boolean isClosed()
- Returns the closed state of the JxtaServerPipe.
- Returns:
- true if the socket has been closed
isBound
public boolean isBound()
- Returns the binding state of the JxtaServerPipe.
- Returns:
- true if the ServerSocket successfully bound to an address
pipeMsgEvent
public void pipeMsgEvent(PipeMsgEvent event)
- when request messages arrive this method is called
- Specified by:
pipeMsgEvent
in interface PipeMsgListener
- Parameters:
event
- the pipe message event
sendResponseMessage
protected void sendResponseMessage(PeerGroup group,
Messenger msgr,
PipeAdvertisement pipeAd)
throws IOException
- Method sendResponseMessage get the createResponseMessage and sends it.
- Parameters:
group
- msgr
- pipeAd
-
- Throws:
IOException
newInputPipe
protected static PipeAdvertisement newInputPipe(PeerGroup group,
PipeAdvertisement pipeadv)
- Utility method newInputPipe is used to get new pipe advertisement (w/random pipe ID) from old one.
Called by JxtaSocket to make pipe (name -> name.remote) for open message
Called by JxtaServerSocket to make pipe (name.remote -> name.remote.remote) for response message
- Parameters:
group
- pipeadv
- to get the basename and type from
- Returns:
- PipeAdvertisement a new pipe advertisement
getCredentialDoc
public StructuredDocument getCredentialDoc()
- get the credential doc
- Returns:
- Credential StructuredDocument
setCredentialDoc
public void setCredentialDoc(StructuredDocument doc)
- Sets the connection credential doc
If no credentials are set, the default group credential will be used
- Parameters:
doc
- Credential StructuredDocument