|
Project JXTA | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.peergroup.GenericPeerGroup
net.jxta.impl.peergroup.StdPeerGroup
A subclass of GenericPeerGroup that makes a peer group out of independent plugin services listed in its impl advertisement.
Nested Class Summary |
Nested classes inherited from class net.jxta.peergroup.PeerGroup |
PeerGroup.GlobalRegistry |
Field Summary | |
(package private) static String |
compatKey1
|
(package private) static String |
compatKey2
|
(package private) static String |
compatVal1
|
(package private) static String |
compatVal2
|
(package private) Vector |
disabledModules
|
static StructuredTextDocument |
stdCompatStatement
|
static String |
stdProvider
|
static String |
stdUri
|
Fields inherited from class net.jxta.impl.peergroup.GenericPeerGroup |
configAdvertisement, configurator, parentGroup |
Fields inherited from interface net.jxta.platform.Module |
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_OK |
Constructor Summary | |
StdPeerGroup()
constructor |
Method Summary | |
boolean |
compatible(Element compat)
Evaluates if the given compatibility statement makes the module that bears it is lodable by this group. |
ModuleImplAdvertisement |
getAllPurposePeerGroupImplAdvertisement()
Returns the all purpose peer group implementation advertisement. |
Cm |
getCacheManager()
Returns the cache manager associated with this group. |
protected void |
initFirst(PeerGroup parent,
ID assignedID,
Advertisement impl)
Performs all initialization steps that need to be performed before any subclass initialization is performed. Classes that override this method should always call super.initFirst() before doing
any of their own work.
This method loads and initializes all modules
described in the given implementation advertisement. |
protected void |
initLast()
Perform all initialization steps that need to be performed after any subclass initialization is performed. Classes that override this method should always call super.initLast after doing any of their own work. |
static boolean |
isCompatible(Element compat)
Evaluates if the given compatibility statement makes the module that bears it is loadable by this group. |
protected void |
loadAllModules(Hashtable modules,
ModuleClassID thisClassOnly,
boolean privileged)
Builds a table of modules indexed by their class ID. |
protected ModuleImplAdvertisement |
mkImplAdvBuiltin(ModuleSpecID specID,
String code,
String descr)
An internal convenience method essentially for bootstrapping. |
int |
startApp(String[] arg)
The group does not care for start args, and does not come-up with args to pass to its main app. |
void |
stopApp()
Stops the group and all its services. PeerGroupInterface's stopApp() does nothing. Only a real reference to the group object permits to stop it without going through ref counting. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.jxta.peergroup.PeerGroup |
|
Field Detail |
public static final StructuredTextDocument stdCompatStatement
public static final String stdUri
public static final String stdProvider
static final String compatKey1
static final String compatKey2
static final String compatVal1
static final String compatVal2
Vector disabledModules
Constructor Detail |
public StdPeerGroup()
Method Detail |
protected ModuleImplAdvertisement mkImplAdvBuiltin(ModuleSpecID specID, String code, String descr)
public boolean compatible(Element compat)
compatible
in interface CompatibilityEquater
compatible
in class GenericPeerGroup
public static boolean isCompatible(Element compat)
protected void loadAllModules(Hashtable modules, ModuleClassID thisClassOnly, boolean privileged)
modules
- The modules to loadthisClassOnly
- load only the module specified from the mapprivileged
- if true then modules will get a real reference to
the group loading them, otherwise its an interface object.public int startApp(String[] arg)
startApp
in interface Module
startApp
in class GenericPeerGroup
public void stopApp()
stopApp
in interface Module
stopApp
in class GenericPeerGroup
protected void initFirst(PeerGroup parent, ID assignedID, Advertisement impl) throws PeerGroupException
super.initFirst()
before doing
any of their own work.
This method loads and initializes all modules
described in the given implementation advertisement. Then, all modules
are placed in a list and the list is processed iteratively. During each
iteration, the Module.startApp(String[])
method of each module
is invoked once. Iterations continue until no progress is being made or
the list is empty.
The status returned by the Module.startApp(String[])
method
of each module is considered as follows:
Module.START_OK
: The module is removed from the list of
modules to be started and its Module.startApp(String[])
method will not be invoked again.
Module.START_AGAIN_PROGRESS
: The module remains in the
list of modules to be started and its Module.startApp(String[])
method will be invoked during the next iteration, if there is one. Module.START_AGAIN_STALLED
: The module remains in the list
of modules to be started and its Module.startApp(String[])
method will be invoked during the next iteration if there is one. Module.startApp(String[])
method will not be invoked again.Module.START_AGAIN_STALLED
: a PeerGroupException
is thrown.Module.START_OK
: a PeerGroupException
is thrown. The number of complete iterations before that happens is
computed as 1 + the square of the number of modules currently in the
list.
initFirst
in class GenericPeerGroup
parent
- The group that serves as a parent to this group.assignedID
- The unique ID assigned to this module. For
group this is the group ID or null
if a group ID
has not yet been assigned. If null is passed, GenericPeerGroup
choses a new group ID.impl
- The ModuleImplAdvertisement which defines this
group's implementation.
PeerGroupException
protected void initLast() throws PeerGroupException
initLast
in class GenericPeerGroup
PeerGroupException
public ModuleImplAdvertisement getAllPurposePeerGroupImplAdvertisement() throws Exception
getAllPurposePeerGroupImplAdvertisement
in interface PeerGroup
getAllPurposePeerGroupImplAdvertisement
in class GenericPeerGroup
Exception
public Cm getCacheManager()
|
JXTA J2SE | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |