|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.util.JxtaServerPipe
public class JxtaServerPipe
The server side of a JxtaBiDiPipe. The intent of this object is accept connection requests. JxtaServerPipe follows the same pattern as java.net.ServerSocket, without it no connection can be established.
Field Summary | |
---|---|
protected static String |
closeTag
|
protected BlockingQueue<JxtaBiDiPipe> |
connectionQueue
|
protected static String |
credTag
|
protected static String |
directSupportedTag
|
protected StructuredDocument |
myCredentialDoc
|
protected static String |
nameSpace
|
protected static String |
reliableTag
|
protected static String |
remPeerTag
|
protected static String |
remPipeTag
|
protected static String |
reqPipeTag
|
Constructor Summary | |
---|---|
JxtaServerPipe(PeerGroup group,
PipeAdvertisement pipeadv)
Default constructor for the JxtaServerPipe backlog default of 50 call to accept() for this ServerPipe will block for only this amount of time. |
|
JxtaServerPipe(PeerGroup group,
PipeAdvertisement pipeadv,
int backlog)
Constructor for the JxtaServerPipe object |
|
JxtaServerPipe(PeerGroup group,
PipeAdvertisement pipeadv,
int backlog,
int timeout)
Constructor for the JxtaServerPipe |
Method Summary | |
---|---|
JxtaBiDiPipe |
accept()
Listens for a connection to be made to this socket and accepts it. |
void |
bind(PeerGroup group,
PipeAdvertisement pipeadv)
Binds the JxtaServerPipe to a specific pipe advertisement |
void |
bind(PeerGroup group,
PipeAdvertisement pipeadv,
int backlog)
Binds the JxtaServerPipe to a specific pipe advertisement |
void |
close()
Closes this JxtaServerPipe (closes the underlying input pipe). |
protected void |
finalize()
Closes the JxtaServerPipe. |
StructuredDocument |
getCredentialDoc()
get the credential doc |
PeerGroup |
getGroup()
Gets the group associated with this JxtaServerPipe |
PipeAdvertisement |
getPipeAdv()
Gets the PipeAdvertisement associated with this JxtaServerPipe |
int |
getPipeTimeout()
Gets the Timeout attribute of the JxtaServerPipe |
boolean |
isBound()
Returns the binding state of the JxtaServerPipe. |
boolean |
isClosed()
Returns the closed state of the JxtaServerPipe. |
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. |
void |
pipeMsgEvent(PipeMsgEvent event)
Called for each pipe message event that occurs. |
protected void |
sendResponseMessage(PeerGroup group,
Messenger msgr,
PipeAdvertisement pipeAd)
Method sendResponseMessage get the createResponseMessage and sends it. |
void |
setCredentialDoc(StructuredDocument doc)
Sets the connection credential doc If no credentials are set, the default group credential will be used |
void |
setPipeTimeout(int timeout)
Sets the Timeout attribute of the JxtaServerPipe a timeout of 0 blocks forever. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String nameSpace
protected static final String credTag
protected static final String reqPipeTag
protected static final String remPeerTag
protected static final String remPipeTag
protected static final String closeTag
protected static final String reliableTag
protected static final String directSupportedTag
protected BlockingQueue<JxtaBiDiPipe> connectionQueue
protected StructuredDocument myCredentialDoc
Constructor Detail |
---|
public JxtaServerPipe(PeerGroup group, PipeAdvertisement pipeadv) throws IOException
call to accept() for this ServerPipe will block for only this amount of time. If the timeout expires, a java.net.SocketTimeoutException is raised, though the ServerPipe is still valid.
group
- JXTA PeerGrouppipeadv
- PipeAdvertisement on which pipe requests are accepted
IOException
- if an I/O error occurspublic JxtaServerPipe(PeerGroup group, PipeAdvertisement pipeadv, int backlog, int timeout) throws IOException
group
- JXTA PeerGrouppipeadv
- PipeAdvertisement on which pipe requests are acceptedbacklog
- the maximum length of the queue.timeout
- call to accept() for this ServerPipe will
block for only this amount of time. If the timeout expires,
a java.net.SocketTimeoutException is raised, though the ServerPipe is still valid.
IOException
- if an I/O error occurspublic JxtaServerPipe(PeerGroup group, PipeAdvertisement pipeadv, int backlog) throws IOException
group
- JXTA PeerGrouppipeadv
- PipeAdvertisement on which pipe requests are acceptedbacklog
- the maximum length of the queue.
* @exception IOException if an I/O error occurs
IOException
- if an I/O error occursMethod Detail |
---|
public void bind(PeerGroup group, PipeAdvertisement pipeadv) throws IOException
JxtaServerPipe
to a specific pipe advertisement
group
- JXTA PeerGrouppipeadv
- PipeAdvertisement on which pipe requests are accepted
IOException
- if an I/O error occurspublic void bind(PeerGroup group, PipeAdvertisement pipeadv, int backlog) throws IOException
JxtaServerPipe
to a specific pipe advertisement
group
- JXTA PeerGrouppipeadv
- PipeAdvertisement on which pipe requests are acceptedbacklog
- the maximum length of the queue.
IOException
- if an I/O error occurspublic JxtaBiDiPipe accept() throws IOException
IOException
- if an I/O error occurspublic PeerGroup getGroup()
public PipeAdvertisement getPipeAdv()
public void close() throws IOException
IOException
- if an I/O error occurspublic int getPipeTimeout() throws IOException
IOException
- if an I/O error occurspublic void setPipeTimeout(int timeout) throws SocketException
timeout
- The new soTimeout value
SocketException
- if an I/O error occurspublic boolean isClosed()
public boolean isBound()
public void pipeMsgEvent(PipeMsgEvent event)
pipeMsgEvent
in interface PipeMsgListener
event
- The event being received.protected void sendResponseMessage(PeerGroup group, Messenger msgr, PipeAdvertisement pipeAd) throws IOException
group
- the peer groupmsgr
- the remote node messengerpipeAd
- the pipe advertisement
IOException
- for failures sending the response message.protected static PipeAdvertisement newInputPipe(PeerGroup group, PipeAdvertisement pipeadv)
group
- the peer grouppipeadv
- to get the basename and type from
public StructuredDocument getCredentialDoc()
public void setCredentialDoc(StructuredDocument doc)
doc
- Credential StructuredDocumentprotected void finalize() throws Throwable
finalize
in class Object
Throwable
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |