|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--au.com.hardlight.lm.Manager
This package attempts to allow only as many application instances to run as there are licence keys. It will not allow the same key to be used multiple times on the same machine.
This is probably not useful for standalone apps, but makes licencing per Web Context possible in servlet environments etc, even if its the same application.
It may not work on all platforms and it may not reliably work across multiple simultaneous different JVM's
its aim is to keep the honest users honest.
This package can be used pretty much in conjunction with any licencing tool.
it does not attempt to manage or verify licences as such, but rather to monitor the number of times a single licence is used simultaneously on any given machine.
import au.com.hardlight.lm;
Manager mn=new Manager("licence.key");
mn.getLicenceStatus();
test if current licence is valid.
if (mn.getStrLicenced().equals(mn.getLicenceStatus())) { YAY };
mn.verify();
mn.Close();//free's current licence slot
mn=null;//this will also free current licence slot but only when gc cleans it up.
Constructor Summary | |
Manager(java.lang.String keyname)
|
|
Manager(java.lang.String keyname,
int maxInstanceCount)
|
|
Manager(java.lang.String keyname,
java.lang.String NameSpace)
|
|
Manager(java.lang.String keyname,
java.lang.String NameSpace,
int maxInstanceCount)
|
Method Summary | |
java.lang.Object |
clone()
|
void |
close()
Close this object Has an immediate effect, and should be called before destruction. free's the slot for this licence key. |
java.lang.String |
getLicenceKey()
|
java.lang.String |
getLicenceStatus()
|
java.lang.String |
getNameSpace()
|
java.lang.String |
getStrLicenced()
|
java.lang.String |
getStrUnlicenced()
|
java.lang.String |
verify()
verifies and returns the current licenceStatus. if licenseStatus is currently "unlicenced" then this method will reaquire a licence slot if it can. use getLicenceStatus() if you just want to check current status. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Manager(java.lang.String keyname) throws java.lang.Exception
keyname
- any unique String, but should be different for each legally run copy of an application.
java.lang.Exception
public Manager(java.lang.String keyname, int maxInstanceCount) throws java.lang.Exception
keyname
- any unique String, but should be different for each legally run copy of an application.maxInstanceCount
- sets the maximum number of simultaneous allowances for this key.
java.lang.Exception
public Manager(java.lang.String keyname, java.lang.String NameSpace) throws java.lang.Exception
keyname
- any unique String, but should be different for each legally run copy of an application.NameSpace
-
java.lang.Exception
public Manager(java.lang.String keyname, java.lang.String NameSpace, int maxInstanceCount) throws java.lang.Exception
keyname
- any unique String, but should be different for each legally run copy of an application.NameSpace
- maxInstanceCount
- sets the maximum number of simultaneous allowances for this key.
java.lang.Exception
Method Detail |
public final java.lang.String getLicenceKey()
public final java.lang.String getLicenceStatus()
public final java.lang.String getStrLicenced()
public final java.lang.String getStrUnlicenced()
public final java.lang.String getNameSpace()
public final void close()
public final java.lang.String verify()
verifies and returns the current licenceStatus.
if licenseStatus is currently "unlicenced" then
this method will reaquire a licence slot if it can.
use getLicenceStatus() if you just want to check current status.
getLicenceStatus()
,
close()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |