|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.jini.lookup.JoinManager
This class manages the join protocol for a service. It discovers and keeps track of which lookup services to join, registers with them, keeps the registration leases renewed, and keeps the attributes up to date.
Constructor Summary | |
JoinManager(java.lang.Object obj,
Entry[] attrSets,
ServiceIDListener callback,
LeaseRenewalManager leaseMgr)
Use this constructor when the service does not yet have a service ID, and has not been specially pre-configured with respect to joins. |
|
JoinManager(java.lang.Object obj,
Entry[] attrSets,
java.lang.String[] groups,
LookupLocator[] locators,
ServiceIDListener callback,
LeaseRenewalManager leaseMgr)
Use this constructor when the service does not have a service ID, but has been specially pre-configured with respect to joins. |
|
JoinManager(ServiceID serviceID,
java.lang.Object obj,
Entry[] attrSets,
java.lang.String[] groups,
LookupLocator[] locators,
LeaseRenewalManager leaseMgr)
Use this constructor when the service already has a service ID. |
Method Summary | |
void |
addAttributes(Entry[] attrSets)
Add attribute sets for the service. |
void |
addAttributes(Entry[] attrSets,
boolean checkSC)
Add attribute sets for the service. |
void |
addGroups(java.lang.String[] groups)
Add new groups to to the set to join. |
void |
addLocators(LookupLocator[] locators)
Add new locators for specific lookup services to join. |
Entry[] |
getAttributes()
Get the current attribute sets. |
java.lang.String[] |
getGroups()
Get the list of groups to join. |
ServiceRegistrar[] |
getJoinSet()
Get the list of lookup services that have currently been joined. |
LookupLocator[] |
getLocators()
Get the list of locators of specific lookup services to join. |
void |
modifyAttributes(Entry[] attrSetTemplates,
Entry[] attrSets)
Modify the current attribute sets, using the same semantics as ServiceRegistration.modifyAttributes. |
void |
modifyAttributes(Entry[] attrSetTemplates,
Entry[] attrSets,
boolean checkSC)
Modify the current attribute sets, using the same semantics as ServiceRegistration.modifyAttributes. |
void |
removeGroups(java.lang.String[] groups)
Remove groups from the set to join. |
void |
removeLocators(LookupLocator[] locators)
Remove locators for specific lookup services from the set to join. |
void |
setAttributes(Entry[] attrSets)
Set the complete attribute sets for the service. |
void |
setGroups(java.lang.String[] groups)
Replace the list of groups to join with a new list. |
void |
setLocators(LookupLocator[] locators)
Replace the list of locators of specific lookup services to join with a new list. |
void |
terminate()
Cancel leases at all joined lookup services. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public JoinManager(java.lang.Object obj, Entry[] attrSets, ServiceIDListener callback, LeaseRenewalManager leaseMgr) throws java.io.IOException
obj
- the service objectattrSets
- the attribute sets for the servicecallback
- gets passed the assigned service ID so that the
service can make it persistent.ServiceIDListener
public JoinManager(java.lang.Object obj, Entry[] attrSets, java.lang.String[] groups, LookupLocator[] locators, ServiceIDListener callback, LeaseRenewalManager leaseMgr) throws java.io.IOException
obj
- the service objectattrSets
- the attribute sets for the servicegroups
- groups to join. Null (or empty) means join no groups,
not join all groups.locators
- locators of specific lookup services to joincallback
- gets called with the assigned service ID so that
the service can make it persistentServiceIDListener
public JoinManager(ServiceID serviceID, java.lang.Object obj, Entry[] attrSets, java.lang.String[] groups, LookupLocator[] locators, LeaseRenewalManager leaseMgr) throws java.io.IOException
serviceID
- the service ID (must not be null)obj
- the service objectattrSets
- the attribute sets for the servicegroups
- groups to join. Null (or empty) means join no groups,
not join all groups.locators
- locators of specific lookup services to joinMethod Detail |
public ServiceRegistrar[] getJoinSet()
public LookupLocator[] getLocators()
public void addLocators(LookupLocator[] locators)
locators
- locators of specific lookup services to joinpublic void removeLocators(LookupLocator[] locators)
locators
- locators of specific lookup services to leavepublic void setLocators(LookupLocator[] locators)
locators
- locators of specific lookup services to joinpublic java.lang.String[] getGroups()
public void addGroups(java.lang.String[] groups) throws java.io.IOException
groups
- groups to joinpublic void removeGroups(java.lang.String[] groups) throws java.io.IOException
groups
- groups to leavepublic void setGroups(java.lang.String[] groups) throws java.io.IOException
groups
- groups to joinpublic Entry[] getAttributes()
public void addAttributes(Entry[] attrSets)
attrSets
- the attribute sets to addpublic void modifyAttributes(Entry[] attrSetTemplates, Entry[] attrSets)
attrSetTemplates
- the templates for matching attribute setsattrSets
- the modifications to make to matching setsServiceRegistration.modifyAttributes(net.jini.core.entry.Entry[], net.jini.core.entry.Entry[])
public void setAttributes(Entry[] attrSets)
attrSets
- the attribute sets for the servicepublic void addAttributes(Entry[] attrSets, boolean checkSC)
attrSets
- the attribute sets to addcheckSC
- check for instanceof ServiceControlled if truepublic void modifyAttributes(Entry[] attrSetTemplates, Entry[] attrSets, boolean checkSC)
attrSetTemplates
- the templates for matching attribute setsattrSets
- the modifications to make to matching setscheckSC
- check for instanceof ServiceControlled if trueServiceRegistration.modifyAttributes(net.jini.core.entry.Entry[], net.jini.core.entry.Entry[])
public void terminate()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |