|
Project JXTA | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This interface defines a JXTA module. All JXTA services need to implement this interface. Endpoint protocols and applications need to implement that interface if they are to be loaed and started by a PeerGroup. Service and Application implements Module, PeerGroup implements service and ShellApp implements application, as a result both implement Module.
Jxta Modules are given their initialization parameters via the init() method rather than a non-default constructor.
Modules are passed the peer group within which they are created. From the peergroup object, Modules can acccess all the peer group services. The PeerGroup within which a PeerGroup runs is known as its parent. The initial root peer group is known as the World Peer Group and is implemented by an object of class Platform, a subclass of PeerGroup. The "parent" PeerGroup of the World Peer Group is null.
ModuleImplAdvertisement,
ModuleClassID,
PeerGroup,
Application,
Service,
Advertisement,
ID| Method Summary | |
void |
init(PeerGroup group,
ID assignedID,
Advertisement implAdv)
Initialize the module, passing it its peer group and advertisement. |
int |
startApp(java.lang.String[] args)
Some Modules will wait for start() being called, before proceeding beyond a certain point. |
void |
stopApp()
One can ask a Module to stop. |
| Method Detail |
public void init(PeerGroup group,
ID assignedID,
Advertisement implAdv)
throws PeerGroupException
group - The PeerGroup from which this Module can obtain services.
If this module is a service, this is also the PeerGroup of which this
module is a service.assignedID - Identity of Module within group.
modules can use it as a the root of their namespace to create
names that are unique within the group but predictible by the
same module on another peer. This is normaly the ModuleClassID
which is also the name under which the module is known by other
modules. For a group it is the PeerGroupID itself.
The parameters of a service, in the Peer configuration, are indexed
by the assignedID of that service, and a Service must publish its
run-time parameters in the Peer Advertisement under its assigned ID.implAdv - The implementation advertisement for this Module.PeerGroupException - This module failed to initialize.public int startApp(java.lang.String[] args)
args - An array of Strings forming the parameters for this
Module.public void stopApp()
|
Project JXTA | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||