public class LookupManager extends Object implements ServiceIDListener, LeaseListener
LookupManager
provides : registerForever()
method. 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 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.Constructor and Description |
---|
LookupManager(String containerName) |
Modifier and Type | Method and Description |
---|---|
static LookupLocator[] |
buildLookupLocators(String lookupLocatorURLs)
Parse LookupLocator URLs and build array of
LookupLocator . |
void |
notify(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.
|
void |
register(IJSpace spaceProxy,
String containerName)
Registering forever proxy of JSpace with all Lookup services that exists in the Network.
|
void |
serviceIDNotify(ServiceID serviceID)
Call back function that receive as parameter the
serviceID of registered
service. |
void |
terminate()
Unregister all JSpace and JSpace container from all Lookup Services.
|
void |
unregister(String spaceName)
Unregistering appropriate Space from all Lookup Services that this space was registered.
|
public LookupManager(String containerName) throws NamingException, IOException
NamingException
IOException
public void serviceIDNotify(ServiceID serviceID)
serviceID
of registered
service.serviceIDNotify
in interface ServiceIDListener
serviceID
- ServiceID of registered service.public void notify(LeaseRenewalEvent leaseManagerEvent)
notify
in interface LeaseListener
leaseManagerEvent
- Instance of LeaseRenewalEvent containing information about the lease
that the LeaseRenewalManager
was unable to renew.public static LookupLocator[] buildLookupLocators(String lookupLocatorURLs)
LookupLocator
. List of LookupLocator
URLs should be separates by comma. For example: "host1:4180,host2:4180,host3:4180"lookupLocatorURLs
- List of LookupLocators URLs, separates by ",".LookupLocator
.public void register(IJSpace spaceProxy, String containerName)
spaceProxy
- JSpace proxy.public void unregister(String spaceName)
spaceName
- JSpace name.
is not known to the grantor of the lease. This can occur when a lease
expires or has been canceled.public void terminate() throws RemoteException
RemoteException
Copyright © GigaSpaces.