📄 endpointrouter.html
字号:
their documentation should mention it.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../net/jxta/exception/PeerGroupException.html" title="class in net.jxta.exception">PeerGroupException</A></CODE> - This module failed to initialize.</DL></DD></DL><HR><A NAME="startApp(java.lang.String[])"><!-- --></A><H3>startApp</H3><PRE>public int <B>startApp</B>(java.lang.String[] arg)</PRE><DL><DD>Some Modules will wait for this method being invoked, before completing their initializatino to the point that they are fully functional. That is also the opportunity to supply arbitrary arguments (mostly to applications). <p/>If this module is a <A HREF="../../../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup"><CODE>PeerGroup</CODE></A> service, it may be invoked several times depending on its return value. <p/>Note: the name of this method is historical and no-longer adequate.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../net/jxta/platform/Module.html#startApp(java.lang.String[])">startApp</A></CODE> in interface <CODE><A HREF="../../../../../net/jxta/platform/Module.html" title="interface in net.jxta.platform">Module</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>arg</CODE> - An array of Strings forming the parameters for this Module.<DT><B>Returns:</B><DD>int A status indication which may be one of <A HREF="../../../../../net/jxta/platform/Module.html#START_OK"><CODE>Module.START_OK</CODE></A>, <A HREF="../../../../../net/jxta/platform/Module.html#START_AGAIN_PROGRESS"><CODE>Module.START_AGAIN_PROGRESS</CODE></A>, <A HREF="../../../../../net/jxta/platform/Module.html#START_AGAIN_STALLED"><CODE>Module.START_AGAIN_STALLED</CODE></A>, which indicates partial or complete success, or any other value (negative values are recommended for future compatibility), which indicates failure.</DL></DD></DL><HR><A NAME="stopApp()"><!-- --></A><H3>stopApp</H3><PRE>public void <B>stopApp</B>()</PRE><DL><DD>One can ask a Module to stop. The Module cannot be forced to comply, but in the future we might be able to deny it access to anything after some timeout. <p/>Note: the name of this method is no-longer adequate. <p/>Careful that stopApp() could in theory be called before startApp().<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../net/jxta/platform/Module.html#stopApp()">stopApp</A></CODE> in interface <CODE><A HREF="../../../../../net/jxta/platform/Module.html" title="interface in net.jxta.platform">Module</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="isConnectionOriented()"><!-- --></A><H3>isConnectionOriented</H3><PRE>public boolean <B>isConnectionOriented</B>()</PRE><DL><DD>Returns true if the endpoint protocol can establish connection to the remote host (like TCP).<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../net/jxta/endpoint/MessageSender.html#isConnectionOriented()">isConnectionOriented</A></CODE> in interface <CODE><A HREF="../../../../../net/jxta/endpoint/MessageSender.html" title="interface in net.jxta.endpoint">MessageSender</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>boolean true if the protocol is connection oriented.</DL></DD></DL><HR><A NAME="allowsRouting()"><!-- --></A><H3>allowsRouting</H3><PRE>public boolean <B>allowsRouting</B>()</PRE><DL><DD>Returns true if the endpoint protocol can be used by the EndpointRouter. <p/>More specifically, this protocol will be used to route messages who's final destination is <b>not</b> one of the endpoint addresses available from getReachableEndpointAddresses.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../net/jxta/endpoint/MessageSender.html#allowsRouting()">allowsRouting</A></CODE> in interface <CODE><A HREF="../../../../../net/jxta/endpoint/MessageSender.html" title="interface in net.jxta.endpoint">MessageSender</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>boolean true if the protocol can be used by the EndpointRouter</DL></DD></DL><HR><A NAME="getEndpointService()"><!-- --></A><H3>getEndpointService</H3><PRE>public <A HREF="../../../../../net/jxta/endpoint/EndpointService.html" title="interface in net.jxta.endpoint">EndpointService</A> <B>getEndpointService</B>()</PRE><DL><DD>Returns the endpoint service with which this MessageTransport is registered. If it is unregistered then null will be returned.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../net/jxta/endpoint/MessageTransport.html#getEndpointService()">getEndpointService</A></CODE> in interface <CODE><A HREF="../../../../../net/jxta/endpoint/MessageTransport.html" title="interface in net.jxta.endpoint">MessageTransport</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the EndpointService with which this MessageTransport is registered.</DL></DD></DL><HR><A NAME="getPublicAddress()"><!-- --></A><H3>getPublicAddress</H3><PRE>public <A HREF="../../../../../net/jxta/endpoint/EndpointAddress.html" title="class in net.jxta.endpoint">EndpointAddress</A> <B>getPublicAddress</B>()</PRE><DL><DD>Returns the <A HREF="../../../../../net/jxta/endpoint/EndpointAddress.html" title="class in net.jxta.endpoint"><CODE>EndpointAddress</CODE></A> which will be used as the source address for all messages sent by this message sender. This is the "prefered" address to which replies may be sent. This address is not necessarily the best or only address by which the peer may be reached.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../net/jxta/endpoint/MessageSender.html#getPublicAddress()">getPublicAddress</A></CODE> in interface <CODE><A HREF="../../../../../net/jxta/endpoint/MessageSender.html" title="interface in net.jxta.endpoint">MessageSender</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>an EndpointAddress containing the public address for this message receiver.</DL></DD></DL><HR><A NAME="getPublicAddresses()"><!-- --></A><H3>getPublicAddresses</H3><PRE>public java.util.Iterator <B>getPublicAddresses</B>()</PRE><DL><DD>Returns an Iterator of all of the <A HREF="../../../../../net/jxta/endpoint/EndpointAddress.html" title="class in net.jxta.endpoint"><CODE>EndpointAddresses</CODE></A> by which this MessageReceiver is reachable. The list is in order of "preference" with the most "prefered" EndpointAddress being at the begining of the list.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../net/jxta/endpoint/MessageReceiver.html#getPublicAddresses()">getPublicAddresses</A></CODE> in interface <CODE><A HREF="../../../../../net/jxta/endpoint/MessageReceiver.html" title="interface in net.jxta.endpoint">MessageReceiver</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>an Iterator of EndpointAddresses.</DL></DD></DL><HR><A NAME="getProtocolName()"><!-- --></A><H3>getProtocolName</H3><PRE>public java.lang.String <B>getProtocolName</B>()</PRE><DL><DD>Returns a String containing the name of the protocol used by this MessageTransport. The value will match the "protocol" portion of all <A HREF="../../../../../net/jxta/endpoint/EndpointAddress.html" title="class in net.jxta.endpoint"><CODE>EndpointAddress</CODE></A>.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../net/jxta/endpoint/MessageTransport.html#getProtocolName()">getProtocolName</A></CODE> in interface <CODE><A HREF="../../../../../net/jxta/endpoint/MessageTransport.html" title="interface in net.jxta.endpoint">MessageTransport</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a String containing the name of the protocol used by this EndpointProtocol</DL></DD></DL><HR><A NAME="propagate(net.jxta.endpoint.Message, java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>propagate</H3><PRE>public void <B>propagate</B>(<A HREF="../../../../../net/jxta/endpoint/Message.html" title="class in net.jxta.endpoint">Message</A> srcMsg, java.lang.String pName, java.lang.String pParam, java.lang.String prunePeer) throws java.io.IOException</PRE><DL><DD>Propagates a Message on this EndpointProtocol.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../net/jxta/endpoint/MessageSender.html#propagate(net.jxta.endpoint.Message, java.lang.String, java.lang.String, java.lang.String)">propagate</A></CODE> in interface <CODE><A HREF="../../../../../net/jxta/endpoint/MessageSender.html" title="interface in net.jxta.endpoint">MessageSender</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>srcMsg</CODE> - the Message to be propagated<DD><CODE>pName</CODE> - Contains the name of the destination service, if any. This will be integrated into the destination address.<DD><CODE>pParam</CODE> - Contains the parameters associated with the service, if any. This will be integrated into the destination address.<DD><CODE>prunePeer</CODE> - a peer which should not receive the propagated message or null for all peers. This is sometimes used in flooding type algorithms to avoid sending to the peer that this received the message from. WARNING: The message object should not be reused or modified after the call is made. Concurrent modifications will produce unexpected result.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - is thrown when the message could not be propagated.</DL></DD></DL><HR><A NAME="getGatewayAddress(net.jxta.endpoint.EndpointAddress, boolean)"><!-- --></A><H3>getGatewayAddress</H3><PRE><A HREF="../../../../../net/jxta/endpoint/EndpointAddress.html" title="class in net.jxta.endpoint">EndpointAddress</A> <B>getGatewayAddress</B>(<A HREF="../../../../../net/jxta/endpoint/EndpointAddress.html" title="class in net.jxta.endpoint">EndpointAddress</A> dest, boolean seekRoute)</PRE><DL><DD>Given a peer id, return an address to reach that peer. The address may be for a directly reachable peer, or for the first gateway along a route to reach the peer. If we do not have a route to the peer, we will use the Peer Routing Protocol to try to discover one. We will wait up to 30 seconds for a route to be discovered.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>dest</CODE> - the peer we are trying to reach.<DD><CODE>seekRoute</CODE> - whether to go as far as issuing a route query, or just fish in our cache. when forwarding a message we allow ourselves to mend a broken source-issued route but we won't go as far as seeking one from other peers. When originating a message, on the other end we will aggressively try to find route.<DT><B>Returns:</B><DD>an EndpointAddress at which that peer should be reachable.</DL></DD></DL><HR><A NAME="getGatewayAddress(net.jxta.endpoint.EndpointAddress, boolean, java.lang.Object)"><!-- --></A><H3>getGatewayAddress</H3><PRE><A HREF="../../../../../net/jxta/endpoint/EndpointAddress.html" title="class in net.jxta.endpoint">EndpointAddress</A> <B>getGatewayAddress</B>(<A HREF="../../../../../net/jxta/endpoint/E
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -