|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.deployment.common.DeploymentUtils
public class DeploymentUtils
Utility methods for deployment.
| Field Summary | |
|---|---|
static String |
DAS_TARGET_NAME
|
static String |
DEPLOYMENT_PROPERTY_JAVA_WEB_START_ENABLED
|
static String |
DOMAIN_TARGET_NAME
|
| Constructor Summary | |
|---|---|
DeploymentUtils()
|
|
| Method Summary | |
|---|---|
static ArchiveType |
carType()
|
static long |
checksum(File directory)
Computes the checksum of the URIs of files contained in a directory. |
static Artifacts |
downloadableArtifacts(Application app)
Returns the downloadable artifacts object derived from the properties saved with the specified Application |
static Artifacts |
downloadableArtifacts(DeploymentContext dc)
Returns the downloadable artifacts object from the specified deployment context, creating it there if it does not already exist. |
static ArchiveType |
earType()
|
static ArchiveType |
ejbType()
|
static Artifacts |
generatedArtifacts(Application app)
Returns the generated artifacts object derived from the properties saved with the specified Application |
static Artifacts |
generatedArtifacts(DeploymentContext dc)
Returns the generated artifacts object from the specified deployment context, creating it there if it does not already exist. |
static String |
getDefaultEEName(String pathName)
|
static String |
getEmbeddedModulePath(String appRootPath,
String moduleUri)
This method returns the file path of an embedded module. |
static List<URI> |
getExternalLibraries(ReadableArchive archive)
|
static List<URL> |
getManifestLibraries(DeploymentContext context)
|
static List<URL> |
getManifestLibraries(DeploymentContext context,
Manifest manifest)
|
static List<URL> |
getManifestLibraries(ReadableArchive archive)
|
static List<URL> |
getModuleLibraryJars(DeploymentContext context)
|
static ArchiveType |
getModuleType(String moduleType)
Utility method to retrieve a ArchiveType from a stringified module type. |
static String |
getRelativeEmbeddedModulePath(String appRootPath,
String moduleUri)
This method returns the relative file path of an embedded module to the application root. |
static boolean |
hasResourcesXML(ReadableArchive archive)
|
static boolean |
isArchiveOfType(ArchiveHandler ah,
ArchiveType moduleType)
Return true the current module (aka archive) being deployed is of given module type, else false. |
static boolean |
isCAR(ReadableArchive archive)
check whether the archive is an appclient archive |
static boolean |
isDASTarget(String targetName)
|
static boolean |
isDomainTarget(String targetName)
|
static boolean |
isEAR(ReadableArchive archive)
check whether the archive is a .ear |
static boolean |
isEjbJar(ReadableArchive archive,
org.jvnet.hk2.component.Habitat habitat)
check whether the archive is an ejb archive |
static boolean |
isRAR(ReadableArchive archive)
check whether the archive is a .rar |
static boolean |
isRAR(ReadableArchive archive,
org.jvnet.hk2.component.Habitat habitat)
check whether the archive is a .rar, it also scans annotations |
static boolean |
isWebArchive(ReadableArchive archive)
|
static FileArchive |
openAsFileArchive(File dir,
ArchiveFactory archiveFactory)
Opens the specified file as an archive, using the provided archive factory. |
static String |
propertiesValue(Properties props,
char sep)
|
static ArchiveType |
rarType()
|
static String |
relativizeWithinDomainIfPossible(URI absURI)
|
static boolean |
useV2Compatibility(DeploymentContext context)
|
static void |
validateApplicationName(String name)
|
static ArchiveType |
warType()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEPLOYMENT_PROPERTY_JAVA_WEB_START_ENABLED
public static final String DAS_TARGET_NAME
public static final String DOMAIN_TARGET_NAME
| Constructor Detail |
|---|
public DeploymentUtils()
| Method Detail |
|---|
public static ArchiveType earType()
public static ArchiveType ejbType()
public static ArchiveType carType()
public static ArchiveType warType()
public static ArchiveType rarType()
public static ArchiveType getModuleType(String moduleType)
ArchiveType from a stringified module type.
Since ArchiveType is an extensible abstraction and implementations are plugged in via HK2 service
registry, this method returns null if HK2 service registry is not setup.
If null is passed to this method, it returns null instead of returning an arbitrary ArchiveType or throwing
an exception.
moduleType - String equivalent of the module type being looked up. null is allowed.
public static boolean isDASTarget(String targetName)
public static boolean isDomainTarget(String targetName)
public static long checksum(File directory)
directory - the directory for which to compute a checksum
public static Artifacts downloadableArtifacts(DeploymentContext dc)
dc - the deployment context from which to fetch the downloadable Artifacts object
public static Artifacts downloadableArtifacts(Application app)
app - the Application config object with (possibly) properties describing downloadable artifacts
public static Artifacts generatedArtifacts(DeploymentContext dc)
app -
public static Artifacts generatedArtifacts(Application app)
app - the Application config object with (possibly) properties describing generated artifacts
public static boolean isWebArchive(ReadableArchive archive)
public static String getDefaultEEName(String pathName)
pathName -
public static boolean hasResourcesXML(ReadableArchive archive)
public static boolean isRAR(ReadableArchive archive)
archive - archive to be tested
public static boolean isRAR(ReadableArchive archive,
org.jvnet.hk2.component.Habitat habitat)
archive - archive to be testedhabitat -
public static boolean isCAR(ReadableArchive archive)
archive - archive to be tested
public static boolean isEjbJar(ReadableArchive archive,
org.jvnet.hk2.component.Habitat habitat)
archive - archive to be testedhabitat -
public static boolean isEAR(ReadableArchive archive)
archive - archive to be tested
public static boolean isArchiveOfType(ArchiveHandler ah,
ArchiveType moduleType)
ah - current archivemoduleType -
public static String getRelativeEmbeddedModulePath(String appRootPath,
String moduleUri)
appRootPath - The path of the application root which
contains the module
e.g. $domain_dir/applications/j2ee-apps/foomoduleUri - The module uri
e.g. fooEJB.jar
public static String getEmbeddedModulePath(String appRootPath,
String moduleUri)
appRootPath - The path of the application root which
contains the module
e.g. $domain_dir/applications/j2ee-apps/foomoduleUri - The module uri
e.g. fooEJB.jar
public static boolean useV2Compatibility(DeploymentContext context)
public static String relativizeWithinDomainIfPossible(URI absURI)
throws URISyntaxException
URISyntaxExceptionpublic static void validateApplicationName(String name)
public static String propertiesValue(Properties props,
char sep)
public static List<URL> getManifestLibraries(DeploymentContext context)
throws IOException
IOException
public static List<URL> getManifestLibraries(DeploymentContext context,
Manifest manifest)
throws IOException
IOException
public static List<URL> getManifestLibraries(ReadableArchive archive)
throws IOException
IOExceptionpublic static List<URI> getExternalLibraries(ReadableArchive archive)
public static List<URL> getModuleLibraryJars(DeploymentContext context)
throws Exception
Exception
public static FileArchive openAsFileArchive(File dir,
ArchiveFactory archiveFactory)
throws IOException
dir - directory to be opened as an archivearchiveFactory - ArchiveFactory to use to create the archive object
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||