org.mule.modules.boot
Class LicenseHandler

java.lang.Object
  extended byorg.mule.modules.boot.LicenseHandler

public class LicenseHandler
extends Object

This class has methods for displaying the EULA and saving the license acceptance acknowledgment.


Field Summary
static String ackFileName
           
static String ackJarName
           
static String ackLicenseName
           
static String defaultLicenseType
           
static String defaultLicenseVersion
           
static String licenseFileName
           
 
Constructor Summary
LicenseHandler(File muleHome)
          Constructor for when we only know MULE_HOME This is the constructor that the GUI installer should use.
LicenseHandler(File muleHome, File muleBase)
          Constructor for when we know both MULE_HOME and MULE_BASE This is the constructor used by MuleBootstrap
 
Method Summary
 boolean getAcceptance()
          Display the EULA and get the user's acceptance.
 boolean licenseJarExists()
          This method checks to see if there is a license jar file already.
 void saveLicenseAck(String licenseType, String licenseVersion)
          Saves the license acceptance acknowledgement file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultLicenseType

public static String defaultLicenseType

defaultLicenseVersion

public static String defaultLicenseVersion

ackJarName

public static String ackJarName

ackLicenseName

public static String ackLicenseName

ackFileName

public static String ackFileName

licenseFileName

public static String licenseFileName
Constructor Detail

LicenseHandler

public LicenseHandler(File muleHome)
Constructor for when we only know MULE_HOME This is the constructor that the GUI installer should use.

Parameters:
muleHome - File pointing to MULE_HOME

LicenseHandler

public LicenseHandler(File muleHome,
                      File muleBase)
Constructor for when we know both MULE_HOME and MULE_BASE This is the constructor used by MuleBootstrap

Parameters:
muleHome - File pointing to MULE_HOME
muleBase - File pointing to MULE_BASE
Method Detail

getAcceptance

public boolean getAcceptance()
Display the EULA and get the user's acceptance. Note that only a missing license file or a non-yes answer will cause this to return false. If the user accepts, but we can't write the license ack file for some reason, we'll still return true.

Returns:
boolean whether the license was accepted or not

saveLicenseAck

public void saveLicenseAck(String licenseType,
                           String licenseVersion)
                    throws Exception
Saves the license acceptance acknowledgement file. This method should be used by the GUI installer.

For now, the acknowlegment file is license.props and contains:

We are also making a copy of the license file into the jar as well. The logic here is:
  1. Normally, save the license ack in a jar in MULE_HOME/lib/mule called "mule-local-install.jar"
  2. If MULE_HOME/lib/mule is not writable AND MULE_BASE != MULE_HOME, try to save in MULE_BASE/lib/user
  3. If MULE_BASE/lib/user is not writable, something is probably strange and we need a third option ... which is ... well, I'm sure there is one ...

Parameters:
licenseType - type of license - for now, should be just MuleSource Public License
licenseVersion - version of license - for now, should be 1.1.3
Throws:
Exception - if there is nowhere to write the file or somehow the jar creation fails (disk full, etc.)

licenseJarExists

public boolean licenseJarExists()
This method checks to see if there is a license jar file already. It checks both MULE_HOME/lib/mule and, if relevant, MULE_BASE/lib/user.



Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.