Package com.j_spaces.core
Class LookupManager
java.lang.Object
com.j_spaces.core.LookupManager
- All Implemented Interfaces:
EventListener,LeaseListener,ServiceIDListener
This class
LookupManager provides : - Registration forever of JSpaces and
JSpace containers with all discovered Lookup Services using
registerForever()method. - Registering container and JSpaces with rmiregistry.
- Registering JSpace and JSpace containers with exists ServiceID.
- LeaseRenewManager that renews each lease as necessary to achieve a desired expiration time.
- Dynamic registration of all JSpaces and JSpace container with all discovered Lookup Services.
- Notification of LookupEvents.
- Clean up LookupManager.
- Logger messages.
registerForever() method registering forever(Lease.FOREVER) JSpace with with all
Lookup Services that discovered in the Network. The cleanup() method provides
unregistration of all spaces that was registered FOREVER from all Lookup Services. LookupManager
support container and JSpace registration with Rmi registry depends
"com.j_spaces.core.container.use_rmi_registry" property in <container-name>-config.xml file
[false] - Do not use rmi registry. [true] - Use rmi registry and Lookup services.
When space or container goes down(reboot) all information about container stored in
<%GSDir%>\config\<%hostname of container%>.xml file. The information is - Attributes of every
space in container. - ServiceID of every space. - All information about every
LookupService(ServiceID). - Which spaces registered on every LookupService. Using this
information after reboot of computer(LookupService) where spaces was registered, all spaces will
be registered with exists ServiceID.
This class using LeaseRenewManager class to renews each lease of registered space as
necessary when a desired expiration time achieved.
Every Lookup Service that was discovered in the Network, dynamically will registered with all
spaces that stored in this LookupManager object.
Every LookupService that was discovered in the Network will get notification to
discovered() method. Whether one or more lookup service registrars has been
discarded this class will get notification to discarded method.
terminate function unregistering container and JSpaces from all lookup services and
terminate LookupManager.//TODO
Constructor of this class get as parameter Log object that provides writing all
Log-statements that existing in this class to Log(it can be File, Socket). If this
Log object equals to null, all Log-statements will be disable.- Version:
- 1.0
- Author:
- Igor Goldenberg
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LookupLocator[]buildLookupLocators(String lookupLocatorURLs) Parse LookupLocator URLs and build array ofLookupLocator.voidnotify(LeaseRenewalEvent leaseManagerEvent) Called by the LeaseRenewalManager when it cannot renew a lease that it is managing, and the lease's desired expiration time has not yet been reached.voidRegistering forever proxy of JSpace with all Lookup services that exists in the Network.voidserviceIDNotify(ServiceID serviceID) Call back function that receive as parameter theserviceIDof registered service.voidUnregister all JSpace and JSpace container from all Lookup Services.voidunregister(String spaceName) Unregistering appropriate Space from all Lookup Services that this space was registered.
-
Constructor Details
-
LookupManager
- Throws:
NamingExceptionIOException
-
-
Method Details
-
serviceIDNotify
Call back function that receive as parameter theserviceIDof registered service.- Specified by:
serviceIDNotifyin interfaceServiceIDListener- Parameters:
serviceID- ServiceID of registered service.
-
notify
Called by the LeaseRenewalManager when it cannot renew a lease that it is managing, and the lease's desired expiration time has not yet been reached.- Specified by:
notifyin interfaceLeaseListener- Parameters:
leaseManagerEvent- Instance of LeaseRenewalEvent containing information about the lease that theLeaseRenewalManagerwas unable to renew.
-
buildLookupLocators
Parse LookupLocator URLs and build array ofLookupLocator. List of LookupLocator URLs should be separates by comma. For example: "host1:4180,host2:4180,host3:4180"- Parameters:
lookupLocatorURLs- List of LookupLocators URLs, separates by ",".- Returns:
- LookupLocator[] Array of initialized
LookupLocator.
-
register
Registering forever proxy of JSpace with all Lookup services that exists in the Network.- Parameters:
spaceProxy- JSpace proxy.
-
unregister
Unregistering appropriate Space from all Lookup Services that this space was registered.- Parameters:
spaceName- JSpace name. is not known to the grantor of the lease. This can occur when a lease expires or has been canceled.
-
terminate
Unregister all JSpace and JSpace container from all Lookup Services.- Throws:
RemoteException
-