org.glassfish.deployment.common
Class ClientArtifactsManager

java.lang.Object
  extended by org.glassfish.deployment.common.ClientArtifactsManager

public class ClientArtifactsManager
extends Object

Records artifacts generated during deployment that need to be included inside the generated app client JAR so they are accessible on the runtime classpath.

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, then are added to the generated client JAR file. That generated JAR, along with other JARs 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. 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 app client deployer processes them, the add methods do not permit further additions once the artifacts method has been invoked.

Author:
tjuinn

Constructor Summary
ClientArtifactsManager()
           
 
Method Summary
 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(URI baseURI, URI artifactURI)
          Adds a new artifact to the collection of artifacts to be included in the client facade 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)
           
static ClientArtifactsManager get(DeploymentContext dc)
          Retreives the client artifacts store from the provided deployment context, creating one and storing it back into the DC if none is there yet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientArtifactsManager

public ClientArtifactsManager()
Method Detail

get

public static ClientArtifactsManager get(DeploymentContext dc)
Retreives the client artifacts store from the provided deployment context, creating one and storing it back into the DC if none is there yet.

Parameters:
dc - the deployment context to hold the ClientArtifactsManager object
Returns:
the ClientArtifactsManager object from the deployment context (created and stored in the DC if needed)

add

public void add(URI baseURI,
                URI artifactURI)
Adds a new artifact to the collection of artifacts to be included in the client facade JAR file so they can be delivered to the client during a download.

Parameters:
baseURI - absolute URI of the base directory within which the artifact lies
artifactURI - absolute or relative URI for the artifact itself
Throws:
IllegalStateException - if invokes after the accumulated artifacts have been consumed

add

public 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.

Parameters:
baseFile - File for the base directory within which the artifact lies
artifactFile - File for the artifact itself
Throws:
IllegalStateException - if invoked after the accumulated artifacts have been consumed

addAll

public void addAll(File baseFile,
                   Collection<File> artifactFiles)
Adds all artifacts in Collection to those to be added to the client facade JAR.

Parameters:
baseFile - File for the base directory within which each artifact lies
artifactFiles - Collection of File objects for the artifacts to be included
Throws:
IllegalStateException - if invoked after the accumulated artifacts have been consumed

contains

public boolean contains(URI baseURI,
                        URI artifactURI)

contains

public boolean contains(File baseFile,
                        File artifactFile)

artifacts

public Collection<Artifacts.FullAndPartURIs> artifacts()
Returns the set (in unmodifiable form) of FullAndPartURIs for the accumulated artifacts.

Note: Intended for use only by the app client deployer.

Returns:
all client artifacts reported by various deployers


Copyright © 2012. All Rights Reserved.