public class ClientArtifactsManager extends Object
An example: jaxrpc classes from web services deployment
Important node: Artifacts added to this manager are NOT downloaded to the client as separate files. In contrast, they are added to the generated client JAR file. That generated JAR, along with other files needed by the client, are downloaded.
A Deployer that needs to request for files to be downloaded to the client as part of the payload in the http command response should instead use DownloadableArtifactsManager.
The various add methods permit adding content in a variety of ways.
Ultimately we need to know two things: where is the physical file on the server
the content of which needs to be included in the client JAR, and what is the
relative path within the client JAR where the content should reside. Look
carefully at the doc for each add method when choosing which to use.
An instance of this class can be stored in the deployment context's transient app metadata so the various deployers can add to the same collection and so the app client deployer can find it and act on its contents.
Because other modules should add their artifacts before the the artifacts
have been consumed and placed into the client JAR file, the add methods do not permit
further additions once the artifacts method has been invoked.
| Modifier and Type | Field and Description |
|---|---|
static Logger |
deplLogger |
| Constructor and Description |
|---|
ClientArtifactsManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Artifacts.FullAndPartURIs artifact)
Adds a new artifact to the collection of artifacts to be added to the
client JAR file so they can be delivered to the client during a download.
|
void |
add(File baseFile,
File artifactFile)
Adds a new artifact to the collection of artifacts to be added to the
client facade JAR file so they can be delivered to the client during a
download.
|
void |
add(File artifactFile,
String relativePath,
boolean isTemporary)
Adds a new artifact to the collection of artifacts to be added to the
client JAR file so they can be delivered to the client during a
download.
|
void |
add(URI baseURI,
URI artifactURI)
Adds a new artifact to the collection of artifacts to be included in the
client JAR file so they can be delivered to the client during a
download.
|
void |
addAll(File baseFile,
Collection<File> artifactFiles)
Adds all artifacts in Collection to those to be added to the client
facade JAR.
|
Collection<Artifacts.FullAndPartURIs> |
artifacts()
Returns the set (in unmodifiable form) of FullAndPartURIs for the
accumulated artifacts.
|
boolean |
contains(File baseFile,
File artifactFile) |
boolean |
contains(URI baseURI,
URI artifactURI) |
protected void |
finalize() |
static ClientArtifactsManager |
get(org.glassfish.api.deployment.DeploymentContext dc)
Retrieves the client artifacts store from the provided deployment
context, creating one and storing it back into the DC if none is
there yet.
|
boolean |
isEmpty() |
public static final Logger deplLogger
public static ClientArtifactsManager get(org.glassfish.api.deployment.DeploymentContext dc)
dc - the deployment context to hold the ClientArtifactsManager objectpublic void add(URI baseURI, URI artifactURI)
baseURI - absolute URI of the base directory within which the
artifact liesartifactURI - absolute or relative URI where the artifact file residesIllegalStateException - if invokes after the accumulated artifacts have been consumedpublic void add(File baseFile, File artifactFile)
The relative path within the client JAR will be computed using the position of the artifact file relative to the base file.
baseFile - File for the base directory within which the artifact liesartifactFile - File for the artifact itselfIllegalStateException - if invoked after the accumulated artifacts have been consumedpublic void add(File artifactFile, String relativePath, boolean isTemporary)
This method helps when the contents of a temporary file are to be included in the client JAR, in which case the temp file might not reside in a useful place relative to a base directory. The caller can just specify the relative path directly.
artifactFile - file to be included in the client JARrelativePath - relative path within the JAR where the file's contents should appearisTemporary - whether the artifact file is a temporary file or notpublic boolean isEmpty()
public void add(Artifacts.FullAndPartURIs artifact)
Note that the "full" part of the FullAndPartURIs object can be of the form "jar:path-to-jar!entry-within-jar"
artifact - public void addAll(File baseFile, Collection<File> artifactFiles)
baseFile - File for the base directory within which each artifact liesartifactFiles - Collection of File objects for the artifacts to be includedIllegalStateException - if invoked after the accumulated artifacts have been consumedpublic Collection<Artifacts.FullAndPartURIs> artifacts()
Note: Intended for use only by the app client deployer.
Copyright © 2014. All rights reserved.