|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nitido.nim.NiMKernelService
com.nitido.nim.UniqueIdService
com.nitido.nimx.services.uniqueid.ipdomain.UniqueIdServiceImpl
public class UniqueIdServiceImpl
This class implements the UniqueIdService interface. This implementation generates unique ids that are based on the IP address of the local machine.
The generated ID is unique as long as there is only one instance of NiM is running on each machine and the involving machines do not have the same IP address.
Field Summary |
---|
Constructor Summary | |
---|---|
UniqueIdServiceImpl(NiMKernelServiceVisa visa)
This class constructor is used by NiMKernel to instantiate a new UniqueIdService |
Method Summary | |
---|---|
java.lang.String |
generateUniqueId()
This method generates an identifier that is unique accross method invocations and accross an IP domain. |
protected void |
init(NiMKernel kernel,
ConfigurationService confService)
This method is used to initialize the kernel service. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UniqueIdServiceImpl(NiMKernelServiceVisa visa)
visa
- Reference to the NiMKernelServiceVisa object required to
instantiate the service. This parameter is required to
ensure that only the NiMkernel can instantiate a reference
to this service.Method Detail |
---|
protected void init(NiMKernel kernel, ConfigurationService confService) throws InitializationFailedException, NiMException
NiMKernelService
init
in class UniqueIdService
kernel
- Reference to the NiMKernel object that instantiated the
service.confService
- A reference to the configuration service. All the service
implementations (except ConfigurationService)
should retrieve the setting information from it.
InitializationFailedException
- If unable to initialize the kernel service.
NiMException
- If service initialization can not be done due to failure in
establish a connection to the back-end service. Not all
service implementation will throw this exception.public java.lang.String generateUniqueId()
The identifier is guranteed to be unique on the machine that the call is being run on. An attempt is made to make the identifier unique across machines within the IP domain by including the host IP information in the identifier. However, this operation is not gauranteed and no exception will be thrown even if the operation fails. Thus, the generated identifier will not be unique if the call to InetAddress.getLocalHost() fails or if the response to this opreation can generate a machine id that is not unique (for example in the use of IP masquerading).
generateUniqueId
in class UniqueIdService
|
Nitido NiM 2.5 Java API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1999-2009 Nitido Inc. Proprietary and Confidential. All Rights Reserved.