⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 endpointservice.html

📁 jxta的api库
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<DT><B>Parameters:</B><DD><CODE>addr</CODE> - the destination address.<DD><CODE>hint</CODE> - A hint to be supplied to whichever transport ends-up making the the real messenger. The hint is interpreted by the transport. The only transport known to consider hint is the endpoint router, and the hint is a route. As a result, if addr is in the form: jxta://peerID, then hint may be a RouteAdvertisement. If that route is valid the router will add it to it's cache of route and may then use it to succesfully create a messenger to the given destination. There is no garantee at this time that the route will end up being the one specified, nor that this route will be used only for this messenger (likely the opposite), nor that it will remain in use in the future, nor that it will be used at all. However, if there is no other route, and if the specified route is valid, it will be used rather than seeking an alternative.<DT><B>Returns:</B><DD>The messenger. null is returned if the destination address is not reachable.<DT><B>See Also:</B><DD><A HREF="../../../net/jxta/endpoint/EndpointAddress.html" title="class in net.jxta.endpoint"><CODE>EndpointAddress</CODE></A></DL></DD></DL><HR><A NAME="getMessenger(net.jxta.endpoint.MessengerEventListener, net.jxta.endpoint.EndpointAddress, java.lang.Object)"><!-- --></A><H3>getMessenger</H3><PRE>public boolean <B>getMessenger</B>(<A HREF="../../../net/jxta/endpoint/MessengerEventListener.html" title="interface in net.jxta.endpoint">MessengerEventListener</A>&nbsp;listener,                            <A HREF="../../../net/jxta/endpoint/EndpointAddress.html" title="class in net.jxta.endpoint">EndpointAddress</A>&nbsp;addr,                            java.lang.Object&nbsp;hint)</PRE><DL><DD>Asynchronously acquire a messenger for the specified address. The  listener will be called when the messenger has been constructed.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - the listener to call when the messenger is ready.<DD><CODE>addr</CODE> - the destination for the messenger.<DD><CODE>hint</CODE> - the messenger hint, if any, otherwise null.<DT><B>Returns:</B><DD>boolean true if the messenger is queued for construction otherwise false.</DL></DD></DL><HR><A NAME="removeMessengerEventListener(net.jxta.endpoint.MessengerEventListener, int)"><!-- --></A><H3>removeMessengerEventListener</H3><PRE>public boolean <B>removeMessengerEventListener</B>(<A HREF="../../../net/jxta/endpoint/MessengerEventListener.html" title="interface in net.jxta.endpoint">MessengerEventListener</A>&nbsp;listener,                                            int&nbsp;priority)</PRE><DL><DD>Removes the specified listener.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - The listener that would have been called.<DD><CODE>priority</CODE> - Priority set from which to remove this listener.<DT><B>Returns:</B><DD>true if the listener was removed, otherwise false.</DL></DD></DL><HR><A NAME="addMessengerEventListener(net.jxta.endpoint.MessengerEventListener, int)"><!-- --></A><H3>addMessengerEventListener</H3><PRE>public boolean <B>addMessengerEventListener</B>(<A HREF="../../../net/jxta/endpoint/MessengerEventListener.html" title="interface in net.jxta.endpoint">MessengerEventListener</A>&nbsp;listener,                                         int&nbsp;priority)</PRE><DL><DD>Adds the specified listener for all messenger creation.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - The listener that will be called.<DD><CODE>priority</CODE> - Order of precedence requested (for 0 to 2). 2 has highest precedence  Listeners are called in decreasing order of precedence. Listeners with equal precedence are  called in unpredictible order relative to each other. A given listener object cannot exist more than once  for a given precedence. Redundant calls have no effect.<DT><B>Returns:</B><DD>true if the listener was added, otherwise false.</DL></DD></DL><HR><A NAME="propagate(net.jxta.endpoint.Message, 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>&nbsp;srcMsg,                      java.lang.String&nbsp;serviceName,                      java.lang.String&nbsp;serviceParam)               throws java.io.IOException</PRE><DL><DD>Propagates the given message through all the endpoint protocols that are available to this endpoint. Some or all of these endpoint protocols may silently drop the message. Each endpoint protocol may interpret the resquest for propagation differenly. The endpointService does not define which destinations the message will actually reach. WARNING: The message object should not be reused or modified after the call is made. Concurrent modifications will produce unexpected result. The concatenation of the serviceName and serviceParam arguments uniquely designates the listener to which the message must be delivered on arrival.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>srcMsg</CODE> - the message to be propagated.<DD><CODE>serviceName</CODE> - a destination service name<DD><CODE>serviceParam</CODE> - a destination queue name within that service<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if the message could not be propagated</DL></DD></DL><HR><A NAME="ping(net.jxta.endpoint.EndpointAddress)"><!-- --></A><H3>ping</H3><PRE>public boolean <B>ping</B>(<A HREF="../../../net/jxta/endpoint/EndpointAddress.html" title="class in net.jxta.endpoint">EndpointAddress</A>&nbsp;addr)</PRE><DL><DD>Verifies that the given address can be reached. The verification is performed by the endpoint protocol designated by the given address, as returned by the getProtocolName() method of this address. <p/>The method, and accuracy of the verification depends upon each endpoint protocol.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>addr</CODE> - is the Endpoint Address to ping.<DT><B>Returns:</B><DD>boolean true if the address can be reached. False otherwise.</DL></DD></DL><HR><A NAME="addListener(java.lang.String, net.jxta.endpoint.EndpointListener)"><!-- --></A><H3>addListener</H3><PRE>public void <B>addListener</B>(java.lang.String&nbsp;address,                        <A HREF="../../../net/jxta/endpoint/EndpointListener.html" title="interface in net.jxta.endpoint">EndpointListener</A>&nbsp;listener)</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>Use <A HREF="../../../net/jxta/endpoint/EndpointService.html#addIncomingMessageListener(net.jxta.endpoint.EndpointListener, java.lang.String, java.lang.String)"><CODE>addIncomingMessageListener()</CODE></A> instead.</I><P><DD>Registers an incoming messages listener. <p/>Each incoming message addressed to the queue specified by the given address will be passed to the given listener. The address is usually formed by concatenating the the name of the invoking service and a parameter unique to that service accross all groups (the group ID is normally included for that purpose). <p/>For a message to match this address, it must have been sent through an EndpointMessenger obtained by providing an EndpointAddress constructed with matching serviceName and serviceParam (see newEndpointAddress and getMessenger), or by invoking propagate with matching serviceName and serviceParam. <p/>If a listener is already registered with the given address, an IllegalArgumentException is thrown.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>address</CODE> - a queue name, unique accross all groups on this peer,<DD><CODE>listener</CODE> - a listener for these messages.</DL></DD></DL><HR><A NAME="removeListener(java.lang.String, net.jxta.endpoint.EndpointListener)"><!-- --></A><H3>removeListener</H3><PRE>public boolean <B>removeListener</B>(java.lang.String&nbsp;address,                              <A HREF="../../../net/jxta/endpoint/EndpointListener.html" title="interface in net.jxta.endpoint">EndpointListener</A>&nbsp;listener)</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>Use <A HREF="../../../net/jxta/endpoint/EndpointService.html#removeIncomingMessageListener(java.lang.String, java.lang.String)"><CODE>removeIncomingMessageListener()</CODE></A> instead.</I><P><DD>Removes the given listener previously registered under the given address.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>address</CODE> - Endpoint Address associated to the listener.<DD><CODE>listener</CODE> - a listener to remove.<DT><B>Returns:</B><DD>boolean true is there was such a registration, false otherwise.</DL></DD></DL><HR><A NAME="addIncomingMessageListener(net.jxta.endpoint.EndpointListener, java.lang.String, java.lang.String)"><!-- --></A><H3>addIncomingMessageListener</H3><PRE>public boolean <B>addIncomingMessageListener</B>(<A HREF="../../../net/jxta/endpoint/EndpointListener.html" title="interface in net.jxta.endpoint">EndpointListener</A>&nbsp;listener,                                          java.lang.String&nbsp;serviceName,                                          java.lang.String&nbsp;serviceParam)</PRE><DL><DD>Add a listener for the specified address.  <p/>A single registered listener will be called for incoming messages  when (in order of preference) : <ol>  <li>The service name and service parameter match exactly to the  service name and service parameter specified in the destination  address of the message.</li>  <li>The service name matches exactly the service name from the message destination address and service parameter is null.</li> </ol><P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - the listener<DD><CODE>serviceName</CODE> - The name of the service destination which will be  matched against destination endpoint addresses.<DD><CODE>serviceParam</CODE> - String containting the  value of the service  parameter which will be matched against destination endpoint addresses.  May be null.<DT><B>Returns:</B><DD>true if the listener was registered, otherwise false.</DL></DD></DL><HR><A NAME="removeIncomingMessageListener(java.lang.String, java.lang.String)"><!-- --></A><H3>removeIncomingMessageListener</H3><PRE>public <A HREF="../../../net/jxta/endpoint/EndpointListener.html" title="interface in net.jxta.endpoint">EndpointListener</A> <B>removeIncomingMessageListener</B>(java.lang.String&nbsp;serviceName,                                                      java.lang.String&nbsp;serviceParam)</PRE><DL><DD>Remove the listener for the specified address.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>serviceName</CODE> - The name of the service destination which will be  matched against destination endpoint addresses.<DD><CODE>serviceParam</CODE> - String containting the  value of the service  parameter which will be matched against destination endpoint addresses.  May be null.<DT><B>Returns:</B><DD>The listener which was removed.</DL></DD></DL><HR><A NAME="addFilterListener(java.lang.String, net.jxta.endpoint.EndpointFilterListener, boolean)"><!-- --></A><H3>addFilterListener</H3><PRE>public void <B>addFilterListener</B>(java.lang.String&nbsp;elementName,                              <A HREF="../../../net/jxta/endpoint/EndpointFilterListener.html" title="interface in net.jxta.endpoint">EndpointFilterListener</A>&nbsp;listener,                              boolean&nbsp;incoming)                       throws java.lang.IllegalArgumentException</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>Use <A HREF="../../../net/jxta/endpoint/EndpointService.html#addIncomingMessageFilterListener(net.jxta.endpoint.MessageFilterListener, java.lang.String, java.lang.String)"><CODE>addIncomingMessageFilterListener()</CODE></A> or  <A HREF="../../../net/jxta/endpoint/EndpointService.html#addOutgoingMessageFilterListener(net.jxta.endpoint.MessageFilterListener, java.lang.String, java.lang.String)"><CODE>addOutgoingMessageFilterListener()</CODE></A> or  instead.</I><P><DD>Registers an incoming messages filter listener. <p/>Each incoming message which contains an element with the specified name will be passed to the given listener. <p/>If a listener is already registered with the given address, an IllegalArgumentException is thrown.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>elementName</CODE> - The name is either a qualified element name containing a namespace and an element name or a namespace alone. A colon is used to seperate the namespace and element name.<DD><CODE>listener</CODE> - a listener for these messages.<DD><CODE>incoming</CODE> - whether to run the filter on the incoming or                    outgoing messages.<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - is thrown when one of the argument is illegal.</DL></DD></DL><HR><A NAME="removeFilterListener(java.lang.String, net.jxta.endpoint.EndpointFilterListener, boolean)"><!-- --></A><H3>removeFilterListener</H3><PRE>public void <B>removeFilterListener</B>(java.lang.String&nbsp;elementName,                                 <A HREF="../../../net/jxta/endpoint/EndpointFilterListener.html" title="interface in net.jxta.endpoint">EndpointFilterListener</A>&nbsp;listener,                                 boolean&nbsp;incoming)</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>Use <A HREF="../../../net/jxta/endpoint/EndpointService.html#removeIncomingMessageFilterListener(net.jxta.endpoint.MessageFilterListener, java.lang.String, java.lang.String)"><CODE>removeIncomingMessageFilterListener(MessageFilterListener,String,String)</CODE></A> or <A HREF="../../../net/jxta/endpoint/EndpointService.html#removeOutgoingMessageFilterListener(net.jxta.endpoint.MessageFilterListener, java.lang.String, java.lang.String)"><CODE>removeOutgoingMessageFilterListener(MessageFilterListener,String,String)</CODE></A> instead.</I><P><DD>Removes the given listener previously registered under the given element name<P><DD><DL></DL>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -