jrunx.license
Class LicenseService

jrunx.license.LicenseService
All Implemented Interfaces:
LicenseServiceMBean, java.io.Serializable, Service, ServiceMBean

public final class LicenseService
implements LicenseServiceMBean

The JRun 4.0 License Manager Service. The license manager acts as a proxy to the actual license implementation, depending upon the type of license (JRun 4.0, 3.0, 2.3)

Author:
Karl Moss
See Also:
Serialized Form

Fields inherited from interface jrunx.license.LicenseServiceMBean
RESTRICTED_CONCURRENCY, UNLIMITED_CONCURRENCY, UNLIMITED_EXPIRATION
 
Fields inherited from interface jrunx.kernel.Service
INITIALIZED, STARTED, STARTING, STOPPED, STOPPING, UNINITIALIZED
 
Constructor Summary
LicenseService()
           
 
Method Summary
 java.lang.String getEdition()
          Returns the human readable description of the product edition
 int getEvalDays()
          Gets the number of days of the evaluation period, or 0 if this is not an evaluation license
 long getEvalDaysLeft()
          Gets the number of days left in the evaluation period
 java.util.Date getExpirationDate()
          Gets the date when this key will expire, or UNLIMITED_EXPIRATION if the key does not expire.
 java.lang.String getLastWarningMessage()
          Gets the last warning message generated.
 long getLicenseEvaluation()
          Gets the license evaluation code for the server
 java.lang.String getLicenseKey()
          Gets the curent license key
 java.lang.String getLicenseType()
          Gets the license type description
 int getMajorVersion()
          Returns the major version number of JRun, such as 4
 int getMaxConcurrency()
          Returns the maximum number of concurrent connections allowed for the current license key.
 java.lang.String getPreviousLicenseKey()
          Gets the old JRun 3.1 license key for the server
 void init()
           
 boolean isEJBEnabled()
          Determines if the license supports EJB deployment
 boolean isExpired()
          Determines whether the current license has expired
 boolean isPurchased()
          Determines whether the current license is a purchased version
 boolean isSingleIP()
          Determines if the license only supports access from a single IP
 boolean isUpgrade()
          Determines whether the current license is an upgrade from a previous product
 boolean isValid()
          Determines if the current license key is valid (internal checksums, etc).
 void preDeregister()
           
 void setLicenseEvaluation(long evalCode)
          Sets the license evaluation code for the server
 void setLicenseKey(java.lang.String key)
          Sets the current license key for the server
 void setPreviousLicenseKey(java.lang.String key)
          Sets the old JRun 3.1 license key for the server
 void updateLicenseFile()
          Updates the license file with the license information stored in the service
 
Methods inherited from interface jrunx.kernel.ServiceMBean
bind, getBindToJNDI, getDeactivated, getDomainName, getJRunService, getLogger, getName, getParentService, getServerName, requestServer, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, unbind
 
Methods inherited from interface jrunx.kernel.Service
destroy, getStatus, start, stop, updateStatus
 

Constructor Detail

LicenseService

public LicenseService()
Method Detail

getLicenseKey

public java.lang.String getLicenseKey()
Description copied from interface: LicenseServiceMBean
Gets the curent license key
Specified by:
getLicenseKey in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Returns:
The license key

setLicenseKey

public void setLicenseKey(java.lang.String key)
Description copied from interface: LicenseServiceMBean
Sets the current license key for the server
Specified by:
setLicenseKey in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Parameters:
key - The license key

getLicenseEvaluation

public long getLicenseEvaluation()
Description copied from interface: LicenseServiceMBean
Gets the license evaluation code for the server
Specified by:
getLicenseEvaluation in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Returns:
The evaluation code

setLicenseEvaluation

public void setLicenseEvaluation(long evalCode)
Description copied from interface: LicenseServiceMBean
Sets the license evaluation code for the server
Specified by:
setLicenseEvaluation in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Parameters:
evalCode - The evaluation code

getPreviousLicenseKey

public java.lang.String getPreviousLicenseKey()
Description copied from interface: LicenseServiceMBean
Gets the old JRun 3.1 license key for the server
Specified by:
getPreviousLicenseKey in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Returns:
The license key

setPreviousLicenseKey

public void setPreviousLicenseKey(java.lang.String key)
Description copied from interface: LicenseServiceMBean
Sets the old JRun 3.1 license key for the server
Specified by:
setPreviousLicenseKey in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Parameters:
key - The license key

updateLicenseFile

public void updateLicenseFile()
                       throws java.lang.Exception
Description copied from interface: LicenseServiceMBean
Updates the license file with the license information stored in the service
Specified by:
updateLicenseFile in interface LicenseServiceMBean

init

public void init()
          throws java.lang.Exception
Specified by:
init in interface Service

getMaxConcurrency

public int getMaxConcurrency()
Description copied from interface: LicenseServiceMBean
Returns the maximum number of concurrent connections allowed for the current license key.
Specified by:
getMaxConcurrency in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Returns:
max connections, or UNLIMITED_CONCURRENCY for unlimited

isEJBEnabled

public boolean isEJBEnabled()
Description copied from interface: LicenseServiceMBean
Determines if the license supports EJB deployment
Specified by:
isEJBEnabled in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Returns:
true if the license supports EJB deployment

isSingleIP

public boolean isSingleIP()
Description copied from interface: LicenseServiceMBean
Determines if the license only supports access from a single IP
Specified by:
isSingleIP in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Returns:
true if the license only supports access from a single IP

isValid

public boolean isValid()
Description copied from interface: LicenseServiceMBean
Determines if the current license key is valid (internal checksums, etc).
Specified by:
isValid in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Returns:
true if the license is valid

getMajorVersion

public int getMajorVersion()
Description copied from interface: LicenseServiceMBean
Returns the major version number of JRun, such as 4
Specified by:
getMajorVersion in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Returns:
The major version number

getExpirationDate

public java.util.Date getExpirationDate()
Description copied from interface: LicenseServiceMBean
Gets the date when this key will expire, or UNLIMITED_EXPIRATION if the key does not expire.
Specified by:
getExpirationDate in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Returns:
The date when this key will expire

getEvalDays

public int getEvalDays()
Description copied from interface: LicenseServiceMBean
Gets the number of days of the evaluation period, or 0 if this is not an evaluation license
Specified by:
getEvalDays in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Returns:
The number of days in the evaluation period

getEvalDaysLeft

public long getEvalDaysLeft()
Description copied from interface: LicenseServiceMBean
Gets the number of days left in the evaluation period
Specified by:
getEvalDaysLeft in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Returns:
The number of days left in the evaluation period

isExpired

public boolean isExpired()
Description copied from interface: LicenseServiceMBean
Determines whether the current license has expired
Specified by:
isExpired in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Returns:
true if the license has expired

isPurchased

public boolean isPurchased()
Description copied from interface: LicenseServiceMBean
Determines whether the current license is a purchased version
Specified by:
isPurchased in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Returns:
true if the license is for a purchased version

getEdition

public java.lang.String getEdition()
Description copied from interface: LicenseServiceMBean
Returns the human readable description of the product edition
Specified by:
getEdition in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Returns:
The pretty string for this product edition

isUpgrade

public boolean isUpgrade()
Description copied from interface: LicenseServiceMBean
Determines whether the current license is an upgrade from a previous product
Specified by:
isUpgrade in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Returns:
true if the license is an upgrade

getLicenseType

public java.lang.String getLicenseType()
Description copied from interface: LicenseServiceMBean
Gets the license type description
Specified by:
getLicenseType in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Returns:
The license type description

getLastWarningMessage

public java.lang.String getLastWarningMessage()
Description copied from interface: LicenseServiceMBean
Gets the last warning message generated. The license provider may have generated a warning message (for example, an eval timeout that causes a reduced functionality). Getting the last warning message will clear it.
Specified by:
getLastWarningMessage in interface LicenseServiceMBean
Following copied from interface: jrunx.license.LicenseServiceMBean
Returns:
message The last warning message, or null for none

preDeregister

public void preDeregister()
                   throws java.lang.Exception


Copyright � 2002 Macromedia Corporation. All Rights Reserved.