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 --retrieveorget-client-stubscommand 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 --retrieveorget-client-stubscommand. 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 StringAPPCLIENT_AGENT_MAIN_CLASS_FILEstatic StringAPPCLIENT_COMMAND_CLASS_NAMEstatic StringAPPCLIENT_FACADE_CLASS_FILEprotected Domaindomainstatic Attributes.NameGLASSFISH_APP_NAMEstatic Attributes.NameGLASSFISH_APPCLIENT_MAIN_CLASSstatic StringHELPER_KEY_NAMESave the helper across phases in the deployment context's appPropsstatic Attributes.NameSPLASH_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()voidclean(DeploymentContext dc)Clean any files and artifacts that were created during the execution of the prepare method.protected voidgenerateArtifacts(DeploymentContext dc)MetaDatagetMetaData()Returns the meta data assocated with this DeployerAppClientServerApplicationload(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.voidpostConstruct()voidrecordContextRoot(String appName, String clientURIWithinEAR, String userFriendlyContextRoot)voidremoveContextRoot(String appName, String clientURIWithinEAR)voidunload(AppClientServerApplication application, DeploymentContext dc)Unload or stop a previously running application identified with the ContractProvider instance.StringuserFriendlyContextRoot(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:
postConstructin interfaceorg.glassfish.hk2.api.PostConstruct
-
getMetaData
public MetaData getMetaData()
Description copied from class:JavaEEDeployerReturns the meta data assocated with this Deployer- Specified by:
getMetaDatain interfaceDeployer<AppClientContainerStarter,AppClientServerApplication>- Overrides:
getMetaDatain classJavaEEDeployer<AppClientContainerStarter,AppClientServerApplication>- Returns:
- the meta data for this Deployer
-
load
public AppClientServerApplication load(AppClientContainerStarter containerStarter, DeploymentContext dc)
Description copied from class:JavaEEDeployerLoads 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:
loadin interfaceDeployer<AppClientContainerStarter,AppClientServerApplication>- Overrides:
loadin 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:DeployerUnload or stop a previously running application identified with the ContractProvider instance. The container will be stop upon return from this method.- Specified by:
unloadin 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:
cleanin interfaceDeployer<AppClientContainerStarter,AppClientServerApplication>- Overrides:
cleanin classJavaEEDeployer<AppClientContainerStarter,AppClientServerApplication>- Parameters:
dc- deployment context
-
generateArtifacts
protected void generateArtifacts(DeploymentContext dc) throws DeploymentException
- Overrides:
generateArtifactsin 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:
-
-