## JoinManager Utilility Requirements

ID | JoinManager Utilility Requirement | Section | Comments
| The equals method for this class returns true if and only if two instances of this class refer to the same object. That is, x and y are equal instances of this class if and only if x == y has the value true. | 6.4 |
| The first form of the constructor takes the following parameters as input: A reference to the service requesting the services of the JoinManager |  |
| The first form of the constructor takes the following parameters as input: An array containing the service�s attributes |  |
| The first form of the constructor takes the following parameters as input: A reference to an object that implements the ServiceIDListener interface (belonging to the package org.apache.river.lookup) |  |
| The assignment of a service ID to the service will result in an event notification being sent to the listener object that was passed as the ServiceIDListener argument (callback). |  |
| If a null value is passed in through this argument, then no such notification will be sent. |  |
| The first form of the constructor takes the following parameters as input: A reference to an object that implements the DiscoveryManagement interface |  |
| The DiscoveryManagement argument may be set to a value of null.If null is the value of this argument, then an instance of the LookupDiscoveryManager utility class will be constructed to listen for events announcing the discovery of only those lookup services that are members of the public group. |  |
| The first form of the constructor takes the following parameters as input: An instance of the LeaseRenewalManager utility class |  |
| The LeaseRenewalManager argument may be set to a value of null.If null is the value of this argument, an instance of the LeaseRenewalManager class will be created, initially managing no Lease objects. |  |
| The second form of the constructor takes the same arguments as the first, except that an instance of the ServiceID replaces an instance of the ServiceIDListener interface. |  |
| The second form of the constructor applies the same semantics to the discoveryMgr and leaseMgr arguments as is applied by the first form of the constructor. |  |
| The getDiscoveryManager method returns the instance of DiscoveryManagement that was passed into the constructor by the entity, or which was created as a result of null being input to that parameter. |  |
| The getLeaseRenewalManager method returns an instance of the LeaseRenewalManager class. |  |
| The getJoinSet method returns an array of ServiceRegistrar objects, each corresponding to a lookup service with which the service has registered (joined). Each time this method is invoked, a new array is returned. This method takes no arguments. |  |
| The getJoinSet method � Each time this method is invoked, a new array is returned. |  |
| The getAttributes method returns an array containing the set of attributes currently associated with the service. This method takes no arguments as input, and will return a new array upon each invocation. |  |
| The getAttributes method � will return a new array upon each invocation. |  |
| The addAttributes method associates a new set of attributes with the service, in addition to the service�s current set of attributes. The association of this new set of attributes with the service will be propagated to each lookup service with which the service is registered. This propagation must be performed asynchronously. Because of this, there is no guarantee that the propagation of the attributes to all lookup services with which the service is Registered will have completed upon return from this method. |  |
| The set of attributes consisting of the union of the new set with the old set will be associated with the service in all future join processing. |  |
| The addAttributes method � Both forms of this method take as input an argument representing the set of attributes to associate with the service. This set is represented as an array of Entry objects, none of whose elements may be null. |  |
| The addAttributes method � An invocation of this method with this array containing duplicate elements is equivalent to performing the invocation with the duplicates removed from the array. |  |
| The addAttributes method � If null is passed in as the value of this parameter, a NullPointerException will be thrown. |  |
| The addAttributes method � The second form of this method also takes as input a flag indicating whether or not this method should determine if the attributes in the input set are instances of the ServiceControlled interface, which is a marker interface that is used to control which entities may modify a service�s attribute set. If the value of this flag is true and at least one of the attributes to be added is an instance of the ServiceControlled interface, a SecurityException will be thrown and propagated through this method. |  |
| The addAttributes method �� It is for this reason that the effects of modifying the contents of the input array, after this method is invoked, are undefined. |  |
| The setAttributes method replaces the service�s current set of attributes with the given new set of attributes. |  |
| The setAttributes method � This method takes a single argument as input: an array of Entry objects, none of whose elements may be null, that represents the set of attributes that will replace the current set of attributes. |  |
| The setAttributes method � The replacement of the service�s current set of attributes with the new set of attributes will be propagated to each lookup service with which the service is registered. This propagation must be performed asynchronously. Because of this, there is no guarantee that the propagation of the attributes to all lookup services with which the service is registered will have completed upon return from this method. |  |
| The setAttributes method � The service�s new set of attributes will be associated with the service in all future join processing. |  |
| The setAttributes method � Invoking this method with an input array that contains duplicate elements is equivalent to performing the invocation with the duplicates removed from the array. |  |
| The setAttributes method � If null is input to setAttributes,a NullPointerException will be thrown. |  |
| The setAttributes method � the effects of modifying the contents of the input array, after setAttributes is invoked, are undefined. |  |
| The modifyAttributes method changes the service�s current set of attributes using the same semantics as the modifyAttributes method of the ServiceRegistration class (see the Jini� Lookup Service Specification). |  |
| The modifyAttributes method � Both forms will take an array of templates in the first argument, and an array of attributes in the second argument. The templates are used to identify which elements to modify from the service�s current set of attributes. The attribute array contains the actual modifications to be made. |  |
| The modifyAttributes method � The additional argument in the signature of the second form of modifyAttributes is a flag indicating whether or not this method should determine if the attributes in the input set are instances of the ServiceControlled interface, which is a marker interface used to control which entities may modify a service�s attribute set (see section 4.1 of the Jini� Lookup Attribute Schema Specification). If the value of this flag is true and at least one of the attributes to be modified is an instance of the ServiceControlled interface, a SecurityException will be thrown and propagated through this method. |  |
| The modifyAttributes method � The association of the new set of attributes with the service will be propagated to each lookup service with which the service is registered. This propagation must be performed asynchronously. Because of this asynchronous behavior, there is no guarantee that the propagation of the attributes to all lookup services with which the service is registered will have completed upon return from this method. |  |
| The modifyAttributes method � The set of attributes that results after the modifications have been applied will be associated with the service in all future join processing. |  |
| The modifyAttributes method � If the length of the array containing the templates does not equal the length of the array containing the attributes, an IllegalArgumentException will be thrown and propagated through this method. |  |
| The modifyAttributes method � the effects of modifying the contents of the input array, after modifyAttributes is invoked, are undefined. |  |
| The terminate method � will cancel all leases managed on behalf of the service, and will terminate all threads that have been created. Additionally, if the discovery manager employed by the JoinManager was created by the JoinManager itself, this method will terminate all discovery processing being performed by that manager object on behalf of the service. |  |
| The terminate method � will terminate all threads that have been created. |  |
| The terminate method � Additionally, if the discovery manager employed by the JoinManager was created by the JoinManager itself, this method will terminate all discovery processing being performed by that manager object on behalf of the service. |  |
| The terminate method � The JoinManager makes certain concurrency guarantees with respect to an invocation of the terminate method while other method invocations are in progress. The termination process described above will not begin until completion of all invocations of the methods defined in the public interface of the JoinManager. |  |
| The terminate method � Furthermore, once the termination process has begun, no remote method invocations will be made by the JoinManager, and all other method invocations on the JoinManager will not return until the termination process has completed. Upon completion of the termination process, the semantics of all current and future method invocations on the current instance of the JoinManager are undefined. |  |
| The terminate method � Furthermore, once the termination process has begun, � all other method invocations on the JoinManager will not return until the termination process has completed. |  |
| The terminate method � Upon completion of the termination process, the semantics of all current and future method invocations on the current instance of the JoinManager are undefined. |  |