Project JXTA

net.jxta.platform
Interface Application

All Known Subinterfaces:
Discovery, PeerGroup, PeerInfo, Pipe, RendezVous, Resolver, Service

public interface Application

This interface defines a JXTA peer group application. All JXTA applications need to implement this interface. Jxta Applications are given their initialization parameters via the init() method rather than a non-default constructor.

Applications are passed the peer group they are created within. From the peergroup object, applications can acccess all the peer group services. Each application will be passed the peergroup they are started in. PeerGroups themselves are subclasses of JXTA Applications, as well as Services. 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.

Each peer group defines a default application that is started as part the peer group initialization process, if the PeerGroup's startApp() method is invoked. The Default application is specified by the PeerGroup's advertisement and can be the JXTA Shell or any other JXTA Application, as specified by the group's advertisment.

Since:
JXTA 1.0
See Also:
PeerGroup, Service, PeerGroupAdvertisement

Method Summary
 void init(PeerGroup group, Advertisement adv)
          Initialize the application passing it its peer group and advertisement.
 int startApp(java.lang.String[] args)
          Some applications will wait for start() being called, before proceeding beyond a certain point.
 void stopApp()
          One can ask an application to stop.
 

Method Detail

init

public void init(PeerGroup group,
                 Advertisement adv)
          throws PeerGroupException
Initialize the application passing it its peer group and advertisement.
Parameters:
group - PeerGroup this application is started from
adv - The advertisement for this application
Throws:
PeerGroupException - failure to initialize this application.
Since:
JXTA 1.0

startApp

public int startApp(java.lang.String[] args)
Some applications will wait for start() being called, before proceeding beyond a certain point. That's also the opportunity to supply arguments.

stopApp

public void stopApp()
One can ask an application to stop. The application cannot be forced to comply, but in the future we might be able to deny it access to anything after some timeout.

Project JXTA