|
Project JXTA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.jxta.impl.endpoint.EndpointServiceImpl
public class EndpointServiceImpl
This class implements the frontend for all the JXTA endpoint protocols, as well as the API for the implementation of the core protocols that use directly the EndpointService. It theory it only needs to implement core methods. legacy or convenience methods should stay out. However, that would require a two-level interface for the service (internal and public). May be later.
| Field Summary | |
|---|---|
static MimeMediaType |
DEFAULT_MESSAGE_TYPE
|
static String |
ENDPOINTSERVICE_NAME
|
(package private) EndpointServiceMonitor |
endpointServiceMonitor
|
static String |
MESSAGE_DESTINATION_NAME
Element name in which the message destination address will be placed. |
static String |
MESSAGE_DESTINATION_NS
Namespace in which the message destination address will be placed. |
static String |
MESSAGE_EMPTY_NS
The Message empty namespace. |
static String |
MESSAGE_JXTA_NS
The Message "jxta" namespace. |
static String |
MESSAGE_SOURCE_NAME
Element name in which the message source address will be placed. |
static String |
MESSAGE_SOURCE_NS
Namespace in which the message source address will be placed. |
static String |
MESSAGE_SRCPEERHDR_NAME
Element name in which the message source peer address will be placed. |
static String |
MESSAGE_SRCPEERHDR_NS
Namespace in which the message source peer address will be placed. |
| Fields inherited from interface net.jxta.endpoint.EndpointService |
|---|
HighPrecedence, LowPrecedence, MediumPrecedence |
| Fields inherited from interface net.jxta.platform.Module |
|---|
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_OK |
| Constructor Summary | |
|---|---|
EndpointServiceImpl()
Create a new EndpointService. |
|
| Method Summary | |
|---|---|
void |
addIncomingMessageFilterListener(MessageFilterListener listener,
String namespace,
String name)
|
boolean |
addIncomingMessageListener(EndpointListener listener,
String serviceName,
String serviceParam)
|
MessengerEventListener |
addMessageTransport(MessageTransport transpt)
|
boolean |
addMessengerEventListener(MessengerEventListener listener,
int prio)
|
void |
addOutgoingMessageFilterListener(MessageFilterListener listener,
String namespace,
String name)
|
void |
demux(Message msg)
(Privileged. |
protected Iterator |
getAllLocalTransports()
Return only the message transport registered locally. |
Iterator |
getAllMessageTransports()
|
Messenger |
getCanonicalMessenger(EndpointAddress addr,
Object hint)
Note: canonical messenger itself does not do any address rewritting. |
PeerGroup |
getGroup()
Returns the group to which this EndpointServiceImpl is attached. |
Advertisement |
getImplAdvertisement()
Returns the advertisment for this service. |
Service |
getInterface()
Service objects are not manipulated directly to protect usage of the service. |
protected Messenger |
getLocalTransportMessenger(EndpointAddress addr,
Object hint)
Returns a messenger from one of the transports registered with this very endpoint service. |
MessageTransport |
getMessageTransport(String name)
|
Messenger |
getMessenger(EndpointAddress addr)
Deprecated. legacy method. |
Messenger |
getMessenger(EndpointAddress addr,
Object hint)
convenience method not supported here. |
boolean |
getMessenger(MessengerEventListener listener,
EndpointAddress addr,
Object hint)
Deprecated. legacy method. |
Messenger |
getMessengerImmediate(EndpointAddress addr,
Object hint)
convenience method not supported here. |
void |
init(PeerGroup group,
ID assignedID,
Advertisement impl)
Initialize the application passing it its peer group and advertisement. |
boolean |
messengerReady(MessengerEvent event)
A messenger from a transport is ready. |
boolean |
ping(EndpointAddress addr)
Deprecated. Try and get a messenger instead |
void |
processIncomingMessage(Message msg,
EndpointAddress srcAddress,
EndpointAddress dstAddress)
|
void |
propagate(Message srcMsg,
String serviceName,
String serviceParam)
|
MessageFilterListener |
removeIncomingMessageFilterListener(MessageFilterListener listener,
String namespace,
String name)
|
EndpointListener |
removeIncomingMessageListener(String serviceName,
String serviceParam)
|
boolean |
removeMessageTransport(MessageTransport transpt)
|
boolean |
removeMessengerEventListener(MessengerEventListener listener,
int prio)
|
MessageFilterListener |
removeOutgoingMessageFilterListener(MessageFilterListener listener,
String namespace,
String name)
|
int |
startApp(String[] args)
|
void |
stopApp()
The protocols and services are going to be stopped as well. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
EndpointServiceMonitor endpointServiceMonitor
public static final MimeMediaType DEFAULT_MESSAGE_TYPE
public static final String ENDPOINTSERVICE_NAME
public static final String MESSAGE_EMPTY_NS
public static final String MESSAGE_JXTA_NS
public static final String MESSAGE_SOURCE_NS
public static final String MESSAGE_SOURCE_NAME
public static final String MESSAGE_DESTINATION_NS
public static final String MESSAGE_DESTINATION_NAME
public static final String MESSAGE_SRCPEERHDR_NS
public static final String MESSAGE_SRCPEERHDR_NAME
| Constructor Detail |
|---|
public EndpointServiceImpl()
| Method Detail |
|---|
public void init(PeerGroup group,
ID assignedID,
Advertisement impl)
throws PeerGroupException
init in interface Modulegroup - PeerGroup this application is started fromassignedID - The ID which this instance should be known by.impl - The advertisement for this application
PeerGroupException - failure to initialize this application.public int startApp(String[] args)
startApp in interface Modulepublic void stopApp()
stopApp in interface Modulepublic PeerGroup getGroup()
getGroup in interface EndpointServicepublic Service getInterface()
getInterface in interface Servicepublic Advertisement getImplAdvertisement()
getImplAdvertisement in interface Service
public void propagate(Message srcMsg,
String serviceName,
String serviceParam)
throws IOException
propagate in interface EndpointServiceIOException
public void processIncomingMessage(Message msg,
EndpointAddress srcAddress,
EndpointAddress dstAddress)
processIncomingMessage in interface EndpointListenerpublic void demux(Message msg)
demux in interface EndpointServicemsg - The message to be delivered.public boolean ping(EndpointAddress addr)
ping in interface EndpointServicepublic MessengerEventListener addMessageTransport(MessageTransport transpt)
addMessageTransport in interface EndpointServicepublic boolean removeMessageTransport(MessageTransport transpt)
removeMessageTransport in interface EndpointServicepublic Iterator getAllMessageTransports()
getAllMessageTransports in interface EndpointServicepublic MessageTransport getMessageTransport(String name)
getMessageTransport in interface EndpointService
public boolean addMessengerEventListener(MessengerEventListener listener,
int prio)
addMessengerEventListener in interface EndpointService
public boolean removeMessengerEventListener(MessengerEventListener listener,
int prio)
removeMessengerEventListener in interface EndpointService
public boolean addIncomingMessageListener(EndpointListener listener,
String serviceName,
String serviceParam)
addIncomingMessageListener in interface EndpointService
public EndpointListener removeIncomingMessageListener(String serviceName,
String serviceParam)
removeIncomingMessageListener in interface EndpointService
public Messenger getCanonicalMessenger(EndpointAddress addr,
Object hint)
getCanonicalMessenger in interface EndpointServiceprotected Iterator getAllLocalTransports()
protected Messenger getLocalTransportMessenger(EndpointAddress addr,
Object hint)
public void addIncomingMessageFilterListener(MessageFilterListener listener,
String namespace,
String name)
addIncomingMessageFilterListener in interface EndpointService
public void addOutgoingMessageFilterListener(MessageFilterListener listener,
String namespace,
String name)
addOutgoingMessageFilterListener in interface EndpointService
public MessageFilterListener removeIncomingMessageFilterListener(MessageFilterListener listener,
String namespace,
String name)
removeIncomingMessageFilterListener in interface EndpointService
public MessageFilterListener removeOutgoingMessageFilterListener(MessageFilterListener listener,
String namespace,
String name)
removeOutgoingMessageFilterListener in interface EndpointServicepublic boolean messengerReady(MessengerEvent event)
messengerReady in interface MessengerEventListener
public boolean getMessenger(MessengerEventListener listener,
EndpointAddress addr,
Object hint)
getMessenger in interface EndpointServicepublic Messenger getMessenger(EndpointAddress addr)
getMessenger in interface EndpointService
public Messenger getMessengerImmediate(EndpointAddress addr,
Object hint)
getMessengerImmediate in interface EndpointService
public Messenger getMessenger(EndpointAddress addr,
Object hint)
getMessenger in interface EndpointService
|
JXTA J2SE | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||