hudson.tools
Class JDKInstaller

java.lang.Object
  extended by hudson.tools.ToolInstaller
      extended by hudson.tools.JDKInstaller
All Implemented Interfaces:
ExtensionPoint, Describable<ToolInstaller>

public class JDKInstaller
extends ToolInstaller

Install JDKs from java.sun.com.

Since:
1.305
Author:
Kohsuke Kawaguchi

Nested Class Summary
static class JDKInstaller.CPU
          CPU type.
static class JDKInstaller.DescriptorImpl
           
static interface JDKInstaller.FileSystem
          Abstraction of the file system to perform JDK installation.
static class JDKInstaller.JDKFamily
           
static class JDKInstaller.JDKFamilyList
           
static class JDKInstaller.JDKFile
           
static class JDKInstaller.JDKList
          JDK list.
static class JDKInstaller.JDKRelease
           
static class JDKInstaller.Platform
          Supported platform.
static class JDKInstaller.Preference
           
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 boolean acceptLicense
          We require that the user accepts the license by clicking a checkbox, to make up for the part that we auto-accept cds.sun.com license click through.
 String id
          The release ID that Sun assigns to each JDK, such as "jdk-6u13-oth-JPR@CDS-CDS_Developer"
 
Fields inherited from class hudson.tools.ToolInstaller
tool
 
Constructor Summary
JDKInstaller(String id, boolean acceptLicense)
           
 
Method Summary
 JDKInstaller.DescriptorImpl getDescriptor()
          Gets the descriptor for this instance.
 void install(Launcher launcher, JDKInstaller.Platform p, JDKInstaller.FileSystem fs, TaskListener log, String expectedLocation, String jdkBundle)
          Performs the JDK installation to a system, provided that the bundle was already downloaded.
 URL locate(TaskListener log, JDKInstaller.Platform platform, JDKInstaller.CPU cpu)
          Performs a license click through and obtains the one-time URL for downloading bits.
 FilePath performInstallation(ToolInstallation tool, Node node, TaskListener log)
          Ensure that the configured tool is really installed.
 
Methods inherited from class hudson.tools.ToolInstaller
appliesTo, getLabel, preferredLocation, setTool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

public final String id
The release ID that Sun assigns to each JDK, such as "jdk-6u13-oth-JPR@CDS-CDS_Developer"

This ID can be seen in the "ProductRef" query parameter of the download page, like https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=jdk-6u13-oth-JPR@CDS-CDS_Developer


acceptLicense

public final boolean acceptLicense
We require that the user accepts the license by clicking a checkbox, to make up for the part that we auto-accept cds.sun.com license click through.

Constructor Detail

JDKInstaller

@DataBoundConstructor
public JDKInstaller(String id,
                                         boolean acceptLicense)
Method Detail

performInstallation

public FilePath performInstallation(ToolInstallation tool,
                                    Node node,
                                    TaskListener log)
                             throws IOException,
                                    InterruptedException
Description copied from class: ToolInstaller
Ensure that the configured tool is really installed. If it is already installed, do nothing. Called only if ToolInstaller.appliesTo(Node) are true.

Specified by:
performInstallation in class ToolInstaller
Parameters:
tool - the tool being installed
node - the computer on which to install the tool
log - any status messages produced by the installation go here
Returns:
the (directory) path at which the tool can be found, typically coming from ToolInstaller.preferredLocation(hudson.tools.ToolInstallation, hudson.model.Node)
Throws:
IOException - if installation fails
InterruptedException - if communication with a slave is interrupted

install

public void install(Launcher launcher,
                    JDKInstaller.Platform p,
                    JDKInstaller.FileSystem fs,
                    TaskListener log,
                    String expectedLocation,
                    String jdkBundle)
             throws IOException,
                    InterruptedException
Performs the JDK installation to a system, provided that the bundle was already downloaded.

Parameters:
launcher - Used to launch processes on the system.
p - Platform of the system. This determines how the bundle is installed.
fs - Abstraction of the file system manipulation on this system.
log - Where the output from the installation will be written.
expectedLocation - Path to install JDK to. Must be absolute and in the native file system notation.
jdkBundle - Path to the installed JDK bundle. (The bundle to download can be determined by locate(TaskListener, Platform, CPU) call.)
Throws:
IOException
InterruptedException

locate

public URL locate(TaskListener log,
                  JDKInstaller.Platform platform,
                  JDKInstaller.CPU cpu)
           throws IOException
Performs a license click through and obtains the one-time URL for downloading bits.

Throws:
IOException

getDescriptor

public JDKInstaller.DescriptorImpl getDescriptor()
Description copied from interface: Describable
Gets the descriptor for this instance.

Descriptor is a singleton for every concrete Describable implementation, so if a.getClass()==b.getClass() then a.getDescriptor()==b.getDescriptor() must hold.

Specified by:
getDescriptor in interface Describable<ToolInstaller>
Overrides:
getDescriptor in class ToolInstaller


Copyright © 2004-2013. All Rights Reserved.