|
Project JXTA | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
The EndpointService Service provides a frontend API and enviroment to all endpoint protocols. Applications can use the Endpoint API directely if they need to understand and control the topology of the JXTA network. In general, application are not expected to use this API.
| Method Summary | |
void |
addFilterListener(java.lang.String elementName,
EndpointFilterListener listener,
boolean incoming)
Registers an incoming messages filter listener. |
void |
addListener(java.lang.String address,
EndpointListener listener)
Registers an incoming messages listener. |
boolean |
addMessageTransport(MessageTransport transpt)
Adds the specified MessageTransport to this endpoint. |
void |
demux(NewMessage msg)
Handles the given incoming message by calling the listener specified by its destination as returned by the getDestAddress() method of the message. |
java.util.Iterator |
getAllMessageTransports()
Get an iterator of the MessageTransports available to this EndpointService. |
PeerGroup |
getGroup()
Returns the group to which this EndpointServiceImpl is attached. |
EndpointMessenger |
getMessenger(EndpointAddress addr)
Builds and returns an EndpointMessager that may be used to send messages via this endpoint to the given destination |
EndpointAddress |
newEndpointAddress(java.lang.String Uri)
Builds an EndpointAddress out the the given URI string. |
Message |
newMessage()
Returns a new Message object suitable for use with this endpoint service. |
boolean |
ping(EndpointAddress addr)
Verifies that the given address can be reached. |
void |
propagate(Message srcMsg,
java.lang.String serviceName,
java.lang.String serviceParam)
Propagates the given message through all the endpoint protocols that are available to this endpoint. |
void |
propagate(NewMessage srcMsg,
java.lang.String serviceName,
java.lang.String serviceParam)
Propagates the given message through all the endpoint protocols that are available to this endpoint. |
void |
removeFilterListener(java.lang.String address,
EndpointFilterListener listener,
boolean incoming)
Removes the given listener previously registered under the given element name |
boolean |
removeListener(java.lang.String address,
EndpointListener listener)
Removes the given listener previously registered under the given address. |
boolean |
removeMessageTransport(MessageTransport transpt)
Removes the given MessageTransport protocol from this endpoint service. |
| Methods inherited from interface net.jxta.service.Service |
getImplAdvertisement, getInterface |
| Methods inherited from interface net.jxta.platform.Module |
init, startApp, stopApp |
| Method Detail |
public PeerGroup getGroup()
public Message newMessage()
public EndpointAddress newEndpointAddress(java.lang.String Uri)
Uri - the uri. The structure of the Uri is as follows:
protocol://address/[serviceName][/serviceParam]
public EndpointMessenger getMessenger(EndpointAddress addr)
throws java.io.IOException
addr - the destination address. This address specifies an
endpoint protocol, the address of a peer by that endpoint protocol, and
a serviceName and serviceParam, the concatenation of which designates
uniquely the listener to which the messages must be delivered on arrival.java.io.IOException - is thrown if a network problem happened.EndpointAddress
public void propagate(Message srcMsg,
java.lang.String serviceName,
java.lang.String serviceParam)
throws java.io.IOException
srcMsg - the message to be propagated.serviceName - a destination service nameserviceParam - a destination queue name within that servicejava.io.IOException - if the message could not be propagated
public void propagate(NewMessage srcMsg,
java.lang.String serviceName,
java.lang.String serviceParam)
throws java.io.IOException
srcMsg - the message to be propagated.serviceName - a destination service nameserviceParam - a destination queue name within that servicejava.io.IOException - if the message could not be propagatedpublic boolean ping(EndpointAddress addr)
addr - is the Endpoint Address to ping.
public void addListener(java.lang.String address,
EndpointListener listener)
address - a queue name, unique accross all groups on this peer,listener - a listener for these messages.
public boolean removeListener(java.lang.String address,
EndpointListener listener)
address - Endpoint Address associated to the listener.listener - a listener to remove.
public void addFilterListener(java.lang.String elementName,
EndpointFilterListener listener,
boolean incoming)
throws java.lang.IllegalArgumentException
elementName - 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.listener - a listener for these messages.incoming - whether to run the filter on the incoming or
outgoing messages.java.lang.IllegalArgumentException - is thrown when one of the argument
is illegal.
public void removeFilterListener(java.lang.String address,
EndpointFilterListener listener,
boolean incoming)
address - the address the listener was registered forlistener - the listener that was registeredincoming - whether it was registered for incoming or outgoing
messages.
public void demux(NewMessage msg)
throws java.io.IOException
msg - The message to be delivered.java.io.IOException - when demux was not able to process the incoming message.public boolean addMessageTransport(MessageTransport transpt)
equals()).
The MessageTransport becomes usable by the endpoint service to send
unicast messages and optionaly propagation and ping messages if it is a
MessageSender. The endpoint service becomes usable by this
MessageTransport to handle incoming messages if it is a
MessageReceiver.transpt - the MessageTransport to be installed.return - true if the MessageTransport was installed otherwise false.public boolean removeMessageTransport(MessageTransport transpt)
stopApp() and allow it to
call this method.
When to stop a transport is not all that easy
to figure out, since the same MessageTransport object may be present in
several groups. conclusion: Don't do it if you don't know what you're
doing.transpt - the MessageTransport to be removed.public java.util.Iterator getAllMessageTransports()
|
Project JXTA | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||