📄 endpointserviceinterface.html
字号:
<DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/endpoint/EndpointService.html#getMessenger(net.jxta.endpoint.MessengerEventListener, net.jxta.endpoint.EndpointAddress, java.lang.Object)">getMessenger</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/endpoint/EndpointService.html" title="interface in net.jxta.endpoint">EndpointService</A></CODE></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="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> srcMsg, java.lang.String serviceName, java.lang.String 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><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/endpoint/EndpointService.html#propagate(net.jxta.endpoint.Message, java.lang.String, java.lang.String)">propagate</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/endpoint/EndpointService.html" title="interface in net.jxta.endpoint">EndpointService</A></CODE></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="addListener(java.lang.String, net.jxta.endpoint.EndpointListener)"><!-- --></A><H3>addListener</H3><PRE>public void <B>addListener</B>(java.lang.String address, <A HREF="../../../../net/jxta/endpoint/EndpointListener.html" title="interface in net.jxta.endpoint">EndpointListener</A> listener)</PRE><DL><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><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/endpoint/EndpointService.html#addListener(java.lang.String, net.jxta.endpoint.EndpointListener)">addListener</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/endpoint/EndpointService.html" title="interface in net.jxta.endpoint">EndpointService</A></CODE></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 address, <A HREF="../../../../net/jxta/endpoint/EndpointListener.html" title="interface in net.jxta.endpoint">EndpointListener</A> listener)</PRE><DL><DD>Removes the given listener previously registered under the given address.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/endpoint/EndpointService.html#removeListener(java.lang.String, net.jxta.endpoint.EndpointListener)">removeListener</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/endpoint/EndpointService.html" title="interface in net.jxta.endpoint">EndpointService</A></CODE></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="addFilterListener(java.lang.String, net.jxta.endpoint.EndpointFilterListener, boolean)"><!-- --></A><H3>addFilterListener</H3><PRE>public void <B>addFilterListener</B>(java.lang.String elementName, <A HREF="../../../../net/jxta/endpoint/EndpointFilterListener.html" title="interface in net.jxta.endpoint">EndpointFilterListener</A> listener, boolean incoming) throws java.lang.IllegalArgumentException</PRE><DL><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><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/endpoint/EndpointService.html#addFilterListener(java.lang.String, net.jxta.endpoint.EndpointFilterListener, boolean)">addFilterListener</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/endpoint/EndpointService.html" title="interface in net.jxta.endpoint">EndpointService</A></CODE></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 elementName, <A HREF="../../../../net/jxta/endpoint/EndpointFilterListener.html" title="interface in net.jxta.endpoint">EndpointFilterListener</A> listener, boolean incoming)</PRE><DL><DD>Removes the given listener previously registered under the given element name<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/endpoint/EndpointService.html#removeFilterListener(java.lang.String, net.jxta.endpoint.EndpointFilterListener, boolean)">removeFilterListener</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/endpoint/EndpointService.html" title="interface in net.jxta.endpoint">EndpointService</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>elementName</CODE> - the address the listener was registered for<DD><CODE>listener</CODE> - the listener that was registered<DD><CODE>incoming</CODE> - whether it was registered for incoming or outgoing messages.</DL></DD></DL><HR><A NAME="demux(net.jxta.endpoint.Message)"><!-- --></A><H3>demux</H3><PRE>public void <B>demux</B>(<A HREF="../../../../net/jxta/endpoint/Message.html" title="class in net.jxta.endpoint">Message</A> msg)</PRE><DL><DD>Delivers the provided message to the correct listener as specified by the message's destination address.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/endpoint/EndpointService.html#demux(net.jxta.endpoint.Message)">demux</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/endpoint/EndpointService.html" title="interface in net.jxta.endpoint">EndpointService</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>msg</CODE> - The message to be delivered.</DL></DD></DL><HR><A NAME="processIncomingMessage(net.jxta.endpoint.Message, net.jxta.endpoint.EndpointAddress, net.jxta.endpoint.EndpointAddress)"><!-- --></A><H3>processIncomingMessage</H3><PRE>public void <B>processIncomingMessage</B>(<A HREF="../../../../net/jxta/endpoint/Message.html" title="class in net.jxta.endpoint">Message</A> message, <A HREF="../../../../net/jxta/endpoint/EndpointAddress.html" title="class in net.jxta.endpoint">EndpointAddress</A> source, <A HREF="../../../../net/jxta/endpoint/EndpointAddress.html" title="class in net.jxta.endpoint">EndpointAddress</A> destination)</PRE><DL><DD>This method is invoked by the EndpointService for each incoming message which is addressed to this listener.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/endpoint/EndpointListener.html#processIncomingMessage(net.jxta.endpoint.Message, net.jxta.endpoint.EndpointAddress, net.jxta.endpoint.EndpointAddress)">processIncomingMessage</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/endpoint/EndpointListener.html" title="interface in net.jxta.endpoint">EndpointListener</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>message</CODE> - Incoming message<DD><CODE>source</CODE> - Endpoint Address of the source of the message<DD><CODE>destination</CODE> - Endpoint Address of the destination of the message</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> 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><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/endpoint/EndpointService.html#ping(net.jxta.endpoint.EndpointAddress)">ping</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/endpoint/EndpointService.html" title="interface in net.jxta.endpoint">EndpointService</A></CODE></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="addMessageTransport(net.jxta.endpoint.MessageTransport)"><!-- --></A><H3>addMessageTransport</H3><PRE>public boolean <B>addMessageTransport</B>(<A HREF="../../../../net/jxta/endpoint/MessageTransport.html" title="interface in net.jxta.endpoint">MessageTransport</A> transpt)</PRE><DL><DD>Adds the specified MessageTransport to this endpoint. A MessageTransport may only be added if there are no other equivalent MessageTransports available (as determined by <CODE>equals()</CODE>). <p/>The MessageTransport becomes usable by the endpoint service to send unicast messages and optionaly propagation and ping messages if it is a <A HREF="../../../../net/jxta/endpoint/MessageSender.html" title="interface in net.jxta.endpoint"><CODE>MessageSender</CODE></A>. The endpoint service becomes usable by this MessageTransport to handle incoming messages if it is a <A HREF="../../../../net/jxta/endpoint/MessageReceiver.html" title="interface in net.jxta.endpoint"><CODE>MessageReceiver</CODE></A>.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/endpoint/EndpointService.html#addMessageTransport(net.jxta.endpoint.MessageTransport)">addMessageTransport</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/endpoint/EndpointService.html" title="interface in net.jxta.endpoint">EndpointService</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>transpt</CODE> - the MessageTransport to be installed.<DT><B>Returns:</B><DD>true if the MessageTransport was installed otherwise false.</DL></DD></DL><HR><A NAME="removeMessageTransport(net.jxta.endpoint.MessageTransport)"><!-- --></A><H3>removeMessageTransport</H3><PRE>public boolean <B>removeMessageTransport</B>(<A HREF="../../../../net/jxta/endpoint/MessageTransport.html" title="interface in net.jxta.en
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -