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. The Jxta platform is initializing applications via the init method.

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. The initial root peer group is the NetPeerGroup.

Each peer group defines a default application that is started as part the peer group initialization process. The Default application can be a the JXTA Shell if interactive access to the peer group is given or any other JXTA Applications.

Since:
JXTA 1.0
See Also:
PeerGroup, PeerGroupAdvertisement

Method Summary
 void init(PeerGroup group, Advertisement adv)
          Initialize the application passing it ist peer group handle.
 int startApp(java.lang.String[] arg)
          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 ist peer group handle.
Parameters:
group - PeerGroup this application is started from
Throws:
PeerGroupException - failure to initialize the peer group application
Since:
JXTA 1.0

startApp

public int startApp(java.lang.String[] arg)
Some applications will wait for start() being called, before proceeding beyond a certain point. That's also the opportunity to supply arguments as a convenience, init may take an extra argument to instruct an application to start anyway (with null args).
Returns:
int status indication.

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