|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jp.protection.pub.pro.lserver.BasicLicensingServiceProvider
public abstract class BasicLicensingServiceProvider
Basic implementation of the LicensingServiceProvider
interface. This class contains number of
helper methods allowing for easy building actual implementations which are based on BasicLicensingServiceProvider
.
Nested Class Summary | |
---|---|
protected class |
BasicLicensingServiceProvider.LicensingServiceProxy
|
Field Summary | |
---|---|
protected java.lang.String |
fAddress
|
protected java.util.Map |
fAttributes
|
protected boolean |
fConfirmLicenseLocks
|
protected java.lang.Thread |
fConfirmLicenseLocksThread
|
protected boolean |
fDefault
|
protected java.util.List |
fLicensingServices
|
protected LicensingServiceProviderListenerSupport |
fListenerSupport
|
protected java.util.Map |
fProxyLicensingServiceMap
|
protected java.util.HashMap |
fTicketLicenseDataMap
|
protected java.util.HashMap |
fTicketMap
|
Constructor Summary | |
---|---|
BasicLicensingServiceProvider()
Creates a new instance of the BasicLicensingServiceProvider |
Method Summary | |
---|---|
void |
addLicensingServiceProviderListener(LicensingServiceProviderListener l)
Adds a listener to the listeners list |
protected void |
addTicket(LicensingService aLicensingService,
java.lang.String aTicket,
LicenseData aLicenseData)
|
protected boolean |
confirmLicenseLocks(LicensingService aLicensingService,
java.util.Map anAttributes)
|
protected boolean |
confirmLicenseLocks(java.util.Map anAttributes)
|
LicensingService |
createLicensingService(java.util.Map anAttributes)
Creates a new instance of the Licensing Service |
protected abstract LicensingService |
createLicensingServiceImpl(java.util.Map anAttributes)
|
protected LicensingService |
createLicensingServiceProxy(LicensingService aLicensingService)
|
protected LicenseData |
getLicenseData(java.lang.String aTicket)
|
protected long |
getLicenseLockConfirmPeriod()
|
static java.lang.String |
getMessage(java.lang.Throwable ex)
Returns user-friendly formatted initmessage for the given exception |
protected java.util.Set |
getTickets(LicensingService aLicensingService)
|
void |
init(java.lang.String anAddress,
java.util.Map anAttributes)
Initializes the provider instance |
boolean |
isConfirmLicenseLocks()
Returns whether provider automatically (in background) confirms all acquired license locks |
boolean |
isDefault()
Returns whether this provider is a default provider |
void |
release()
Releases provider and of all associated recourses including the Licensing Services created by the provider |
void |
releaseLicensingService(LicensingService aLicensingService)
Releases a Licensing Service and all of the associated resources including the license locks acquired by the service |
protected abstract void |
releaseLicensingServiceImpl(LicensingService aLicensingService)
|
void |
removeLicensingServiceProviderListener(LicensingServiceProviderListener l)
Removes the listener from the listeners list |
protected void |
removeTicket(LicensingService aLicensingService,
java.lang.String aTicket)
|
void |
setConfirmLicenseLocks(boolean aConfirmLicenseLocks)
Specifies whether the provider should automatically (in the background) confirm all acquired license locks |
void |
setConfirmLicenseLocks(boolean aConfirmLicenseLocks,
java.util.Map anAttributes)
Specifies whether the provider should automatically (in the background) confirm all acquired license locks |
void |
setDefault(boolean aDefault)
Specifies that this provider should be default one |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String fAddress
protected java.util.Map fAttributes
protected java.util.Map fProxyLicensingServiceMap
protected boolean fConfirmLicenseLocks
protected java.lang.Thread fConfirmLicenseLocksThread
protected java.util.List fLicensingServices
protected java.util.HashMap fTicketMap
protected java.util.HashMap fTicketLicenseDataMap
protected boolean fDefault
protected transient LicensingServiceProviderListenerSupport fListenerSupport
Constructor Detail |
---|
public BasicLicensingServiceProvider()
BasicLicensingServiceProvider
Method Detail |
---|
protected LicensingService createLicensingServiceProxy(LicensingService aLicensingService)
public void init(java.lang.String anAddress, java.util.Map anAttributes)
LicensingServiceProvider
init
in interface LicensingServiceProvider
anAddress
- address of the Licensing Server to connectanAttributes
- initialization attributespublic LicensingService createLicensingService(java.util.Map anAttributes)
LicensingServiceProvider
createLicensingService
in interface LicensingServiceProvider
anAttributes
- attributes (identified by LicensingService.ATTR_
keys)
which describe client environment.
protected abstract LicensingService createLicensingServiceImpl(java.util.Map anAttributes)
protected abstract void releaseLicensingServiceImpl(LicensingService aLicensingService)
public void releaseLicensingService(LicensingService aLicensingService)
LicensingServiceProvider
releaseLicensingService
in interface LicensingServiceProvider
aLicensingService
- a Licensing Service to releasepublic void release()
LicensingServiceProvider
release
in interface LicensingServiceProvider
protected boolean confirmLicenseLocks(java.util.Map anAttributes)
protected boolean confirmLicenseLocks(LicensingService aLicensingService, java.util.Map anAttributes)
public boolean isConfirmLicenseLocks()
true
if provider automatically (in background) confirms all acquired license locks; false
otherwisepublic void setConfirmLicenseLocks(boolean aConfirmLicenseLocks)
aConfirmLicenseLocks
- true
if the provider should automatically (in the background) confirm all
acquired license locks; false
otherwiseprotected long getLicenseLockConfirmPeriod()
public void setConfirmLicenseLocks(boolean aConfirmLicenseLocks, java.util.Map anAttributes)
aConfirmLicenseLocks
- true
if the provider should automatically (in the background) confirm all
acquired license locks; false
otherwiseanAttributes
- attributes to pass to confirmLicenseLock(...)
method of Licensing Serviceprotected java.util.Set getTickets(LicensingService aLicensingService)
protected LicenseData getLicenseData(java.lang.String aTicket)
protected void addTicket(LicensingService aLicensingService, java.lang.String aTicket, LicenseData aLicenseData)
protected void removeTicket(LicensingService aLicensingService, java.lang.String aTicket)
public boolean isDefault()
LicensingServiceProvider
isDefault
in interface LicensingServiceProvider
true
if this provider is default; false
otherwisepublic void setDefault(boolean aDefault)
aDefault
- true
if this provider should be default one; false
otherwisepublic void addLicensingServiceProviderListener(LicensingServiceProviderListener l)
LicensingServiceProvider
addLicensingServiceProviderListener
in interface LicensingServiceProvider
l
- listener to addpublic void removeLicensingServiceProviderListener(LicensingServiceProviderListener l)
LicensingServiceProvider
removeLicensingServiceProviderListener
in interface LicensingServiceProvider
l
- listener to removepublic static java.lang.String getMessage(java.lang.Throwable ex)
ex
- exception to return message for
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |