Let’s look now at some JXTA advertisements. Advertisements are central to JXTA; you discover JXTA peers and their resources by looking for advertisements, and you provide your own services by publishing advertisements. Therefore, working with advertisements and the documents they contain is the next step we must take in learning how to develop JXTA applications.
Advertisements are represented by the
advertisement has a unique type, which is returned by the
getAdvertisementType( ) method. The JXTA API
defines the following core advertisement types (each of which is an
abstract class in the
advertisement object holds an object that implements the
net.jxta.document.Document) and represents the
advertisement. An advertisement is typically represented as an XML
document, and the JXTA protocol specification relies heavily on XML
getDocument( ) method of the
Advertisement class returns a representation of
the advertisement in different formats based on its
MimeMediaType argument. Typical MIME types are “text/xml” or “text/plain” (which, in fact, are the only ...