Class AppClientDeployer
- java.lang.Object
-
- org.glassfish.javaee.core.deployment.JavaEEDeployer<AppClientContainerStarter,AppClientServerApplication>
-
- org.glassfish.appclient.server.core.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
orget-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.
- 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
- 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
orget-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
-
-
Field Summary
Fields Modifier and Type Field Description static String
APPCLIENT_AGENT_MAIN_CLASS_FILE
static String
APPCLIENT_COMMAND_CLASS_NAME
static String
APPCLIENT_FACADE_CLASS_FILE
protected Domain
domain
static Attributes.Name
GLASSFISH_APP_NAME
static Attributes.Name
GLASSFISH_APPCLIENT_MAIN_CLASS
static String
HELPER_KEY_NAME
Save the helper across phases in the deployment context's appPropsstatic Attributes.Name
SPLASH_SCREEN_IMAGE
-
Fields inherited from class org.glassfish.javaee.core.deployment.JavaEEDeployer
appRegistry, env, habitat, undeploymentVisitor
-
-
Constructor Summary
Constructors Constructor Description AppClientDeployer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<AppClientServerApplication>
appClientApps()
void
clean(DeploymentContext dc)
Clean any files and artifacts that were created during the execution of the prepare method.protected void
generateArtifacts(DeploymentContext dc)
MetaData
getMetaData()
Returns the meta data assocated with this DeployerAppClientServerApplication
load(AppClientContainerStarter containerStarter, DeploymentContext dc)
Loads a previously prepared application in its execution environment and return a ContractProvider instance that will identify this environment in future communications with the application's container runtime.void
postConstruct()
void
recordContextRoot(String appName, String clientURIWithinEAR, String userFriendlyContextRoot)
void
removeContextRoot(String appName, String clientURIWithinEAR)
void
unload(AppClientServerApplication application, DeploymentContext dc)
Unload or stop a previously running application identified with the ContractProvider instance.String
userFriendlyContextRoot(String appName, String clientModuleURI)
Returns the user-friendly context root for the specified app client.-
Methods inherited from class org.glassfish.javaee.core.deployment.JavaEEDeployer
getApplicationFromApplicationInfo, getCommonClassPath, getModuleClassPath, getObjectType, loadMetaData, prepare
-
-
-
-
Field Detail
-
APPCLIENT_FACADE_CLASS_FILE
public static final String APPCLIENT_FACADE_CLASS_FILE
- See Also:
- Constant Field Values
-
APPCLIENT_AGENT_MAIN_CLASS_FILE
public static final String APPCLIENT_AGENT_MAIN_CLASS_FILE
- See Also:
- Constant Field Values
-
APPCLIENT_COMMAND_CLASS_NAME
public static final String APPCLIENT_COMMAND_CLASS_NAME
- See Also:
- Constant Field Values
-
GLASSFISH_APPCLIENT_MAIN_CLASS
public static final Attributes.Name GLASSFISH_APPCLIENT_MAIN_CLASS
-
SPLASH_SCREEN_IMAGE
public static final Attributes.Name SPLASH_SCREEN_IMAGE
-
GLASSFISH_APP_NAME
public static final Attributes.Name GLASSFISH_APP_NAME
-
HELPER_KEY_NAME
public static final String HELPER_KEY_NAME
Save the helper across phases in the deployment context's appProps- See Also:
- Constant Field Values
-
domain
@Inject protected Domain domain
-
-
Method Detail
-
postConstruct
public void postConstruct()
- Specified by:
postConstruct
in interfaceorg.glassfish.hk2.api.PostConstruct
-
getMetaData
public MetaData getMetaData()
Description copied from class:JavaEEDeployer
Returns the meta data assocated with this Deployer- Specified by:
getMetaData
in interfaceDeployer<AppClientContainerStarter,AppClientServerApplication>
- Overrides:
getMetaData
in classJavaEEDeployer<AppClientContainerStarter,AppClientServerApplication>
- Returns:
- the meta data for this Deployer
-
load
public AppClientServerApplication load(AppClientContainerStarter containerStarter, DeploymentContext dc)
Description copied from class:JavaEEDeployer
Loads a previously prepared application in its execution environment and return a ContractProvider instance that will identify this environment in future communications with the application's container runtime.- Specified by:
load
in interfaceDeployer<AppClientContainerStarter,AppClientServerApplication>
- Overrides:
load
in classJavaEEDeployer<AppClientContainerStarter,AppClientServerApplication>
- Parameters:
containerStarter
- in which the application will residedc
- of the deployment- Returns:
- an ApplicationContainer instance identifying the running application
-
appClientApps
public Set<AppClientServerApplication> appClientApps()
-
unload
public void unload(AppClientServerApplication application, DeploymentContext dc)
Description copied from interface:Deployer
Unload or stop a previously running application identified with the ContractProvider instance. The container will be stop upon return from this method.- Specified by:
unload
in interfaceDeployer<AppClientContainerStarter,AppClientServerApplication>
- Parameters:
application
- instance to be stoppeddc
- of the undeployment
-
clean
public void clean(DeploymentContext dc)
Clean any files and artifacts that were created during the execution of the prepare method.- Specified by:
clean
in interfaceDeployer<AppClientContainerStarter,AppClientServerApplication>
- Overrides:
clean
in classJavaEEDeployer<AppClientContainerStarter,AppClientServerApplication>
- Parameters:
dc
- deployment context
-
generateArtifacts
protected void generateArtifacts(DeploymentContext dc) throws DeploymentException
- Overrides:
generateArtifacts
in classJavaEEDeployer<AppClientContainerStarter,AppClientServerApplication>
- Throws:
DeploymentException
-
recordContextRoot
public void recordContextRoot(String appName, String clientURIWithinEAR, String userFriendlyContextRoot)
-
userFriendlyContextRoot
public String userFriendlyContextRoot(String appName, String clientModuleURI)
Returns the user-friendly context root for the specified app client.Primarily used from the admin console for retrieving the context path for launching the specified app client.
- Parameters:
appName
-clientModuleURI
-- Returns:
-
-