|
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
public abstract class GenericPeerGroup
Provides common services for most peer group implementations.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.jxta.peergroup.PeerGroup |
---|
PeerGroup.GlobalRegistry |
Field Summary | |
---|---|
protected PlatformConfig |
configAdvertisement
This peer's config advertisement. |
protected Configurator |
configurator
The configurator for this peer group. |
protected PeerGroup |
parentGroup
This service implements a group but, being a Service, it runs inside of some group. |
Fields inherited from interface net.jxta.platform.Module |
---|
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_OK |
Constructor Summary | |
---|---|
GenericPeerGroup()
|
Method Summary | |
---|---|
protected void |
addService(ID name,
Service service)
Adds a service to the set. |
protected void |
checkServices()
check that all required services are registered |
abstract boolean |
compatible(Element compat)
Evaluates if the given compatibility statement makes the module that bears it is lodable by this group. |
protected void |
decRefCount()
Called everytime an interface object that refers to this group goes away, either by being finalized or by its unref method being invoked explicitly. |
boolean |
equals(Object target)
|
AccessService |
getAccessService()
|
abstract ModuleImplAdvertisement |
getAllPurposePeerGroupImplAdvertisement()
|
ConfigParams |
getConfigAdvertisement()
|
DiscoveryService |
getDiscoveryService()
|
EndpointService |
getEndpointService()
|
ThreadGroup |
getHomeThreadGroup()
Returns the Thread Group in which threads for this peer group will live. |
Advertisement |
getImplAdvertisement()
|
Service |
getInterface()
|
static JxtaLoader |
getJxtaLoader()
Get a modified version of the Jxta ClassLoader |
JxtaLoader |
getLoader()
|
MembershipService |
getMembershipService()
|
PeerGroup |
getParentGroup()
Get this group's parent group. |
PeerAdvertisement |
getPeerAdvertisement()
|
PeerGroupAdvertisement |
getPeerGroupAdvertisement()
|
PeerGroupID |
getPeerGroupID()
|
String |
getPeerGroupName()
|
PeerID |
getPeerID()
|
PeerInfoService |
getPeerInfoService()
|
String |
getPeerName()
|
PipeService |
getPipeService()
|
RendezVousService |
getRendezVousService()
|
ResolverService |
getResolverService()
|
Iterator |
getRoleMap(ID name)
|
PeerGroup |
getWeakInterface()
|
int |
hashCode()
|
void |
init(PeerGroup homeGroup,
ID assignedID,
Advertisement impl)
It is not recommended to overload this method. |
protected void |
initFirst(PeerGroup homeGroup,
ID assignedID,
Advertisement impl)
Performs all initialization steps that need to be performed before any subclass initialization is performed. |
protected void |
initLast()
Perform all initialization steps that need to be performed after any subclass initialization is performed. |
boolean |
isRendezvous()
|
Module |
loadModule(ID assigned,
Advertisement impl)
Load a module from a ModuleImplAdv. |
protected Module |
loadModule(ID assigned,
Advertisement impl,
boolean privileged)
Internal version, allows one to make a privileged module (has a ref to the true group obj instead of just an interface. |
Module |
loadModule(ID assigned,
ModuleSpecID specID,
int where)
Load a module from a spec id. |
protected Module |
loadModule(ID assigned,
ModuleSpecID specID,
int where,
boolean privileged)
Load a module from a spec id. |
Service |
lookupService(ID name)
Call a service by name. |
Service |
lookupService(ID name,
int roleIndex)
Group implementations do not have to support mapping. |
PeerGroup |
newGroup(Advertisement pgAdv)
|
PeerGroup |
newGroup(PeerGroupID gid)
|
PeerGroup |
newGroup(PeerGroupID gid,
Advertisement impl,
String name,
String description)
|
void |
publishGroup(String name,
String description)
|
protected void |
removeService(ModuleClassID name,
Service service)
Ask a group to unregister and unload a service |
protected void |
setConfigAdvertisement(ConfigParams config)
|
static void |
setJxtaLoader(JxtaLoader newLoader)
Set a modified version of the Jxta ClassLoader |
int |
startApp(String[] arg)
Start the peergroup. |
void |
stopApp()
Stops the group and all its services. |
void |
unref()
May be called by a module which has a direct reference to the group object and wants to notify its abandoning it. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Configurator configurator
protected PlatformConfig configAdvertisement
protected PeerGroup parentGroup
Constructor Detail |
---|
public GenericPeerGroup()
Method Detail |
---|
public static JxtaLoader getJxtaLoader()
public static void setJxtaLoader(JxtaLoader newLoader)
public boolean equals(Object target)
equals
in class Object
public int hashCode()
hashCode
in class Object
public ThreadGroup getHomeThreadGroup()
getHomeThreadGroup
in interface PeerGroup
protected void addService(ID name, Service service)
public Service lookupService(ID name) throws ServiceNotFoundException
lookupService
in interface PeerGroup
name
- the service name
ServiceNotFoundException
public Service lookupService(ID name, int roleIndex) throws ServiceNotFoundException
lookupService
in interface PeerGroup
ServiceNotFoundException
public Iterator getRoleMap(ID name)
getRoleMap
in interface PeerGroup
protected void checkServices() throws ServiceNotFoundException
ServiceNotFoundException
protected void removeService(ModuleClassID name, Service service) throws ServiceNotFoundException, ViolationException
service
- handle to the service to be removed
ServiceNotFoundException
ViolationException
public abstract boolean compatible(Element compat)
compatible
in interface PeerGroup
public Module loadModule(ID assigned, Advertisement impl) throws ProtocolNotSupportedException, PeerGroupException
loadModule
in interface PeerGroup
ProtocolNotSupportedException
PeerGroupException
protected Module loadModule(ID assigned, Advertisement impl, boolean privileged) throws ProtocolNotSupportedException, PeerGroupException
ProtocolNotSupportedException
PeerGroupException
public Module loadModule(ID assigned, ModuleSpecID specID, int where)
loadModule
in interface PeerGroup
protected Module loadModule(ID assigned, ModuleSpecID specID, int where, boolean privileged)
public ConfigParams getConfigAdvertisement()
getConfigAdvertisement
in interface PeerGroup
protected void setConfigAdvertisement(ConfigParams config)
public void init(PeerGroup homeGroup, ID assignedID, Advertisement impl) throws PeerGroupException
initFirst(PeerGroup,ID,Advertisement)
and initLast()
.
If this method is to be overloaded, the overloading method must
invoke super.init
.
This method invokes initFirst
with identical parameters. initLast does not take
parameters since the relevant information can be obtained from the
group following completion of the initFirst
phase.
The resulting values may be different from the parameters to
initFirst
since initFirst
may
be overLoaded and the overloading method may modify these parameters
when calling super.initFirst
. (See
net.jxta.impl.Platform
for an example of such a case).
Upon completion, the group object is marked as completely initialized
in all cases. Once a group object is completely initialized, it becomes
sensitive to reference counting.
In the future this method may become final.
- Specified by:
init
in interface Module
- Throws:
PeerGroupException
protected void initFirst(PeerGroup homeGroup, ID assignedID, Advertisement impl) throws PeerGroupException
super.initFirst()
before doing
any of their own work.
homeGroup
- 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
PeerGroupException
public int startApp(String[] arg)
startApp
in interface Module
public void stopApp()
stopApp
in interface Module
public void unref()
unref
in interface PeerGroup
protected void decRefCount()
public Service getInterface()
getInterface
in interface Service
public PeerGroup getWeakInterface()
getWeakInterface
in interface PeerGroup
public Advertisement getImplAdvertisement()
getImplAdvertisement
in interface Service
public void publishGroup(String name, String description) throws IOException
publishGroup
in interface PeerGroup
IOException
public PeerGroup newGroup(Advertisement pgAdv) throws PeerGroupException
newGroup
in interface PeerGroup
PeerGroupException
public PeerGroup newGroup(PeerGroupID gid, Advertisement impl, String name, String description) throws PeerGroupException
newGroup
in interface PeerGroup
PeerGroupException
public PeerGroup newGroup(PeerGroupID gid) throws PeerGroupException
newGroup
in interface PeerGroup
PeerGroupException
public JxtaLoader getLoader()
getLoader
in interface PeerGroup
public String getPeerName()
getPeerName
in interface PeerGroup
public String getPeerGroupName()
getPeerGroupName
in interface PeerGroup
public PeerGroupID getPeerGroupID()
getPeerGroupID
in interface PeerGroup
public PeerID getPeerID()
getPeerID
in interface PeerGroup
public PeerAdvertisement getPeerAdvertisement()
getPeerAdvertisement
in interface PeerGroup
public PeerGroupAdvertisement getPeerGroupAdvertisement()
getPeerGroupAdvertisement
in interface PeerGroup
public boolean isRendezvous()
isRendezvous
in interface PeerGroup
public EndpointService getEndpointService()
getEndpointService
in interface PeerGroup
public ResolverService getResolverService()
getResolverService
in interface PeerGroup
public DiscoveryService getDiscoveryService()
getDiscoveryService
in interface PeerGroup
public PeerInfoService getPeerInfoService()
getPeerInfoService
in interface PeerGroup
public MembershipService getMembershipService()
getMembershipService
in interface PeerGroup
public PipeService getPipeService()
getPipeService
in interface PeerGroup
public RendezVousService getRendezVousService()
getRendezVousService
in interface PeerGroup
public AccessService getAccessService()
getAccessService
in interface PeerGroup
public abstract ModuleImplAdvertisement getAllPurposePeerGroupImplAdvertisement() throws Exception
getAllPurposePeerGroupImplAdvertisement
in interface PeerGroup
Exception
public PeerGroup getParentGroup()
getParentGroup
in interface PeerGroup
|
JXTA J2SE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |