org.jscience.util
Class LicenseLoader

java.lang.Object
  extended by org.jscience.util.LicenseLoader
All Implemented Interfaces:
LicenseHandler

public class LicenseLoader
extends java.lang.Object
implements LicenseHandler

can be used to aquire licenses from a known location on demand. The LicenseLoader can be initialized to first check a list of URLs to be loaded to aquire the needed license. Only if that fails (or if no URLs were configured to begin with), an upcoming dialog will enable the user to provide a location from where a final attempt is made to load the required license. If that last resort fails, too, a LicensingException to be thrown may be inevidable.

See Also:
Settings.setLicenseHandler(LicenseHandler), Settings.checkLicense(Object), LicensingException

Constructor Summary
LicenseLoader()
          Creates a new LicenseLoader object.
LicenseLoader(java.util.Collection<java.net.URL> col)
          Creates a new LicenseLoader object.
LicenseLoader(java.net.URL url)
          Creates a new LicenseLoader object.
LicenseLoader(java.net.URL[] list)
          Creates a new LicenseLoader object.
 
Method Summary
 void aquireLicense(java.lang.Object licensee)
          first checks the already known locations and tries to aquire a license from there; if that fails, a user dialog appears - allowing to choose another location.
 java.util.Vector<java.net.URL> getLocations()
          these URLs will be used to aquire licenses on demand before user interaction may be required.
 java.awt.Component getParentComponent()
          DOCUMENT ME!
 void setParentComponent(java.awt.Component c)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LicenseLoader

public LicenseLoader()
Creates a new LicenseLoader object.


LicenseLoader

public LicenseLoader(java.net.URL url)
Creates a new LicenseLoader object.

Parameters:
url - DOCUMENT ME!

LicenseLoader

public LicenseLoader(java.util.Collection<java.net.URL> col)
Creates a new LicenseLoader object.

Parameters:
col - DOCUMENT ME!

LicenseLoader

public LicenseLoader(java.net.URL[] list)
Creates a new LicenseLoader object.

Parameters:
list - DOCUMENT ME!
Method Detail

getParentComponent

public java.awt.Component getParentComponent()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setParentComponent

public void setParentComponent(java.awt.Component c)
DOCUMENT ME!

Parameters:
c - DOCUMENT ME!

getLocations

public java.util.Vector<java.net.URL> getLocations()
these URLs will be used to aquire licenses on demand before user interaction may be required.

Returns:
DOCUMENT ME!

aquireLicense

public void aquireLicense(java.lang.Object licensee)
first checks the already known locations and tries to aquire a license from there; if that fails, a user dialog appears - allowing to choose another location.

Specified by:
aquireLicense in interface LicenseHandler
Parameters:
licensee - DOCUMENT ME!
See Also:
Settings.checkLicense(Object), LicenseManager