|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectome.services.licenses.Store
public class Store
Example LicenseStore
implementation. NOT INTENDED FOR PRODUCTION USE.
Constructor Summary | |
---|---|
Store()
|
|
Store(int count)
|
|
Store(int total,
int used)
|
Method Summary | |
---|---|
byte[] |
acquireLicense()
Reserves a license for the current user. |
void |
enterMethod(byte[] token,
Principal p)
Increments the number of currently active methods associated with a single license and prevents timeouts during the method call. |
void |
exitMethod(byte[] token,
Principal p)
Decrements the number of active methods associated with a single license and timestamps the last use of the license. |
long |
getAvailableLicenseCount()
Returns the number of licenses which can currently be acquired . |
long |
getLicenseTimeout()
Returns the timeout per license as interpreted by the LicenseStore implementation. |
TokenInfo |
getToken(byte[] token)
|
long |
getTotalLicenseCount()
Returns the total number of licenses which the server has. |
boolean |
hasLicense(byte[] token)
Checks for the validity of a token and that the Not responsible for timeouts. |
boolean |
releaseLicense(byte[] token)
Frees a license for re-reservation via ILicense.acquireLicense() . |
void |
resetLicenses()
Administrative method to clear all active licenses and possibly to re-initialize the LicenseStore . |
void |
setLicenseCount(int count)
|
void |
setSessionManager(SessionManager sessionManager)
See {@link LicenseStore#setSessionManager(SessionManager) |
void |
setStaticSecuritySystem(SecuritySystem securitySystem)
See LicenseStore.setStaticSecuritySystem(SecuritySystem) |
void |
setUsedLicenses(int count)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Store()
public Store(int count)
public Store(int total, int used)
Method Detail |
---|
public void setStaticSecuritySystem(SecuritySystem securitySystem)
LicenseStore.setStaticSecuritySystem(SecuritySystem)
setStaticSecuritySystem
in interface LicenseStore
public void setSessionManager(SessionManager sessionManager)
setSessionManager
in interface LicenseStore
public void setLicenseCount(int count)
public void setUsedLicenses(int count)
public TokenInfo getToken(byte[] token)
public void enterMethod(byte[] token, Principal p)
LicenseStore
LicenseStore.hasLicense(byte[])
within its synchronization boundaries,
also responsible for timeouts.
enterMethod
in interface LicenseStore
public void exitMethod(byte[] token, Principal p)
LicenseStore
exitMethod
in interface LicenseStore
public byte[] acquireLicense()
ILicense
LicenseWiring
interceptor is in effect.
Licenses may timeout depending on the LicenseStore
implementation. Clients should be ready to handle
exceptions
on any method call.
Licenses should also be released
when possible so that other users can access the server.
acquireLicense
in interface ILicense
public long getAvailableLicenseCount()
ILicense
acquired
. There is no guarantee
that the number will remain constant before the next
call, and therefore clients should be prepared to handle
exceptions
during acquisition.
No guarantee is given on the interpretation of licenses
used. Refer to the LicenseStore
implementation
for more details. For example, a power-user may consume
more than one license per acquisition.
getAvailableLicenseCount
in interface ILicense
public long getTotalLicenseCount()
ILicense
ILicense.resetLicenses()
getTotalLicenseCount
in interface ILicense
public long getLicenseTimeout()
ILicense
LicenseStore
implementation. Please refer there
for more information.
getLicenseTimeout
in interface ILicense
public boolean hasLicense(byte[] token)
LicenseStore
hasLicense
in interface LicenseStore
public boolean releaseLicense(byte[] token)
ILicense
ILicense.acquireLicense()
.
If the license is invalid, no exception is thrown, but rather a
false
value returned.
releaseLicense
in interface ILicense
public void resetLicenses()
ILicense
LicenseStore
. This
may include a change to the internal settings such as
license count
or
timeout
.
resetLicenses
in interface ILicense
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: Beta-4.1.1-r5927-b91
Copyright © 2009 The University of Dundee. All Rights Reserved.