Project JXTA

net.jxta.protocol
Class ModuleImplAdvertisement

java.lang.Object
  |
  +--net.jxta.document.Advertisement
        |
        +--net.jxta.protocol.ModuleImplAdvertisement
All Implemented Interfaces:
java.lang.Cloneable

public abstract class ModuleImplAdvertisement
extends Advertisement
implements java.lang.Cloneable

A ModuleImplAdvertisement represents one of any number of published implementation of a given specification. It is meant to be published via JXTA discovery. Module specifications are referenced by their ModuleSpecID. Given a ModuleSpecID, a ModuleImplAdvertisement may be searched by means of JXTA Discovery, filtered according to the compatibility statement it contains, and if compatible, loaded and initialized. The loadModule method of a PeerGroup implementation performs this task automaticaly, given a ModuleSpecID. One significant example of Modules referenced and loaded in that manner are the services and protocols that constitute a StdPeerGroup in the java reference implementation.

See Also:
ID, ModuleSpecID, Advertisement, StructuredDocument, Element, ModuleSpecAdvertisement, PeerGroup

Field Summary
protected  StructuredDocument compat
           
protected  StructuredDocument param
           
 
Constructor Summary
ModuleImplAdvertisement()
           
 
Method Summary
 java.lang.Object clone()
          Clone this ModuleImplAdvertisement
static java.lang.String getAdvertisementType()
          returns the advertisement type
 java.lang.String getCode()
          returns the code; a reference to or representation of the executable code advertised by this advertisement.
 StructuredDocument getCompat()
          returns the module impl.
 java.lang.String getDescription()
          returns the description
 ID getID()
          Returns the unique ID of that advertisement for indexation purposes.
 ModuleSpecID getModuleSpecID()
          Returns the id of the spec that this implements.
 StructuredDocument getParam()
          returns the param element.
 java.lang.String getProvider()
          returns the provider
 java.lang.String getUri()
          returns the uri; that is a reference to or representation of a package from which the executable code referenced by the getCode method may be loaded.
 void setCode(java.lang.String code)
          sets the code
 void setCompat(Element compat)
          sets the module impl.
 void setDescription(java.lang.String description)
          sets the description
 void setModuleSpecID(ModuleSpecID sid)
          Sets the id of the spec that is implemented
 void setParam(Element param)
          sets the module param
 void setProvider(java.lang.String provider)
          sets the provider
 void setUri(java.lang.String uri)
          sets the uri
 
Methods inherited from class net.jxta.document.Advertisement
getDocument
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

compat

protected StructuredDocument compat

param

protected StructuredDocument param
Constructor Detail

ModuleImplAdvertisement

public ModuleImplAdvertisement()
Method Detail

getAdvertisementType

public static java.lang.String getAdvertisementType()
returns the advertisement type
Returns:
string type
Since:
JXTA 1.0

clone

public java.lang.Object clone()
Clone this ModuleImplAdvertisement
Overrides:
clone in class Advertisement
Returns:
Object an object of class ModuleImplAdvertisement that is a deep-enough copy of this one.
Since:
JXTA 1.0

getID

public ID getID()
Returns the unique ID of that advertisement for indexation purposes. In that case we do not have any particular one to offer. Let the indexer hash the document.
Overrides:
getID in class Advertisement
Returns:
ID the unique id
Since:
JXTA 1.0

getModuleSpecID

public ModuleSpecID getModuleSpecID()
Returns the id of the spec that this implements.
Returns:
ID the spec id
Since:
JXTA 1.0

setModuleSpecID

public void setModuleSpecID(ModuleSpecID sid)
Sets the id of the spec that is implemented
Parameters:
sid - The id of the spec
Since:
JXTA 1.0

getCompat

public StructuredDocument getCompat()
returns the module impl. compatibility statement.
Returns:
StructuredDocument the statement as a StructuredDocument of unspecified content.
Since:
JXTA 1.0

setCompat

public void setCompat(Element compat)
sets the module impl. compatibility statement.
Parameters:
compat - Element of an unspecified content.
Since:
JXTA 1.0

getCode

public java.lang.String getCode()
returns the code; a reference to or representation of the executable code advertised by this advertisement. What the code realy is depends on the compatibility statement. Any compatible user of this impl. adv. knows what it means. The standard group implementations of the java reference implementation expect it to be a fully qualified java class name.
Returns:
String the code
Since:
JXTA 1.0

setCode

public void setCode(java.lang.String code)
sets the code
Parameters:
code - reference to the code
Since:
JXTA 1.0

getUri

public java.lang.String getUri()
returns the uri; that is a reference to or representation of a package from which the executable code referenced by the getCode method may be loaded. What the uri realy is depends on the compatibility statement. Any compatible user of this impl. adv. knows what it means. The standard group implementations of the java reference implementation expect it to be a reference to a jar file.
Returns:
String uri
Since:
JXTA 1.0

setUri

public void setUri(java.lang.String uri)
sets the uri
Parameters:
uri - string uri
Since:
JXTA 1.0

getProvider

public java.lang.String getProvider()
returns the provider
Returns:
String the provider
Since:
JXTA 1.0

setProvider

public void setProvider(java.lang.String provider)
sets the provider
Parameters:
provider - the provider
Since:
JXTA 1.0

getDescription

public java.lang.String getDescription()
returns the description
Returns:
String the description
Since:
JXTA 1.0

setDescription

public void setDescription(java.lang.String description)
sets the description
Parameters:
description - the description
Since:
JXTA 1.0

getParam

public StructuredDocument getParam()
returns the param element. The interpretation of the param element is entirely up to the code that this advertises. One valid use of it is to enable the code to be configured so that multiple specs or multiple implementations of one spec may use the same code.
Returns:
StructuredDocument A standalone structured document of unspecified content.
Since:
JXTA 1.0

setParam

public void setParam(Element param)
sets the module param
Parameters:
param - Element of an unspecified content.
Since:
JXTA 1.0

Project JXTA