Class AppClientDeployerHelper
- java.lang.Object
-
- org.glassfish.appclient.server.core.AppClientDeployerHelper
-
- Direct Known Subclasses:
NestedAppClientDeployerHelper
,StandaloneAppClientDeployerHelper
public abstract class AppClientDeployerHelper extends Object
Encapsulates the details of generating the required JAR file(s), depending on whether the app client is stand-alone or is nested inside an EAR.See also
StandaloneAppClientDeployerHelper
andNestedAppClientDeployerHelper
, the concrete implementation subclasses of AppClientDeployerHelper.- Author:
- tjquinn
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AppClientDeployerHelper.Proxy
Wrapper around AppClientDeployer for storage in the deployment context's meta data.
-
Field Summary
Fields Modifier and Type Field Description static String
ACC_MAIN_LOGGER
protected AppClientArchivist
archivist
static String
LOG_MESSAGE_RESOURCE
-
Constructor Summary
Constructors Modifier Constructor Description protected
AppClientDeployerHelper(DeploymentContext dc, ApplicationClientDescriptor bundleDesc, AppClientArchivist archivist, ClassLoader gfClientModuleClassLoader, Application application, org.glassfish.hk2.api.ServiceLocator habitat)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addClientPolicyFiles(OutputJarArchive clientFacadeArchive)
Adds the client policy files to the top-level generated JAR.protected abstract void
addTopLevelContentToClientFacade(OutputJarArchive facadeArchive)
ApplicationClientDescriptor
appClientDesc()
abstract URI
appClientServerOriginalAnchor(DeploymentContext dc)
Returns the URI on the server to the original location of the app client.abstract URI
appClientServerURI(DeploymentContext dc)
Returns the URI to the server's copy of the developer's original app client JAR.abstract URI
appClientURIWithinApp(DeploymentContext dc)
Returns the URI within the enclosing app of the app client JAR.abstract URI
appClientUserURI(DeploymentContext dc)
Returns the URI to the developer's original app client JAR within the download directory the user specifies in "deploy --retrieve" or "get-client-stubs."abstract URI
appClientUserURIForFacade(DeploymentContext dc)
Returns the URI to be used for the GlassFish-AppClient manifest entry in the facade.String
appName()
String
appName(DeploymentContext dc)
protected abstract Set<Artifacts.FullAndPartURIs>
clientLevelDownloads()
String
clientName()
protected abstract void
copyFileToTopLevelJAR(OutputJarArchive clientFacadeArchive, File f, String path)
abstract void
createAndAddLibraryJNLPs(AppClientDeployerHelper helper, TokenHelper tHelper, Map<String,DynamicContent> dynamicContent)
DeploymentContext
dc()
abstract Set<Artifacts.FullAndPartURIs>
earLevelDownloads()
protected abstract String
facadeClassPath()
Returns the class path to be stored in the manifest for the generated facade JAR file.protected abstract String
facadeFileNameAndType(DeploymentContext dc)
Returns the file name (and type) for the facade, excluding any directory information.abstract URI
facadeServerURI(DeploymentContext dc)
Returns the URI to the server's copy of the facade JAR file.abstract URI
facadeUserURI(DeploymentContext dc)
Returns the URI for the facade JAR, relative to the download directory to which the user will fetch the relevant JARs (either as part of "deploy --retrieve" or "get-client-stubs."abstract FixedContent
fixedContentWithinEAR(String uriString)
Returns a FixedContent object for the file, within the EAR, at the specified relative location.protected void
generateAppClientFacade()
abstract URI
groupFacadeServerURI(DeploymentContext dc)
abstract URI
groupFacadeUserURI(DeploymentContext dc)
Returns the URI for the group facade JAR, relative to the download directory to which the user will fetch the relevant JARs (either as part of "deploy --retrieve" or "get-client-stubs."protected InputStream
openByteCodeStream(String resourceName)
abstract String
pathToAppclientWithinApp(DeploymentContext dc)
Returns the relative path to the app client within the enclosing app.protected void
prepareJARs()
protected abstract String
PUScanTargets()
protected URI
relativeURIToGroupFacade()
abstract File
rootForSignedFilesInApp()
Returns the root directory for signed files in the applications.ApplicationSignedJARManager
signedJARManager()
Map<String,Map<URI,StaticContent>>
signingAliasToJar()
abstract URI
URIWithinAppDir(DeploymentContext dc, URI absoluteURI)
Returns a relative URI within the app directory for the specified absolute URI.
-
-
-
Field Detail
-
archivist
protected final AppClientArchivist archivist
-
ACC_MAIN_LOGGER
public static final String ACC_MAIN_LOGGER
- See Also:
- Constant Field Values
-
LOG_MESSAGE_RESOURCE
public static final String LOG_MESSAGE_RESOURCE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AppClientDeployerHelper
protected AppClientDeployerHelper(DeploymentContext dc, ApplicationClientDescriptor bundleDesc, AppClientArchivist archivist, ClassLoader gfClientModuleClassLoader, Application application, org.glassfish.hk2.api.ServiceLocator habitat) throws IOException
- Throws:
IOException
-
-
Method Detail
-
facadeServerURI
public abstract URI facadeServerURI(DeploymentContext dc)
Returns the URI to the server's copy of the facade JAR file.- Parameters:
dc
- the deployment context for the current deployment- Returns:
-
facadeUserURI
public abstract URI facadeUserURI(DeploymentContext dc)
Returns the URI for the facade JAR, relative to the download directory to which the user will fetch the relevant JARs (either as part of "deploy --retrieve" or "get-client-stubs."- Parameters:
dc
- the deployment context for the current deployment- Returns:
-
groupFacadeUserURI
public abstract URI groupFacadeUserURI(DeploymentContext dc)
Returns the URI for the group facade JAR, relative to the download directory to which the user will fetch the relevant JARs (either as part of "deploy --retrieve" or "get-client-stubs."- Parameters:
dc
- the deployment context for the current deployment- Returns:
-
groupFacadeServerURI
public abstract URI groupFacadeServerURI(DeploymentContext dc)
-
facadeFileNameAndType
protected abstract String facadeFileNameAndType(DeploymentContext dc)
Returns the file name (and type) for the facade, excluding any directory information.- Parameters:
dc
- the deployment context for the current deployment- Returns:
-
appClientUserURI
public abstract URI appClientUserURI(DeploymentContext dc)
Returns the URI to the developer's original app client JAR within the download directory the user specifies in "deploy --retrieve" or "get-client-stubs."- Parameters:
dc
-- Returns:
-
appClientUserURIForFacade
public abstract URI appClientUserURIForFacade(DeploymentContext dc)
Returns the URI to be used for the GlassFish-AppClient manifest entry in the facade.- Parameters:
dc
-- Returns:
-
appClientServerURI
public abstract URI appClientServerURI(DeploymentContext dc)
Returns the URI to the server's copy of the developer's original app client JAR.- Parameters:
dc
-- Returns:
-
appClientServerOriginalAnchor
public abstract URI appClientServerOriginalAnchor(DeploymentContext dc)
Returns the URI on the server to the original location of the app client.This is distinct from the appClientServerURI which could be in the generated directory (in the case of a directory deployment, for example). In some cases we need the original location of the app client on the server (for example, to resolve relative references from the app client JAR's manifest Class-Path).
- Parameters:
dc
-- Returns:
-
appClientURIWithinApp
public abstract URI appClientURIWithinApp(DeploymentContext dc)
Returns the URI within the enclosing app of the app client JAR. Stand-alone app clients are considered to lie within an "implied" containing app; the URI for such app clients is just the file name and type. The URI for nested app clients within an EAR is the module URI to the app client.- Parameters:
dc
-- Returns:
-
pathToAppclientWithinApp
public abstract String pathToAppclientWithinApp(DeploymentContext dc)
Returns the relative path to the app client within the enclosing app. The result will be an empty string for a stand-alone app clients because it has no such path, in reality. The result will be the relative URI within the EAR for a nested app client.- Parameters:
dc
-- Returns:
-
URIWithinAppDir
public abstract URI URIWithinAppDir(DeploymentContext dc, URI absoluteURI)
Returns a relative URI within the app directory for the specified absolute URI.- Parameters:
dc
-absoluteURI
-- Returns:
-
facadeClassPath
protected abstract String facadeClassPath()
Returns the class path to be stored in the manifest for the generated facade JAR file.- Returns:
-
PUScanTargets
protected abstract String PUScanTargets()
-
signedJARManager
public ApplicationSignedJARManager signedJARManager()
-
createAndAddLibraryJNLPs
public abstract void createAndAddLibraryJNLPs(AppClientDeployerHelper helper, TokenHelper tHelper, Map<String,DynamicContent> dynamicContent) throws IOException
- Throws:
IOException
-
signingAliasToJar
public Map<String,Map<URI,StaticContent>> signingAliasToJar()
-
dc
public final DeploymentContext dc()
-
appClientDesc
public ApplicationClientDescriptor appClientDesc()
-
appName
public String appName()
-
appName
public String appName(DeploymentContext dc)
-
clientName
public String clientName()
-
fixedContentWithinEAR
public abstract FixedContent fixedContentWithinEAR(String uriString)
Returns a FixedContent object for the file, within the EAR, at the specified relative location.- Parameters:
uriString
- relative path within the EAR- Returns:
- FixedContent object for the file
-
rootForSignedFilesInApp
public abstract File rootForSignedFilesInApp()
Returns the root directory for signed files in the applications.- Returns:
- File object for the signed JAR root directory
-
relativeURIToGroupFacade
protected URI relativeURIToGroupFacade()
-
prepareJARs
protected void prepareJARs() throws IOException, URISyntaxException
- Throws:
IOException
URISyntaxException
-
addTopLevelContentToClientFacade
protected abstract void addTopLevelContentToClientFacade(OutputJarArchive facadeArchive) throws IOException
- Throws:
IOException
-
addClientPolicyFiles
protected void addClientPolicyFiles(OutputJarArchive clientFacadeArchive) throws IOException
Adds the client policy files to the top-level generated JAR.For a stand-alone client (not in an EAR) this implementation adds the policy files to the generated app client facade JAR.
- Parameters:
clientFacadeArchive
- the generated app client facade JAR- Throws:
IOException
-
copyFileToTopLevelJAR
protected abstract void copyFileToTopLevelJAR(OutputJarArchive clientFacadeArchive, File f, String path) throws IOException
- Throws:
IOException
-
generateAppClientFacade
protected final void generateAppClientFacade() throws IOException, URISyntaxException
- Throws:
IOException
URISyntaxException
-
openByteCodeStream
protected InputStream openByteCodeStream(String resourceName) throws IOException
- Throws:
IOException
-
clientLevelDownloads
protected abstract Set<Artifacts.FullAndPartURIs> clientLevelDownloads() throws IOException
- Throws:
IOException
-
earLevelDownloads
public abstract Set<Artifacts.FullAndPartURIs> earLevelDownloads() throws IOException
- Throws:
IOException
-
-