@Service @Singleton public class AppClientDeployer extends JavaEEDeployer<AppClientContainerStarter,AppClientServerApplication> implements org.glassfish.hk2.api.PostConstruct
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:
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.
Modifier and Type | Field and 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 appProps
|
static Attributes.Name |
SPLASH_SCREEN_IMAGE |
appRegistry, env, habitat, undeploymentVisitor
Constructor and Description |
---|
AppClientDeployer() |
Modifier and Type | Method and 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 Deployer
|
AppClientServerApplication |
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.
|
getApplicationFromApplicationInfo, getCommonClassPath, getModuleClassPath, getObjectType, loadMetaData, prepare
public static final String APPCLIENT_FACADE_CLASS_FILE
public static final String APPCLIENT_AGENT_MAIN_CLASS_FILE
public static final String APPCLIENT_COMMAND_CLASS_NAME
public static final Attributes.Name GLASSFISH_APPCLIENT_MAIN_CLASS
public static final Attributes.Name SPLASH_SCREEN_IMAGE
public static final Attributes.Name GLASSFISH_APP_NAME
public static final String HELPER_KEY_NAME
@Inject protected Domain domain
public void postConstruct()
postConstruct
in interface org.glassfish.hk2.api.PostConstruct
public MetaData getMetaData()
JavaEEDeployer
getMetaData
in interface Deployer<AppClientContainerStarter,AppClientServerApplication>
getMetaData
in class JavaEEDeployer<AppClientContainerStarter,AppClientServerApplication>
public AppClientServerApplication load(AppClientContainerStarter containerStarter, DeploymentContext dc)
JavaEEDeployer
load
in interface Deployer<AppClientContainerStarter,AppClientServerApplication>
load
in class JavaEEDeployer<AppClientContainerStarter,AppClientServerApplication>
containerStarter
- in which the application will residedc
- of the deploymentpublic Set<AppClientServerApplication> appClientApps()
public void unload(AppClientServerApplication application, DeploymentContext dc)
Deployer
unload
in interface Deployer<AppClientContainerStarter,AppClientServerApplication>
application
- instance to be stoppeddc
- of the undeploymentpublic void clean(DeploymentContext dc)
clean
in interface Deployer<AppClientContainerStarter,AppClientServerApplication>
clean
in class JavaEEDeployer<AppClientContainerStarter,AppClientServerApplication>
dc
- deployment contextprotected void generateArtifacts(DeploymentContext dc) throws DeploymentException
generateArtifacts
in class JavaEEDeployer<AppClientContainerStarter,AppClientServerApplication>
DeploymentException
public void recordContextRoot(String appName, String clientURIWithinEAR, String userFriendlyContextRoot)
public String userFriendlyContextRoot(String appName, String clientModuleURI)
Primarily used from the admin console for retrieving the context path for launching the specified app client.
appName
- clientModuleURI
- Copyright © 2020. All rights reserved.