Class AppClientDeployer

  • All Implemented Interfaces:
    Deployer<AppClientContainerStarter,​AppClientServerApplication>, org.glassfish.hk2.api.PostConstruct

    @Service
    @Singleton
    public class AppClientDeployer
    extends JavaEEDeployer<AppClientContainerStarter,​AppClientServerApplication>
    implements org.glassfish.hk2.api.PostConstruct
    AppClient module deployer.

    Prepares JARs for download to the admin client and tracks which JARs should be downloaded for each application. (Downloads occur during deploy --retrieve or get-client-stubs command processing, or during Java Web Start launches of app clients. Also creates AppClientServerApplication instances for each client to provide Java Web Start support.

    Main responsibilities:

    • create a new facade JAR for each of the developer's original app client JARs, and
    • create a new facade JAR for the EAR (if the app client is part of an EAR), and
    • manage internal data structures that map each deployed app to the app client-related JARs that should be downloaded for that app.
    Each app client facade JAR contains:
    • a manifest which:
      • lists the GlassFish app client facade class as the Main-Class
      • contains a Class-Path entry referring to the developer's original JAR and any JARs in the EAR's library directory,
      • contains a GlassFish-specific item that is a relative URI pointing to the corresponding original JAR
      • contains a GlassFish-specific item identifying the main class in the developer's original JAR
      • contains a copy of the SplashScreen-Image item from the developer's original JAR, if there is one
    • the app client facade main class that prepares the ACC runtime environment before transferring control to the developer's main class
    • a copy of the splash screen image from the developer's original JAR, if there is one
    If the app client being deployed is part of an EAR, then the EAR facade represents an "app client group" and contains:
    • a manifest which:
      • declares the GlassFish EAR facade class as the Main-Class
      • lists the URIs to the individual app client facade JARs in a GlassFish-specific item
    • the GlassFish app client group facade main class

    For backward compatibility, the generated facade JAR is named ${appName}Client.jar and is downloaded into the local directory the user specifies on the deploy --retrieve or get-client-stubs command. Other JARs - the developer's original app client JAR(s) and any required library JARs - are downloaded into a subdirectory within that local directory named ${appName}Client. This segregates the files for different clients into different subdirectories to avoid naming collisions if the user downloads multiple clients into the same local directory.

    Author:
    tjquinn